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

[OTEL-2370] add Span.Type tables for otel #27143

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

jackgopack4
Copy link
Contributor

What does this PR do? What is the motivation?

Add explanation for Span Type logic applied to OTel spans. Remove the "black box" from our approach

Merge instructions

Will comment when ready to merge

Merge readiness:

  • Ready for merge (not before team review)

Merge queue is enabled in this repo. To have it automatically merged after it receives the required reviews, create the PR (from a branch that follows the <yourname>/description naming convention) and then add the following PR comment:

/merge

Additional notes

@jackgopack4 jackgopack4 requested a review from IbraheemA January 15, 2025 21:52
@jackgopack4 jackgopack4 requested a review from a team as a code owner January 15, 2025 21:52
@jackgopack4 jackgopack4 changed the title add Span.Type tables for otel [OTEL-2370] add Span.Type tables for otel Jan 15, 2025
@jackgopack4
Copy link
Contributor Author

@IbraheemA I didn't add a table for Resource Name logic although I can if you'd like, only specific to db.system types since I know a lot of other things are in the works.

Copy link
Contributor

Preview links (active after the build_preview check completes)

Modified Files

@@ -105,6 +105,78 @@ Additional cloud provider-specific attributes are also mapped.
| `url.full` | `http.url` |
| `user_agent.original` | `http.useragent` |

## Span Type mapping
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are there unintuitive locations in the app that will look different depending on whether you set this correctly or not?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if I understand correctly, we may be filtering service type based on this attribute (left sidebar, "select a component", "systems", "datastores" for example).

Otherwise I believe it's mainly the "type" attribute in trace explorer etc.

Just pinged (pung?) apm-app to ask https://dd.slack.com/archives/CBGCZ9P5Y/p1737038147661419

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apparently span.type is used to filter special spans like RUM, CI, etc. I'm not sure about the question about unintuitive locations that will look different; asked a follow-up question

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mrakhman provided some helpful context in that thread

Based on the attributes included in your span, Datadog Agent and Datadog OpenTelemetry Components will attempt to infer the appropriate span type for better compatibility with other Datadog services. You may also explicitly set `span.type` attribute on any given span to override this logic using an [attributes][5] or [transform][6] processor, as well as by setting appropriate configuration values in OTel SDKs.

### OTel Span Attributes -> Datadog Span Type
The following table shows the Span Type mapping logic that is used if feature flag `enable_receive_resource_spans_v2` is set. The chart is in order of precedence.
Copy link
Contributor

@julianocosta89 julianocosta89 Jan 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be great to point out where the enable_receive_resource_spans_v2 needs to be enabled.
Is that on the OTel Collector?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its in either Agent or in OTel Collector. Good point, I can add that info. @IbraheemA is there a blog post for this flag or only for the OperationAndResourceNameV2?

@jackgopack4 jackgopack4 force-pushed the jackgopack4/add-db-span.Type-mappings branch from dfaf718 to d19f464 Compare January 16, 2025 14:46
@jackgopack4 jackgopack4 requested a review from urseberry January 16, 2025 14:50
@jackgopack4 jackgopack4 force-pushed the jackgopack4/add-db-span.Type-mappings branch from 7127375 to bdf3c49 Compare January 16, 2025 18:07
Based on the attributes included in your span, the Datadog Agent and Datadog OpenTelemetry components attempt to infer the appropriate span type for better compatibility with other Datadog services. You may also explicitly set the `span.type` attribute on any given span to override this logic using an [attributes][5] or a [transform][6] processor, as well as by setting appropriate configuration values in OpenTelemetry SDKs.

### Map OpenTelemetry span attribute to Datadog span type
The following table shows the span type mapping logic that is used if the feature flag `enable_receive_resource_spans_v2` is set in the Datadog Agent or the Datadog Exporter. The chart lists mappings in order of precedence.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've checked on the Collector-Contrib repo and I saw that the FF is available for DD Exporter and DD Connector:
https://github.com/search?q=repo%3Aopen-telemetry%2Fopentelemetry-collector-contrib%20enable_receive_resource_spans_v2&type=code

Does the flag need to be enabled in both components?
I guess so, right?!
Otherwise we may calculate APM stats wrongly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, you're right. thank you. I will fix.

@jackgopack4 jackgopack4 requested a review from a team January 17, 2025 18:46
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.

4 participants