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

Model specific limits should attempt to use global limits before falling back o defaults #1878

Closed
owais opened this issue Aug 19, 2021 · 1 comment · Fixed by #1893
Closed
Assignees
Labels
spec:trace Related to the specification/trace directory

Comments

@owais
Copy link
Contributor

owais commented Aug 19, 2021

What are you trying to achieve?

We have two types of limits today. Global limits and model specific limits. Here is what the spec has to say about the case where both global and model specific versions of the same limit are defined:

An SDK MAY implement model-specific limits, for example SpanAttributeCountLimit. If both a general and a model-specific limit are implemented, then the SDK MUST first attempt to use the model-specific limit, if it isn't set and doesn't have a default, then the SDK MUST attempt to use the general limit.

List of global limits and model specific limits.

Model specific limits OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT, OTEL_EVENT_ATTRIBUTE_COUNT_LIMIT and OTEL_LINK_ATTRIBUTE_COUNT_LIMIT all have default values of 128. This means if an SDK implements the model specific limits thenOTEL_ATTRIBUTE_COUNT_LIMIT will always be a noop. I think this can be counter intuitive to users. As a user, if I don't specify any model specific limit and only a single global limit, I'd expect all models to respect the global limit. This would also allow users to specify common limits using the global limit option and then override just one of the model specific limits. For example, if I want to limit link attribute count to 16 but everything else to 32, today I have to specify the following env vars:

OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT=32
OTEL_LINK_ATTRIBUTE_COUNT_LIMIT=32
OTEL_EVENT_ATTRIBUTE_COUNT_LIMIT=16

Specifying the global OTEL_ATTRIBUTE_COUNT_LIMIT would have no effect here as all of the above have default values (128) which would be used in case these env vars were not specified.

I think it'd be far more intuitive if users could set the following values to achieve the same effect.

OTEL_ATTRIBUTE_COUNT_LIMIT=32
OTEL_EVENT_ATTRIBUTE_COUNT_LIMIT=16

I propose the SDK should use the following order to load model specific limits:

  1. Use the model specific limit if set.
  2. else use the corresponding global limit if set.
  3. else use the default value for model specific limit (if any)
  4. else use the default value for the corresponding global limit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
spec:trace Related to the specification/trace directory
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants