Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for OpenTelemetry resource attributes #6942

Closed
brettmc opened this issue Aug 20, 2024 · 1 comment · Fixed by #6947
Closed

Add support for OpenTelemetry resource attributes #6942

brettmc opened this issue Aug 20, 2024 · 1 comment · Fixed by #6947

Comments

@brettmc
Copy link
Contributor

brettmc commented Aug 20, 2024

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

@ashutosh-narkar
Copy link
Member

This seems like a good addition. Updating the config to provide key-value pairs seems like a good approach. Feel free to contribute this feature if you'd like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants