webhookotel

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package webhookotel adapts secret-safe webhook observations to the telemetry runtime.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidConfig = errors.New("webhook/otel: telemetry runtime is required")
View Source
var ErrInvalidHTTPClient = errors.New("webhook/otel: runtime, client, and explicit transport are required")

ErrInvalidHTTPClient means telemetry could not be composed without discarding the caller's explicit transport policy.

Functions

func InstrumentHTTPClient

func InstrumentHTTPClient(runtime *telemetry.Runtime, client *http.Client, operation string) (*http.Client, error)

InstrumentHTTPClient clones client and wraps its existing transport with telemetry tracing, metrics, and propagation. Requiring an explicit base transport prevents accidentally replacing a secure SSRF-aware transport with http.DefaultTransport.

Types

type Observer

type Observer struct {
	// contains filtered or unexported fields
}

Observer records one bounded counter and duration measurement per webhook observation and adds an event to an already-active span. It never creates attributes from payloads, URLs, headers, IDs, keys, signatures, or errors.

func New

func New(runtime *telemetry.Runtime) (*Observer, error)

New constructs an observer from a telemetry runtime.

func (*Observer) Observe

func (o *Observer) Observe(ctx context.Context, event webhook.Observation)

Observe implements webhook.Observer with a fixed low-cardinality schema.

Jump to

Keyboard shortcuts

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