OTLP: root spans that represent outgoing calls don't count into destination metrics
- Dominant language
- Go
- Stars
- 1.3k
- Forks
- 543
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 109
Description
Scenario: use the OTEL SDK to create a span for an HTTP client call which is not enclosed within the context of an incoming request. Send this span to APM Server via OTLP.
Expected outcome: destination metrics are created
Actual outcome: as these OTEL spans are modeled as transactions, `processSpans` will never get called. Also, these events will not have a `DestinationService.Resource`.
https://github.com/elastic/apm-server/blob/51c999c3365099a4385036fedd50286830561af9/x-pack/apm-server/aggregation/spanmetrics/aggregator.go#L210-L213
The same issue happens when using OTEL bridge in APM Agents and creating a span that represents an outgoing HTTP request which doesn't have a parent.
A related issue is that these events will not be considered in the service map.
This has an impact on our iOS agent which creates root spans for outgoing HTTP requests if there's no parent span.
Kudos to @eyalkoren for identifying this as a potential issue.
cc @akhileshpok for potential impact on the iOS agent
cc @axw as you implemented both OTLP intake and span destination metrics
Contributor guide
Assessment
This issue has not been assessed yet.