-
Notifications
You must be signed in to change notification settings - Fork 21
feat(otlp)!: Export OTLP spans with attribute-level OTel compatibility #2091
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
Open
zacharycmontoya
wants to merge
8
commits into
main
Choose a base branch
from
zach.montoya/otlp-compatibility-mode
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+285
−34
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
7332acb
feat(otel): Update the trace exporter with a OTel trace compatbility …
zacharycmontoya 110a9ef
Fix dropped attributes count calculation toaccount for OTel Trace Com…
zacharycmontoya 2d0d234
Update the DD span => OTLP span mapping to remove the 'error.msg' and…
zacharycmontoya 2efa686
Run the linter
zacharycmontoya e86566e
Exclude the "span.kind" span attribute from being emitted on OTLP spa…
zacharycmontoya 06a7212
Rename the config to `otel_trace_semantics_enabled`
zacharycmontoya 91c8608
Fix linter issues
zacharycmontoya 61a273f
Small comment update
zacharycmontoya File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -65,6 +65,7 @@ pub struct TraceExporterBuilder { | |
| connection_timeout: Option<u64>, | ||
| otlp_endpoint: Option<String>, | ||
| otlp_headers: Vec<(String, String)>, | ||
| otel_trace_semantics_enabled: bool, | ||
| } | ||
|
|
||
| impl TraceExporterBuilder { | ||
|
|
@@ -296,6 +297,16 @@ impl TraceExporterBuilder { | |
| self | ||
| } | ||
|
|
||
| /// Enables OTel trace semantics, which does not add DD-specific per-span attributes | ||
| /// (`service.name`, `operation.name`, `resource.name`, `span.type`) to the OTLP payload. | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comment as here. |
||
| /// This is useful when exporting to a native OTel backend that does not expect Datadog | ||
| /// semantics. The host language tracer is expected to observe this behavior by setting the | ||
| /// `DD_TRACE_OTEL_SEMANTICS_ENABLED` environment variable to `true`. | ||
| pub fn enable_otel_trace_semantics(&mut self) -> &mut Self { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you need to add a corresponding function to the FFI API? |
||
| self.otel_trace_semantics_enabled = true; | ||
| self | ||
| } | ||
|
|
||
| /// Build the [`TraceExporter`] synchronously. | ||
| /// | ||
| /// Sync facade over [`Self::build_async`]; panics inside an existing tokio context. | ||
|
|
@@ -452,6 +463,7 @@ impl TraceExporterBuilder { | |
| .map(Duration::from_millis) | ||
| .unwrap_or(DEFAULT_OTLP_TIMEOUT), | ||
| protocol: OtlpProtocol::HttpJson, | ||
| otel_trace_semantics_enabled: self.otel_trace_semantics_enabled, | ||
| } | ||
| }); | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
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.
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.
Aren't you also stripping
error.msg,error.message, andspan.kind?