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

feat(otlp): duplicate resource and instrumentation attrs into spans #4533

Merged
merged 3 commits into from
Feb 28, 2025

Conversation

mjq
Copy link
Member

@mjq mjq commented Feb 27, 2025

OTLP trace payloads contain a nested structure wherein resources contain instrumentation scopes, and instrumentation scopes contain spans. The attributes set on the resource or instrumentation scope apply to all contained spans, and are useful to query and aggregate on at the span level. (For example, resource attributes conventionally contain the service name and version of the service emitting spans).

When converting incoming OTLP traces into individual OtelSpan items, denormalize these incoming extra attributes onto each span. This will make the data available in Sentry for viewing, searching, and aggregation. Prefix each attribute name with a prefix indicating its source so that attributes with the same name from different sources don't clobber each other.

(We might change our mind on whether these attributes should be prefixed or not - that's fine as no one is using the OTLP endpoint or OtlpSpan envelope item type yet).

In addition to an attributes dictionary, instrumentation scopes also have name and version string properties. Copy those to spans too.

mjq added 2 commits February 26, 2025 13:43
OTLP trace payloads contain a nested structure wherein resource contain
instrumentation scopes, and instrumentation scopes contain spans. The
attributes set on the resource or instrumentation scope apply to all contained
spans, and are useful to query and aggregate on at the span level. (For
example, resource attributes conventionally contain the service name and
version of the service emitting spans).

When converting incoming OTLP traces into individual `OtelSpan` items,
denormalize these incoming extra attributes onto each span. This will make the
data available in Sentry for viewing, searching, and aggregation. Prefix each
attribute name with a prefix indicating its source so that attributes with the
same name from different sources don't clobber each other.

(We might change our mind on whether these attributes should be prefixed or not
- that's fine as no one is using the OTLP endpoint or `OtlpSpan` envelope item
type yet).

In addition to an `attributes` dictionary, instrumentation scopes also have
`name` and `version` string properties. Copy those to spans too.
@mjq mjq requested a review from a team as a code owner February 27, 2025 18:50
@mjq mjq changed the title Mjq denormalize resource instrumentation attrs feat(otlp): duplicate resource and instrumentation attrs into spans Feb 27, 2025
@Dav1dde Dav1dde requested a review from jan-auer February 27, 2025 19:21
@mjq mjq merged commit ac33079 into master Feb 28, 2025
25 checks passed
@mjq mjq deleted the mjq-denormalize-resource-instrumentation-attrs branch February 28, 2025 19:07
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.

2 participants