Skip to content

Add support for OpenTelemetry resource attributes #6942

@brettmc

Description

@brettmc

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions