Skip to content

Span resource name set with tag is not used #2374

@paco-spr

Description

@paco-spr

Describe the bug

Using a tag to set the resource name does not work and instead shows up as the operation name in the datadog ui. This comes from a bug in this library and even has a TODO comment to resolve it. In DDSpanContext getResourceName does not read the "resource.name" set in the tags, but it does read it when returning a value for hasResourceName. You can work around this by casting the span to DDSpan and setting the resource name using span.setResourceName() but this seems like a bug in the library.

Reproduction steps

import io.opentracing.util.GlobalTracer

val spanBuilder = GlobalTracer.get().build("operation_name")
spanBuilder.withTag("resource.name", "custom resource name")
spanBuilder.start().finish()

Logcat logs

No response

Expected behavior

No response

Affected SDK versions

2.14.0

Latest working SDK version

never

Did you confirm if the latest SDK version fixes the bug?

Yes

Kotlin / Java version

No response

Gradle / AGP version

No response

Other dependencies versions

No response

Device Information

No response

Other relevant information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions