Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OTEL_SDK_DISABLED env var to disable opentelemetry SDK. #2679

Merged
merged 19 commits into from
Sep 22, 2022

Conversation

brunobat
Copy link
Contributor

@brunobat brunobat commented Jul 19, 2022

Fixes #2667

Changes

Add OTEL_SDK_ENABLED environment property
This will allow applications to easily deactivate opentelemetry on deployments where it's not supported or needed.
This property is already present in the Java SDK version under experimental status. See: https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk-extensions/autoconfigure/README.md#disabling-opentelemetrysdk

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jul 19, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: brunobat / name: Bruno Baptista (27e70e4)

Signed-off-by: Bruno Baptista <bbaptist@redhat.com>
@brunobat brunobat marked this pull request as ready for review July 22, 2022 10:08
@brunobat brunobat requested review from a team as code owners July 22, 2022 10:08
CHANGELOG.md Outdated Show resolved Hide resolved
specification/sdk-environment-variables.md Outdated Show resolved Hide resolved
specification/sdk-environment-variables.md Outdated Show resolved Hide resolved
specification/sdk-environment-variables.md Outdated Show resolved Hide resolved
specification/sdk-environment-variables.md Outdated Show resolved Hide resolved
@arminru arminru added enhancement New feature or request area:sdk Related to the SDK area:configuration Related to configuring the SDK labels Jul 25, 2022
Signed-off-by: brunobat <brunobat@gmail.com>
Signed-off-by: brunobat <brunobat@gmail.com>
@brunobat
Copy link
Contributor Author

Did the requested changes @arminru @joaopgrassi .

joaopgrassi
joaopgrassi previously approved these changes Jul 26, 2022
@brunobat
Copy link
Contributor Author

Hi @jmacd, can we move forward with the merge?

@Emily-Jiang
Copy link

It seems this PR was blocked from merging as it requires Code Owner to review. Can someone from that group view this and merge this PR? Thanks

Copy link
Member

@tigrannajaryan tigrannajaryan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I advise to circulate this PR in the Maintainers meeting on Monday to make sure there are no languages where peculiarities of env variable querying can impact on how the variable's values should be defined. We have had some issues in this area which resulted in the precise behavior specification for Numbers and Enums.

specification/sdk-environment-variables.md Outdated Show resolved Hide resolved
spec-compliance-matrix.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
@joaopgrassi joaopgrassi dismissed their stale review August 3, 2022 14:00

I think folks brought up important topics since I reviewed that have to be discussed/addressed so I'm reverting it for now.

CHANGELOG.md Outdated Show resolved Hide resolved
…a new issue.

Signed-off-by: brunobat <brunobat@gmail.com>
@brunobat
Copy link
Contributor Author

The Boolean definition has now been moved to #2729

Copy link
Member

@robbkidd robbkidd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As the review of this spec update has evolved, it seems the title, description, and content of the change have diverged.

The current state of the proposal has the env var name ending with _DISABLED.

✅ That's reflected in the title and the tables in compliance matrix and SDK env vars list.

⚠️ The CHANGELOG still states _ENABLED.

❓ The PR's original description also says _ENABLED which was the original proposal. It could help people reviewing this PR for the first time after all the discussion for the PR description to be edited to include an update describing the current state of the proposal.

CHANGELOG.md Outdated Show resolved Hide resolved
Co-authored-by: Robb Kidd <robb@thekidds.org>
@jmacd
Copy link
Contributor

jmacd commented Aug 17, 2022

@MrAlias do you accept the current contents of this PR? I believe the goal of specifying a "DISABLED" variable with exactly one meaningful value ("true") was to avoid the general problem you described with interpreting booleans.

@github-actions
Copy link

This PR was marked stale due to lack of activity. It will be closed in 7 days.

@github-actions github-actions bot added the Stale label Aug 25, 2022
@carlosalberto
Copy link
Contributor

Ping @MrAlias

@MrAlias
Copy link
Contributor

MrAlias commented Aug 25, 2022

@MrAlias do you accept the current contents of this PR? I believe the goal of specifying a "DISABLED" variable with exactly one meaningful value ("true") was to avoid the general problem you described with interpreting booleans.

This is the correct direction, but a boolean value is still under-specified in this PR. It looks like #2729 needs to be resolved before this can progress, as was discussed in the spec SIG meeting two weeks ago.

@github-actions github-actions bot removed the Stale label Aug 26, 2022
@marcalff
Copy link
Member

marcalff commented Sep 2, 2022

Ok in principle, this will allows to disable telemetry in every applications the same way, without application specific options, or no options at all when the application forgot to provide one: very desirable feature.

About the naming:
OTEL_SDK_DISABLED=False, the default behavior, is a double negation

This is equivalent to:
OTEL_SDK_ENABLED=True

with no OTEL_SDK_ENABLED environment variable provided meaning True.

The concern about the double negation is the confusion it can create, in particular for non English speakers.

It seems the PR started with OTEL_SDK_ENABLED=True, then later changed to OTEL_SDK_DISABLED=False, but I can't find a comment or a rationale for it, so not sure who requested that, and why.

This is minor (or bikeshed even), feel free to ignore.
Looking to support this in opentelemetry-cpp.

@jack-berg
Copy link
Member

jack-berg commented Sep 2, 2022

@marcalff see this comment. The current thinking is that any boolean environment variable should be named *_ENABLED_* or *_DISABLED_* such that if a default value of false aligns with the desired default behavior.

@marcalff
Copy link
Member

marcalff commented Sep 2, 2022

@marcalff see this comment. The current thinking is that any boolean environment variable should be named *_ENABLED_* or *_DISABLED_* such that if a default value of false aligns with the desired default behavior.

Thanks @jack-berg for the clarification.

I think this is a dangerous path to take : if somehow, for a given variable, we decide to change the default for whatever reason, the variable will not be renamed, creating a weird state.

In other words, it could be desirable to decouple the variable name (immutable to avoid breaking configuration for users) from the default value (possibly subject to change other time). This convention creates coupling.

Regards,
-- Marc

@github-actions
Copy link

This PR was marked stale due to lack of activity. It will be closed in 7 days.

@github-actions github-actions bot added the Stale label Sep 16, 2022
@brunobat
Copy link
Contributor Author

This is still waiting for #2729

@github-actions github-actions bot removed the Stale label Sep 17, 2022
@reyang
Copy link
Member

reyang commented Sep 22, 2022

This is still waiting for #2729

#2729 is resolved by #2755.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:configuration Related to configuring the SDK area:sdk Related to the SDK enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make OTEL_EXPERIMENTAL_SDK_ENABLED stable