From d0b608af3178bc674936f4b1c6cce00591ebbf09 Mon Sep 17 00:00:00 2001 From: Andrii Kushch Date: Tue, 8 Mar 2022 20:18:32 +0100 Subject: tracing: New OpenTelemetry module (#4361) * opentelemetry: create a new module * fix imports * fix test * Update modules/caddyhttp/opentelemetry/README.md Co-authored-by: Dave Henderson * Update modules/caddyhttp/opentelemetry/README.md Co-authored-by: Dave Henderson * Update modules/caddyhttp/opentelemetry/README.md Co-authored-by: Dave Henderson * Update modules/caddyhttp/opentelemetry/tracer.go Co-authored-by: Dave Henderson * rename error ErrUnsupportedTracesProtocol * replace spaces with tabs in the test data * Update modules/caddyhttp/opentelemetry/README.md Co-authored-by: Francis Lavoie * Update modules/caddyhttp/opentelemetry/README.md Co-authored-by: Francis Lavoie * replace spaces with tabs in the README.md * use default values for a propagation and exporter protocol * set http attributes with helper * simplify code * Cleanup modules/caddyhttp/opentelemetry/README.md Co-authored-by: Dave Henderson * Update link in README.md Co-authored-by: Dave Henderson * Update documentation in README.md Co-authored-by: Dave Henderson * Update link to naming spec in README.md Co-authored-by: Dave Henderson * Rename module from opentelemetry to tracing Co-authored-by: Dave Henderson * Rename span_name to span Co-authored-by: Dave Henderson * Rename span_name to span Co-authored-by: Dave Henderson * Simplify otel resource creation Co-authored-by: Dave Henderson * handle extra attributes Co-authored-by: Dave Henderson * update go.opentelemetry.io/otel/semconv to 1.7.0 Co-authored-by: Dave Henderson * update go.opentelemetry.io/otel version * remove environment variable handling * always use tracecontext,baggage as propagators * extract tracer name into variable * rename OpenTelemetry to Tracing * simplify resource creation * update go.mod * rename package from opentelemetry to tracing * cleanup tests * update Caddyfile example in README.md * update README.md * fix test * fix module name in README.md * fix module name in README.md * change names in README.md and tests * order imports * remove redundant tests * Update documentation README.md Co-authored-by: Dave Henderson * Fix grammar Co-authored-by: Dave Henderson * Update comments Co-authored-by: Dave Henderson * Update comments Co-authored-by: Dave Henderson * update go.sum * update go.sum * Add otelhttp instrumentation, update OpenTelemetry libraries. * Use otelhttp instrumentation for instrumenting HTTP requests. This change uses context.WithValue to inject the next handler into the request context via a "nextCall" carrier struct, and pass it on to a standard Go HTTP handler returned by otelhttp.NewHandler. The underlying handler will extract the next handler from the context, call it and pass the returned error to the carrier struct. * use zap.Error() for the error log * remove README.md * update dependencies * clean up the code * change comment * move serveHTTP method from separate file * add syntax to the UnmarshalCaddyfile comment * go import the file * admin: Write proper status on invalid requests (#4569) (fix #4561) * update dependencies Co-authored-by: Dave Henderson Co-authored-by: Francis Lavoie Co-authored-by: Vibhav Pant Co-authored-by: Alok Naushad Co-authored-by: Cedric Ziel --- go.mod | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'go.mod') diff --git a/go.mod b/go.mod index 511d2a8..61e2360 100644 --- a/go.mod +++ b/go.mod @@ -28,6 +28,10 @@ require ( github.com/tailscale/tscert v0.0.0-20220125204807-4509a5fbaf74 github.com/yuin/goldmark v1.4.4 github.com/yuin/goldmark-highlighting v0.0.0-20210516132338-9216f9c5aa01 + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.29.0 + go.opentelemetry.io/otel v1.4.0 + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.4.0 + go.opentelemetry.io/otel/sdk v1.4.0 go.uber.org/zap v1.20.0 golang.org/x/crypto v0.0.0-20210915214749-c084706c2272 golang.org/x/net v0.0.0-20210913180222-943fd674d43e -- cgit v1.2.3