caddy
caddy copied to clipboard
feat: Improve OpenTelemetry trace instrumentation
This PR enhances the opentelemetry instrumentation for caddy by:
- creating client spans for reverse proxy request to fix servicegraph calculations
- injecting, conditionally, a server-timing header to propagate the traceparent down to the caller
Thanks @hairyhenderson !
@cedricziel Would you be able to fix up the lint errors and make sure the tests pass, then we can get this in the next beta release?
Thanks for the commit!
Looks like the order of the modified imports needs to be adjusted (for lint) and for tests, there's:
module_test.go:107: Invalid traceparent:
--- FAIL: TestTracing_ServeHTTP_Propagation_Without_Initial_Headers (0.00s)
For lint, try golangci-lint run --fix. I think that takes care of most of them.