Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add an option to limit length of values of attributes and metric values #1130
Changes from 20 commits
4507656
deca25b
748eae0
e7e54b3
10af7ba
ed9bc5f
dabb292
4102464
a6da2b9
c175613
5259377
d4c28eb
df01ff4
5ea1f00
47c86a3
8bd3a9b
c2ed17c
05173b9
5b763d3
b180054
1434084
77a0688
5bde7ba
cf73a3b
50556d1
f3c5243
89f4b3a
992b132
f428739
6f9992a
dd0b245
e3d7b73
e526784
243b07d
cd51664
ff664a2
53522b6
684a0a6
d33eadf
49b7ec9
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with the sentiment of this paragraph -- we should tell the user when we discard or modify their telemetry data and we should be careful not to overwhelm a telemetry collection system by providing too many error messages about bad data.
This, to me, is the wrong place to specify error handling behavior. I'd like to see statements about error handling in general in the library guidelines part of the specification. For errors like this which may occur as a result of user data, I typically configure them to print once per minute or so. I believe we should use metrics to count occurrences of excessive metric value length and/or count.
Both of these outputs, logs and/or metrics about these events, are a form of "meta" telemetry, and the specification's SDK guidelines should say we aim to (1) do this well, (2) at low cost. For meta-telemetry logs this means once rarely per log statement, for metrics this means a requirement to have low cardinality, for example.
I propose removing this paragraph and filing an issue to update the library guidelines with general guidance on handling errors of this nature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jmacd Given that this is in line with existing spec here https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/sdk.md#span-limits, do you think we could leave the paragraph as is, create the issue, and once we reach a consensus, I'll create a PR which will address this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jmacd please feel free to amend the issue #1787 if you'd like to describe the problem in a different way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jmacd does the above work for you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think solving this issue with logging is not the ideal solution. It assumes that logging is always available, which is not always the case - many languages have no standard log framework, and even if they do, using std log is not always what the rest of the application is using. In other words, logger must always be treated as a dependency, which may or may not be available.
In addition, the throttling of the logs effectively requires keeping a state per span. So why not report truncations as part of the span itself?
Regarding #1787, why not leave this paragraph out of this PR until an agreement on #1787 is reached? We are changing the spec, after all, it's better to leave the behavior unspecified than to change it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yurishkuro I have changed "SHOULD" to "SHOULD NOT" to satisfy this criteria:
This isn't exactly what you asked for, but I think it does the job.
EDIT: Also, I'd appreciate if you double posted these comments about logging on the issue, otherwise it'll be hard to make any progress there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's confusing to have this here and not in the common section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is true.
Our data model is stable and in it, the attributes contribute to the identity of a metric. If we truncate attributes we need to denote how that changes the identity of the point.
I'm not sure the SDK exiting experimental status will change this point
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the diff with OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Applies to all attributes, except Metrics (temporarily exempted due to experimental status), so effectively that (for now) means spans and events. EDIT: also resources
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before we go ahead: how does this interact with the rest of the related environment variables? What if the user sets
OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT
and alsoOTEL_ATTRIBUTE_COUNT_LIMIT
? I'm guessing what you expect here, but it's not clarified anywhere.For what is worth, if you remove this, we can totally merge this (and have this single environment variable done as a follow up, etc).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So previously there was a paragraph about this in sdk-environment-variables, but there was an error in one of the sentences, and because it also applies to programmatic configuration, I moved that paragraph here https://github.com/open-telemetry/opentelemetry-specification/pull/1130/files#diff-500cb43b9725373c25ea03660c293e59681e6e2f6ba3eb588188ed3b83dcbdcdR79.
I hope the wording is clear and we can merge.