servertracing

package
v9.0.0-...-1532bfb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MuxServerMiddleware

func MuxServerMiddleware(serviceName string) func(http.Handler) http.Handler

MuxServerMiddleware returns middleware that should be attached to a gorilla/mux server. It does two things: starts spans, and adds span/trace info to the request-specific logger. Right now we only support logging IDs in the format that Datadog expects.

func SetupGlobalTraceProviderAndExporter

func SetupGlobalTraceProviderAndExporter(ctx context.Context) (sdktrace.SpanExporter, *sdktrace.TracerProvider, error)

SetupGlobalTraceProviderAndExporter sets up the global trace provider and exporter.

func SetupGlobalTraceProviderAndExporterForTest

func SetupGlobalTraceProviderAndExporterForTest() (*tracetest.InMemoryExporter, *sdktrace.TracerProvider, error)

SetupGlobalTraceProviderAndExporterForTest is meant to be used in unit testing, and mirrors the setup above for outside of unit testing. It returns an in-memory exporter for examining generated spans.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL