open-telemetry / opentelemetry-rust-contrib

OpenTelemetry Contrib Packages for Rust
Apache License 2.0
35 stars 34 forks source link

[Feature]: Overriding name of span sent to datadog #52

Closed Dispersia closed 6 months ago

Dispersia commented 6 months ago

Related Problems?

No response

What component are you working with?

opentelemetry-datadog

Describe the solution you'd like:

This might already be possible and I don't understand how to use it, however I want to dynamically name original spans that are sent to datadog as thats what shows up to group by under the Resources panel (for instance, a webapi having a dynamic route from the base tracer for any additional route added, with method attached), using tracing and not the opentelemetry tracer, however it seems to take the span name no matter what I do. I'm having a hard time seeing what calls what, but it looks like from: https://github.com/open-telemetry/opentelemetry-rust-contrib/blob/a98f9be5fdad2b28105c034d9d43a3e82a5deeb5/opentelemetry-datadog/src/exporter/model/v05.rs#L176 and https://github.com/open-telemetry/opentelemetry-rust-contrib/blob/a98f9be5fdad2b28105c034d9d43a3e82a5deeb5/opentelemetry-datadog/src/exporter/model/mod.rs#L159 that there is some way to do it that I don't see, do I have to set up that mapping? is that set internally? Or how can I call to change the name of the span that is sent to DataDog

Considered Alternatives

No response

Additional Context

No response

Hartigan commented 6 months ago

Hi If you use tracing -> tracing_subscriber -> opentelemetry -> opentelemetry_datadog, you may specify resource name by setting otel.name in source span. Then specify resource mapping to span_data.name.

Dispersia commented 6 months ago

Worked perfectly, thanks! Just curious, what does setting that resource mapping do? I seem to be able to just set otel.name and it works as far as I can see in the dash, but just want to make sure I'm not missing something