Skip to content

OTEL_RESOURCE_ATTRIBUTES parsing has whitespace in keys #1540

Open
@inssein

Description

@inssein

We run all of our services in Kubernetes, and define our open telemetry resource attributes like so:

            - name: OTEL_RESOURCE_ATTRIBUTES
              value: >
                service.name=redacted,
                service.version=redacted,
                k8s.node.name=$(KUBE_NODE_NAME),
                k8s.pod.name=$(KUBE_POD_NAME),
                k8s.pod.uid=$(KUBE_POD_ID),
                k8s.namespace.name=$(KUBE_NAMESPACE)

All of our other services (java, python) seem to split on "=" and then clean up whitespace in the key, but unfortunately the ruby library sends over service.version=redacted (note the whitespace in front of the key).

Looks like the problem is here: https://github.com/open-telemetry/opentelemetry-ruby/blob/main/sdk/lib/opentelemetry/sdk/resources/resource.rb#L47-L50

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingkeep

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions