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

Support arbitrary resource attributes #32

Open
bmerigan opened this issue Feb 1, 2024 · 4 comments
Open

Support arbitrary resource attributes #32

bmerigan opened this issue Feb 1, 2024 · 4 comments

Comments

@bmerigan
Copy link

bmerigan commented Feb 1, 2024

Is your feature request related to a problem? Please describe

Currently the traces that are logged via this module don't have environment metadata which means I cannot filter traces by environment in Elastic APM. e.g. development/test/staging/production

This feature and why it's useful is explained perfectly in this opentelemetry doco

Describe the solution you'd like

Just like we can set otel_service_name as per nginx-otel doco
I'd like to be able to set the environment with a directive called otel_service_environment

Bonus if you include service.node.name and service.version too.

Describe alternatives you've considered

Adding the value using a resource processor within the otel-collector, which works, but isn't right IMO.

@p-pautov
Copy link
Contributor

p-pautov commented Feb 7, 2024

I think, we can add generic otel_resource block, which would allow setting any resource level attributes, e.g.

otel_resource {
    "deployment.environment" "prod";
    "service.node.name" "mysvc";
    "service.version" "1.0";
}

@bmerigan
Copy link
Author

bmerigan commented Feb 7, 2024

Yeah that would work well

@p-pautov p-pautov changed the title Add otel_service_environment directive Support arbitrary resource attributes Feb 29, 2024
@sahilganguly
Copy link

@bmerigan could you include these attributes using the otel_span_attr directive? Assuming of course you can get those attributes as a variable in nginx.

@bmerigan
Copy link
Author

bmerigan commented Apr 2, 2024

@bmerigan could you include these attributes using the otel_span_attr directive? Assuming of course you can get those attributes as a variable in nginx.

I do use the otel_span_attr for some things, but these attributes are more at the top, trace level.

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

No branches or pull requests

3 participants