Closed bmerigan closed 1 week ago
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";
}
Yeah that would work well
@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 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.
hi I think this request is necessary and will help in categorization of OTel data in the case of this module. The issue I foresee is that the proposal quoted only covers attribute tagging effectively:
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"; }
e.g. if we have multiple OTel NGINX modules reporting to a single collector, the only distinction would be service.node.name. But how does this work if we syncronize configurations with https://docs.nginx.com/nginx/admin-guide/high-availability/configuration-sharing/ and https://docs.nginx.com/nginx-management-suite/nim/how-to/instances/manage-instance-groups/ where the configurations are duplicated and identical on each NGINX instance? In these cases the config would potentially replicate and have the same service.node.name?
I don't think, you have to have identical configs on each instance. Say, you can use instance specific file and include it into synced config. Another option is to use environment variables - #40.
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 docoI'd like to be able to set the environment with a directive called
otel_service_environment
Bonus if you include
service.node.name
andservice.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.