cuongquochoang opened a new pull request, #13946: URL: https://github.com/apache/apisix/pull/13946
### Description APISIX's OpenTelemetry plugin currently propagates the gateway SERVER span directly to the upstream. As a result, no CLIENT span represents the proxy hop and APM service maps cannot connect APISIX to upstream services. This change: - starts an `apisix.upstream` CLIENT span after the balancer selects the upstream; - propagates that CLIENT span context to the upstream request, including retries; - finishes the span with the final NGINX upstream response/connect timing; - records `server.address`, `server.port`, and `http.response.status_code`; and - marks upstream 5xx responses as errors. The integration test verifies the span hierarchy, kind, attributes, timing bounds, propagated parent span ID, and HTTP/2 request isolation. #### Which issue(s) this PR fixes: Fixes #13945 ### Tests - `t/plugin/opentelemetry6.t` — 27 assertions passed - `t/plugin/opentelemetry.t` — 156 assertions passed - `luacheck -q apisix/plugins/opentelemetry.lua t/lib/test_otel.lua t/lib/server.lua` - `./utils/check-test-code-style.sh` - `git diff --check` ### Checklist - [x] I have explained the need for this PR and the problem it solves - [x] I have explained the changes or the new features added to this PR - [x] I have added tests corresponding to this change - [x] Documentation is not applicable because this changes emitted telemetry without changing configuration or public APIs - [x] I have verified that this change is backward compatible -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
