-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
pkg/trace/api: normalize span name before remapping for OTLP #12176
pkg/trace/api: normalize span name before remapping for OTLP #12176
Conversation
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.
just a little nit and then looks good for docs
releasenotes/notes/apm-otlp-normalize-span-name-before-remapping-15fa7e8767cea706.yaml
Outdated
Show resolved
Hide resolved
…ng-15fa7e8767cea706.yaml Co-authored-by: Kaylyn <kaylyn.sigler@datadoghq.com>
Thank you for reviewing the release note. I've applied your suggestion (2b6e573) |
@@ -509,6 +509,13 @@ func (o *OTLPReceiver) convertSpan(rattr map[string]string, lib pcommon.Instrume | |||
name = "opentelemetry." + name | |||
} | |||
} | |||
|
|||
normalized, err := traceutil.NormalizeName(name) |
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'm not convinced by this change. The remapping feature should remap the OpenTelemetry name to a new Datadog name, which gets normalised later on, if it has to. Doing this here will just create confusion and potential issues later on.
In my opinion, the current behaviour is better and the span name remappings should refer to the actual OpenTelemetry name, and not a Datadog normalized version of 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.
@gbbr
Thank you for reviewing and the comment.
I got your point and yes, you're right.
Even though I created this pull request for the compatibility, I also think the current behavior is ideal.
So I'm happy to close this pull request, however it would be great if you mention the breaking change on the remapping feature and update the span_name_remappings
example on in open-telemetry/opentelemetry-collector-contrib#9693
Thank 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.
Agreed. Added here: open-telemetry/opentelemetry-collector-contrib@8871434
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.
Thank you for adding to CHANGELOG.
If possible, I think it's better to update the example here as well:
https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/9693/files#diff-8c91465b7f1defd1410e697b702a817163bc88cee637ace3f202bb7f83321cb6
# go.opentelemetry.io_contrib_instrumentation_net_http_otelhttp.client: http.client
I'm closing this pull request.
Thank you!
What does this PR do?
This pull request adds span name normalization before remapping for OTLP.
Motivation
While trying open-telemetry/opentelemetry-collector-contrib#9693 I found that it will change the
span_name_remappings
's behavior.For example, if we have the following setting in otel-collector config:
and if the OpenTelemetry library is
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp
, the currentdatadogexporter
can properly remap the name tohttp.client
.However, if we use
pkg/trace
indatadogexporter
(open-telemetry/opentelemetry-collector-contrib#9693), it doesn't remap because of missing the normalization.I think
span_name_remappings
's behavior should be compatible after the change (open-telemetry/opentelemetry-collector-contrib#9693)Additional Notes
span_name_remappings
example: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/143cafc3c376c627058209334d50ecf97ed7b205/exporter/datadogexporter/example/config.yaml#L199-L202Possible Drawbacks / Trade-offs
Describe how to test/QA your changes
Reviewer's Checklist
Triage
milestone is set.major_change
label if your change either has a major impact on the code base, is impacting multiple teams or is changing important well-established internals of the Agent. This label will be use during QA to make sure each team pay extra attention to the changed behavior. For any customer facing change use a releasenote.changelog/no-changelog
label has been applied.qa/skip-qa
label is not applied.team/..
label has been applied, indicating the team(s) that should QA this change.need-change/operator
andneed-change/helm
labels have been applied.