Skip to content

[receiver/datadog] service.name not set at trace resource resulting in OTLPResourceNoServiceName #21210

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

Closed
mvadu opened this issue Apr 27, 2023 · 6 comments
Assignees
Labels
bug Something isn't working receiver/datadog

Comments

@mvadu
Copy link

mvadu commented Apr 27, 2023

Component(s)

receiver/datadog

What happened?

Description

Currently in addResourceData service.name is not set. Its set in the span attributes. Because of this traces exported to backends like Grafana tempo are appearing as OTLPResourceNoServiceName.

Steps to Reproduce

receivers:
 otlp:
   protocols:
     grpc:
     http:
       cors:
         allowed_origins:
           - "http://*"
           - "https://*"
 datadog:
   endpoint: 0.0.0.0:8126
   read_timeout: 60s

exporters:
 otlp:
   endpoint: tempo:4317
   tls:
     insecure: true 
 logging:
 prometheus:
   endpoint: "otelcol:9464"
   resource_to_telemetry_conversion:
     enabled: true
   enable_open_metrics: true

processors:
 batch:

service:
 pipelines:
   traces:
     receivers: [datadog]
     processors: [batch]
     exporters: [otlp]
  • Validate the traces received in Tempo

Expected Result

The service Name should be populated in Service Name filter which uses the Resources section
ref:

Actual Result

The Resource section does not contains a service.name tag, thus resulting in OTLPResourceNoServiceName
image

Collector version

v0.75.0

Environment information

Environment

OS: Ubuntu 20

OpenTelemetry Collector configuration

receivers:
 otlp:
   protocols:
     grpc:
     http:
       cors:
         allowed_origins:
           - "http://*"
           - "https://*"
 datadog:
   endpoint: 0.0.0.0:8126
   read_timeout: 60s

exporters:
 otlp:
   endpoint: tempo:4317
   tls:
     insecure: true 
 logging:
 prometheus:
   endpoint: "otelcol:9464"
   resource_to_telemetry_conversion:
     enabled: true
   enable_open_metrics: true

processors:
 batch:

service:
 pipelines:
   traces:
     receivers: [datadog]
     processors: [batch]
     exporters: [otlp]

Log output

No response

Additional context

No response

@mvadu mvadu added bug Something isn't working needs triage New item requiring triage labels Apr 27, 2023
@github-actions
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@atoulme atoulme removed the needs triage New item requiring triage label Apr 29, 2023
@boostchicken
Copy link
Member

taking a look

@boostchicken
Copy link
Member

boostchicken commented May 1, 2023

Upon further review I yanked the PR.
I ran a test locally and it looks good, also our unit tests show copying service name just fine. here is what we are doing

attrs := newSpan.Attributes()
attrs.EnsureCapacity(len(span.GetMeta()) + 1)
attrs.PutStr(semconv.AttributeServiceName, span.Service)

span being th Datadog Span. Since DD is a snowflake, a name to them is not driven off a tag, it has a special field. That is where we pull service.name from.

So everything looks fine to me.

Is your request to also copy service.name from a tag?

@mvadu
Copy link
Author

mvadu commented May 12, 2023

@boostchicken sorry for delay in responding John. Please find below the steps to recreate the issue. Core of it is with Tempo expecting the service name to be available in Resource section of the trace, where as the translator is only adding it in Attributes section of the trace.

Steps to reproduce:

  1. clone and run the sample app in https://github.com/mvadu/dd-otel-tempo with docker compose up

  2. navigate to http://localhost:3000/explore? you will see a Tempo based search UI. Select Search, under span names select one of the GET requests and select Run queries

  3. You will see bunch of traces generated from java app sent to tempo via dd agent-> dd receiver -> otlp exporter

  4. expand any of them by clicking the trace id

  5. observe the right hand side.
    image

  6. Now in the same search UI select the Service Name dropdown and select loadgenerator, and click run queries. These are generated by Open Telemetry Python SDK and sent directly to tempo.

  7. If you expand any of them now you will see the service name properly.
    image

@gouthamve Could you please have someone from Tempo team review this and clarify why Tempo is expecting the service.name under Resource section?

codeboten pushed a commit that referenced this issue May 15, 2023
…ions. (#21764)

Updating the translations for the datadog receiver to be more align with Otel Semantic Conventions to ensure integrations with other applications will work

**Link to tracking Issue:** 
Resolves issue #21525
And #21210
@MovieStoreGuy
Copy link
Contributor

Will be fixed in the next released.

@mvadu
Copy link
Author

mvadu commented May 24, 2023

Thank you @MovieStoreGuy for fixing this.. I did hear from Tempo team on their expectations, adding it here incase someone comes across this at a future date.

Based on this section of Otel Spec (https://opentelemetry.io/docs/specs/otel/resource/sdk/#sdk-provided-resource-attributes) Tempo expects service.name and telemetry.sdk group be present in the Resource section of the trace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working receiver/datadog
Projects
None yet
Development

No branches or pull requests

4 participants