open-telemetry / opentelemetry-cpp-contrib

https://opentelemetry.io/
Apache License 2.0
121 stars 128 forks source link

fix(nginx): set error status on span with 5xx status code #443

Closed dmehala closed 3 weeks ago

dmehala commented 1 month ago

Description

This PR enhances the otel_ngx_module to set the span status as "error" specifically when the HTTP request returns a 5xx status code. For all other status codes, it sets the status as "ok".

linux-foundation-easycla[bot] commented 1 month ago

CLA Signed


The committers listed above are authorized under a signed CLA.

dmehala commented 1 month ago

Hello @marcalff @seemk @tobiasstadler ,

Do you have an estimated timeline? My understanding is that the otel-webserver-module is the new implementation. However, if I am not mistaken, this module is used by ingress-nginx to provide tracing, and this fix would benefit the entire community.

EDIT: I confirm ingress-nginx use otel_ngx_module - https://github.com/kubernetes/ingress-nginx/blob/1d3493018086ef6a1643686781a5d11707beed6d/images/opentelemetry/rootfs/build.sh#L113-L162