Skip to content

Adding environment variables for event and link attribute limits#1751

Merged
carlosalberto merged 7 commits intoopen-telemetry:mainfrom
codeboten:codeboten/add-limit-env-vars
Jun 25, 2021
Merged

Adding environment variables for event and link attribute limits#1751
carlosalberto merged 7 commits intoopen-telemetry:mainfrom
codeboten:codeboten/add-limit-env-vars

Conversation

@codeboten
Copy link
Copy Markdown
Contributor

Fixes #1750

Changes

Adding environment variable definitions for span event and link attributes.

@codeboten codeboten requested review from a team June 9, 2021 16:48
alrex and others added 2 commits June 14, 2021 17:13
Co-authored-by: Nikita Salnikov-Tarnovski <gnikem@gmail.com>
@carlosalberto
Copy link
Copy Markdown
Contributor

@open-telemetry/specs-approvers please review/approve ;)

@tigrannajaryan
Copy link
Copy Markdown
Member

Somewhat meta, but I am a bit worried about the proliferation of the env variables. I wonder if this is desirable or we should only have basic capabilities controlled by env variables and the rest requires writing actual code? Taken to the extreme we can start coding the entire SDK behavior in the env variables. Is there a good way to think about what should be an env variable and what shouldn't?

@codeboten
Copy link
Copy Markdown
Contributor Author

Is there a good way to think about what should be an env variable and what shouldn't?

I agree, it would be great to have guidelines on this. Specifically around this PR, I think there should be equivalent variables for all available limits configuration, otherwise i could imagine this being confusing as a user. Why would some limits be configurable via env variables vs others not.

I suspect these will become less important once there's a configuration format available for otel components.

@iNikem
Copy link
Copy Markdown
Contributor

iNikem commented Jun 17, 2021

We cannot forbid language SIGs to provide configuration via environment variables. And as soon as one SDK has them, it is a good idea to standardise them across languages. But then, as @codeboten mentioned, it will be confusing to do that only for a subset of configuration options.

@carlosalberto
Copy link
Copy Markdown
Contributor

I agree with @tigrannajaryan's point (hence my initial idea of having a single env var to handle all the attribute limits), but for this case I think it does make sense to add them right now.

Hopefully the new Instrumentation group will be able to work out further details like this (as they are part of the configuration area). cc @tedsuo

@carlosalberto
Copy link
Copy Markdown
Contributor

Also, unless we have some opposition, let's merge this by early Monday, so allow more time for people to review/approve this.

| OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT | Maximum allowed span attribute count | 128 | |
| OTEL_SPAN_EVENT_COUNT_LIMIT | Maximum allowed span event count | 128 | |
| OTEL_SPAN_LINK_COUNT_LIMIT | Maximum allowed span link count | 128 | |
| OTEL_EVENT_ATTRIBUTE_COUNT_LIMIT | Maximum allowed attribute per span event count | 128 | |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Prefix with OTEL_SPAN_ for consistency? Otherwise the name makes it seem like it applies to all events.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Surprising, but okay if it's decided already.

@tigrannajaryan
Copy link
Copy Markdown
Member

#1130 seems to be a very similar PR for different things to limit.

My initial worry stands: there seems to be a proliferation of env variables. Is there a point where this becomes unmanageable? Are we aiming at having full behavior configuration via env variables? Taken to the extreme we need a Turing-complete language and supply programs in env variables that modify the default behavior of SDK. I am not convinced this is the right direction.

Perhaps we need to support a config file and have one env variable that points to the config file to use?

@tigrannajaryan
Copy link
Copy Markdown
Member

#1130 seems to be a very similar PR for different things to limit.

My initial worry stands: there seems to be a proliferation of env variables. Is there a point where this becomes unmanageable? Are we aiming at having full behavior configuration via env variables? Taken to the extreme we need a Turing-complete language and supply programs in env variables that modify the default behavior of SDK. I am not convinced this is the right direction.

Perhaps we need to support a config file and have one env variable that points to the config file to use?

@open-telemetry/technical-committee and @open-telemetry/specs-approvers: I would like your opinion before this PR gets merged.

I am not against this particular PR, but would like to understand if we need some best practices around no-code configuration and whether what we do with env variables is acceptable long term.

@carlosalberto
Copy link
Copy Markdown
Contributor

@tigrannajaryan we decided during the last SIG call to go ahead with these two aforementioned PRs, while creating #1773 to track the configuration dilemma. Let me know if that works for you ;)

@tigrannajaryan
Copy link
Copy Markdown
Member

@tigrannajaryan we decided during the last SIG call to go ahead with these two aforementioned PRs, while creating #1773 to track the configuration dilemma. Let me know if that works for you ;)

SGTM.

@carlosalberto carlosalberto merged commit 7fc2873 into open-telemetry:main Jun 25, 2021
carlosalberto pushed a commit to carlosalberto/opentelemetry-specification that referenced this pull request Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Span link and event count limits should have corresponding environment variables

7 participants