What is the underlying problem you're trying to solve?
I would like the traces emitted by OPA to contain custom resource attributes that I provide. For example, service.namespace, which allows me to differentiate between the traces from multiple OPA instances.
Describe the ideal solution
Provide distributed_tracing.resource_attributes config, which accepts a list of key-value pairs, which are passed along to the OpenTelemetry SDK. Most OpenTelemetry SDKs do this via the OTEL_RESOURCE_ATTRIBUTES environment variable, and those would be passed to the tracer provider
Describe a "Good Enough" solution
Using https://opentelemetry.io/docs/languages/go/resources/ resource.WithFromEnv()in
|
res, err := resource.New(ctx, |
could allow providing resource attributes from the environment
Additional Context
What is the underlying problem you're trying to solve?
I would like the traces emitted by OPA to contain custom resource attributes that I provide. For example,
service.namespace, which allows me to differentiate between the traces from multiple OPA instances.Describe the ideal solution
Provide
distributed_tracing.resource_attributesconfig, which accepts a list of key-value pairs, which are passed along to the OpenTelemetry SDK. Most OpenTelemetry SDKs do this via theOTEL_RESOURCE_ATTRIBUTESenvironment variable, and those would be passed to the tracer providerDescribe a "Good Enough" solution
Using https://opentelemetry.io/docs/languages/go/resources/
resource.WithFromEnv()inopa/internal/distributedtracing/distributedtracing.go
Line 102 in 291825e
Additional Context