ory / hydra

OpenID Certified™ OpenID Connect and OAuth Provider written in Go - cloud native, security-first, open source API security for your infrastructure. SDKs for any language. Works with Hardware Security Modules. Compatible with MITREid.
https://www.ory.sh/hydra/?utm_source=github&utm_medium=banner&utm_campaign=hydra
Apache License 2.0
15.27k stars 1.47k forks source link

deployment.environment key is received empty from hydra in opentelemetry collector #3782

Open diecgia opened 1 week ago

diecgia commented 1 week ago

Preflight checklist

Ory Network Project

No response

Describe the bug

After upgrading hydra to version 2.2.0, we receive in our opentelemetry collector the deployment.environment key as empty. We have set in hydra the following env vars for otel config:

TRACING_SERVICE_NAME="hydra"
TRACING_PROVIDER="otel"
TRACING_PROVIDERS_OTLP_INSECURE=true
TRACING_PROVIDERS_OTLP_SAMPLING_SAMPLING_RATIO=0.4
TRACING_PROVIDERS_OTLP_SERVER_URL="otel:4318"
OTEL_RESOURCE_ATTRIBUTES="service.name=hydra,deployment.environment=stg,service.version=2.2.0" 

In the collector, we receive the attributes as follows: Resource attributes: -> deployment.environment: Str() -> service.name: Str(hydra) -> service.version: Str(2.2.0)

Reproducing the bug

In hydra v2.2.0, set the following env vars:

TRACING_SERVICE_NAME="hydra"
TRACING_PROVIDER="otel"
TRACING_PROVIDERS_OTLP_INSECURE=true
TRACING_PROVIDERS_OTLP_SAMPLING_SAMPLING_RATIO=0.4
TRACING_PROVIDERS_OTLP_SERVER_URL="otel:4318"
OTEL_RESOURCE_ATTRIBUTES="service.name=hydra,deployment.environment=stg,service.version=2.2.0" 

Relevant log output

No response

Relevant configuration

No response

Version

2.2.0

On which operating system are you observing this issue?

Linux

In which environment are you deploying?

Docker

Additional Context

No response