[receiver/datadog] Implement support for span links#37449
Conversation
|
Any comments on this, @MovieStoreGuy? :) |
| // UnmarshalJSON inflates trace id from hex string, possibly enclosed in quotes. | ||
| // TODO: Find a way to avoid this duplicate code. Consider to expose this in pdata. | ||
| func unmarshalJSON(dst []byte, src []byte) error { | ||
| func UnmarshalJSON(dst []byte, src []byte) error { |
There was a problem hiding this comment.
As the TODO comment states, this code is duplicated from internal core pdata, see here https://github.com/open-telemetry/opentelemetry-collector/blob/v0.119.0/pdata/internal/data/bytesid.go. As such, I'm not sure it's a good idea to expose this function from this package (certainly not with this name, as it does not at all give a good idea of what's it's doing). I think that ideally this function would be exposed from pdata.
There was a problem hiding this comment.
You might not even need this after all, if you use the suggestion I made on the ddreceiver component itself.
There was a problem hiding this comment.
That worked; thanks!
| // UnmarshalJSON inflates trace id from hex string, possibly enclosed in quotes. | ||
| // TODO: Find a way to avoid this duplicate code. Consider to expose this in pdata. | ||
| func unmarshalJSON(dst []byte, src []byte) error { | ||
| func UnmarshalJSON(dst []byte, src []byte) error { |
There was a problem hiding this comment.
You might not even need this after all, if you use the suggestion I made on the ddreceiver component itself.
|
Thank you for the suggestion @jpkrohling; just implemented it, and it worked like a charm! Would you mind taking another look? Thanks! :) |
andrzej-stencel
left a comment
There was a problem hiding this comment.
Awesome, thanks Juraci and Felipe!
|
There's a merge conflict there, once that's sorted out, this is ready to be merged. |
Fixed, @jpkrohling. |
* main: (76 commits) Update All OpenTelemetry Collector Contrib packages (open-telemetry#37839) [chore] fix codeowners allowlist (open-telemetry#37856) Update module github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp to v1.26.0 (open-telemetry#37841) Update module github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common to v1.0.1095 (open-telemetry#37825) Update module github.com/grpc-ecosystem/grpc-gateway/v2 to v2.26.1 (open-telemetry#37821) [chore][exporter/elasticsearch] Bump go-docappender to v2.5.0 (open-telemetry#37852) Update All github.com/aws packages (open-telemetry#37816) Update module google.golang.org/protobuf to v1.36.5 (open-telemetry#37827) Update module github.com/SAP/go-hdb to v1.12.12 (open-telemetry#37817) Update module github.com/huaweicloud/huaweicloud-sdk-go-v3 to v0.1.135 (open-telemetry#37822) Update module github.com/ClickHouse/clickhouse-go/v2 to v2.31.0 (open-telemetry#37835) [receiver/datadog] Implement support for span links (open-telemetry#37449) receiver/prometheusreceiver: allow cumulative resets when using the adjuster (open-telemetry#37718) Update README.md (open-telemetry#37826) [receiver/github] add workflow run event trace handling (open-telemetry#37578) Update All github.com/datadog packages to v0.62.2 (open-telemetry#37838) [chore] Update types used in extensiontest.NewNopSettingsWithType (open-telemetry#37844) [processor/redaction] introduce `allowed_values` parameter in processor config (open-telemetry#37638) [chore] Update otel version (open-telemetry#37808) [testbed] Include CPU and memory limits to benchmark results file (open-telemetry#36753) ...
…7449) <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description Currently, there is no way to create [Span Links](https://opentelemetry.io/docs/concepts/signals/traces/#span-links) from Datadog spans through the Datadog receiver. This implements support for Span Links via DD tracing library's own attribute ([_dd.span_links](https://github.com/DataDog/dd-trace-java/blob/78e523d5bb643d9fc3f3b02a00cbb4889befe454/dd-trace-api/src/main/java/datadog/trace/api/DDTags.java#L56)). The [payload format](https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/37449/files#diff-776d8a37714f68338101d91e29a20c8244f19acba413426ad638ed111d8cf9b9R42) is also the same adopted by the [tracing library](https://github.com/DataDog/dd-trace-java/blob/96dcbbe6144ef50e7e3b13e838bcdc4f412b841b/dd-trace-core/src/main/java/datadog/trace/core/DDSpanLink.java#L62-L94) and the [agent](https://github.com/DataDog/datadog-agent/blob/57115d85853ba1e6007594ddfdf320bba7477e63/pkg/trace/api/otlp_test.go#L4057-L4158) <!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. --> #### Link to tracking issue Fixes <!--Describe what testing was performed and which tests were added.--> #### Testing <!--Describe the documentation added.--> #### Documentation <!--Please delete paragraphs that you did not use before submitting.-->
Description
Currently, there is no way to create Span Links from Datadog spans through the Datadog receiver.
This implements support for Span Links via DD tracing library's own attribute (_dd.span_links).
The payload format is also the same adopted by the tracing library and the agent
Link to tracking issue
Fixes
Testing
Documentation