caddy icon indicating copy to clipboard operation
caddy copied to clipboard

feat: Improve OpenTelemetry trace instrumentation

Open cedricziel opened this issue 1 year ago • 3 comments

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

cedricziel avatar Jun 22 '24 12:06 cedricziel

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?

mholt avatar Oct 02 '24 14:10 mholt

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)

mholt avatar Oct 02 '24 14:10 mholt

For lint, try golangci-lint run --fix. I think that takes care of most of them.

mohammed90 avatar Oct 02 '24 14:10 mohammed90