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

sdk/trace: Log when an attribute/event/link is discarded due to limits #5343

Closed
pellared opened this issue May 9, 2024 · 2 comments · Fixed by #5434
Closed

sdk/trace: Log when an attribute/event/link is discarded due to limits #5343

pellared opened this issue May 9, 2024 · 2 comments · Fixed by #5434
Assignees
Labels
area:trace Part of OpenTelemetry tracing enhancement New feature or request pkg:SDK Related to an SDK package
Milestone

Comments

@pellared
Copy link
Member

pellared commented May 9, 2024

From https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/sdk.md#span-limits:

There SHOULD be a message printed in the SDK's log to indicate to the user that an attribute was discarded due to such a limit. To prevent excessive logging, the message MUST be printed at most once per span (i.e., not per discarded attribute, event, or link).

@pellared pellared added enhancement New feature or request pkg:SDK Related to an SDK package area:trace Part of OpenTelemetry tracing labels May 9, 2024
@MrAlias MrAlias modified the milestones: v1.27.0, v1.28.0 May 10, 2024
@MrAlias MrAlias self-assigned this May 28, 2024
@MrAlias
Copy link
Contributor

MrAlias commented May 28, 2024

Updating the title. There is not recommendation that truncated attributes be logged.

@MrAlias MrAlias changed the title sdk/trace: Log when an attribute was discarded or truncated due to limits sdk/trace: Log when an attribute was discarded due to limits May 28, 2024
@MrAlias
Copy link
Contributor

MrAlias commented May 28, 2024

There is specification ambiguity about discarded events and links being logged. I'm going to assume open-telemetry/opentelemetry-specification#4064 lands and log for all.

@MrAlias MrAlias changed the title sdk/trace: Log when an attribute was discarded due to limits sdk/trace: Log when an attribute/event/link is discarded due to limits May 28, 2024
MrAlias added a commit that referenced this issue May 30, 2024
…its (#5434)

Fix #5343

- Update the `evictionQueue` to log when it drops a value
- Update the `evictionQueue` to be declared over an `[T any]` parameter
so it knows what to log when it is dropping a value and to reduce the
`interface{}` allocation
- Add a `clone` method to replace the now unneeded
`interfaceArrayTo*Array` functions.
- Update the `recordingSpan` to log once that is dropped an attribute
when limits are reached.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:trace Part of OpenTelemetry tracing enhancement New feature or request pkg:SDK Related to an SDK package
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants