open-telemetry/opentelemetry-ruby

`OTEL_RESOURCE_ATTRIBUTES` parsing has whitespace in keys

inssein opened this issue · 3 comments

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

👋 This issue has been marked as stale because it has been open with no activity. You can: comment on the issue or remove the stale label to hold stale off for a while, add the keep label to hold stale off permanently, or do nothing. If you do nothing this issue will be closed eventually by the stale bot.

This is being worked on in #1541

👋 This issue has been marked as stale because it has been open with no activity. You can: comment on the issue or remove the stale label to hold stale off for a while, add the keep label to hold stale off permanently, or do nothing. If you do nothing this issue will be closed eventually by the stale bot.