Documentation
¶
Index ¶
- type Runtime
- func (r *Runtime) Enabled() bool
- func (r *Runtime) RecordTraceQueueDrop(path string, status int)
- func (r *Runtime) RecordTraceWriteFailure(operation string, failedCount int)
- func (r *Runtime) Shutdown(ctx context.Context) error
- func (r *Runtime) SpanEnrichmentMiddleware(next http.Handler) http.Handler
- func (r *Runtime) WrapHTTPHandler(next http.Handler) http.Handler
- func (r *Runtime) WrapHTTPTransport(base http.RoundTripper) http.RoundTripper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
Runtime exposes OpenTelemetry HTTP wrappers and gateway metric hooks.
func Setup ¶
func Setup(ctx context.Context, cfg config.OTelConfig, serviceVersion string, logger *slog.Logger) (*Runtime, error)
Setup initializes OpenTelemetry providers and runtime hooks.
func (*Runtime) RecordTraceQueueDrop ¶
RecordTraceQueueDrop increments a counter when the async trace queue is full.
func (*Runtime) RecordTraceWriteFailure ¶
RecordTraceWriteFailure increments a counter for dropped trace records.
func (*Runtime) SpanEnrichmentMiddleware ¶
SpanEnrichmentMiddleware adds gateway attributes and stable error status on 5xx responses.
func (*Runtime) WrapHTTPHandler ¶
WrapHTTPHandler wraps an inbound HTTP handler with OpenTelemetry spans.
func (*Runtime) WrapHTTPTransport ¶
func (r *Runtime) WrapHTTPTransport(base http.RoundTripper) http.RoundTripper
WrapHTTPTransport wraps an outbound HTTP transport with OpenTelemetry spans.
Click to show internal directories.
Click to hide internal directories.