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 an option to limit length of values of attributes and metric values #1130

Conversation

jtmalinowski
Copy link
Contributor

@jtmalinowski jtmalinowski commented Oct 22, 2020

Docs are based on existing Java implementation open-telemetry/opentelemetry-java#1484

Fixes #1133

Messaging about truncation was extracted to open-telemetry/semantic-conventions#1163

Metrics support extracted to #1830

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Oct 22, 2020

CLA Check
The committers are authorized under a signed CLA.

@jtmalinowski jtmalinowski marked this pull request as ready for review October 22, 2020 13:52
@jtmalinowski jtmalinowski requested review from a team as code owners October 22, 2020 13:52
@Oberon00
Copy link
Member

Please create an issue for this PR.

@Oberon00 Oberon00 added area:sdk Related to the SDK release:after-ga Not required before GA release, and not going to work on before GA spec:trace Related to the specification/trace directory labels Oct 22, 2020
specification/trace/sdk.md Outdated Show resolved Hide resolved
@jtmalinowski jtmalinowski requested a review from a team as a code owner October 23, 2020 11:45
@jtmalinowski jtmalinowski changed the title Add an option to limit span attribute length Add an option to limit length of values of span attributes and metric values Oct 23, 2020
@jtmalinowski
Copy link
Contributor Author

PR extended to include metric label values.

specification/trace/sdk.md Outdated Show resolved Hide resolved
specification/trace/sdk.md Outdated Show resolved Hide resolved
specification/sdk-environment-variables.md Outdated Show resolved Hide resolved
specification/trace/sdk.md Outdated Show resolved Hide resolved
specification/metrics/sdk.md Outdated Show resolved Hide resolved
specification/metrics/sdk.md Outdated Show resolved Hide resolved
Co-authored-by: Armin Ruech <armin.ruech@dynatrace.com>
@Oberon00
Copy link
Member

Oberon00 commented Oct 23, 2020

PR extended to include metric label values.

👍

I was just reminded that resource values might also be relevant here. Sorry for the piece-wise comments 🙈

@Oberon00
Copy link
Member

One more thing @jtmalinowski: Please either fill out the PR description or remove the part of the template that you don't use.

specification/trace/sdk.md Outdated Show resolved Hide resolved
Co-authored-by: Nikita Salnikov-Tarnovski <gnikem@gmail.com>
specification/metrics/sdk.md Outdated Show resolved Hide resolved
specification/sdk-environment-variables.md Outdated Show resolved Hide resolved
@jsuereth
Copy link
Contributor

@jtmalinowski and I discussed this offline.

Action Items:

  1. @jtmalinowski is going to update this PR so the metric-exemption is called out where the global attribute limit is defined, making it clear to implementers (and hopefully their documentation) that metrics are NOT impacted by this setting.
  2. @jtmalinowski is going to open a bug/feature request to support metrics for Attribute limits. Specifically we need to deal with the issues of:
  • Metric Identity overlap post-truncation
  • Which attributes should be kept for metrics? (@reyang has this hint-api idea for preserving important attributes)
  • Should attribute truncation happen before or after View attribute truncation?
  • Should attribute truncation in metrics be considered user configuration error?

jtmalinowski and others added 3 commits July 27, 2021 13:15
Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>
@jtmalinowski
Copy link
Contributor Author

@arminru @jsuereth @yurishkuro All issues addressed!


#### Exempt Entities

Attributes which belong to Metrics MUST NOT implement the aforementioned
Copy link
Member

Choose a reason for hiding this comment

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

again, you cannot put MUST's into spec if the intention is to change the rules in the near future. It's not a backwards compatible change. Either leave the behavior unspecified or use the weak MAY.

@iNikem
Copy link
Contributor

iNikem commented Jul 27, 2021

@jsuereth Do you approve or something else should be changed?

@jsuereth
Copy link
Contributor

Sorry for delay @iNikem. Changes LGTM

@jtmalinowski
Copy link
Contributor Author

@arminru Let's do it 🚀

@carlosalberto
Copy link
Contributor

Fine to merge but I really want to have a follow up having what happens when you define both OTEL_ATTRIBUTE_COUNT_LIMIT and related variables, e.g. OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT. At this moment it's not clear which one has higher priority.

@jtmalinowski
Copy link
Contributor Author

@carlosalberto https://github.com/open-telemetry/opentelemetry-specification/pull/1130/files#diff-500cb43b9725373c25ea03660c293e59681e6e2f6ba3eb588188ed3b83dcbdcdR78 describes it like so:

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 [...]

I think that it can be inferred from the context that it extends to environment variables, ie. if OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT is set or has a default then for Span Attributes it takes priority.

@iNikem
Copy link
Contributor

iNikem commented Aug 3, 2021

@open-telemetry/technical-committee can anybody press merge?

@carlosalberto
Copy link
Contributor

I think that it can be inferred from the context that it extends to environment variables, ie. if OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT is set or has a default then for Span Attributes it takes priority.

I think we can do better than leave things inferred and we can put a link to this section from the env vars ;) But let's definitely do that as a minor amendment after this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:sdk Related to the SDK release:after-ga Not required before GA release, and not going to work on before GA spec:trace Related to the specification/trace directory
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability to limit length of values of attributes and metric values