telemetry

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const RedactedSubscriptionPath = "/sub/:token"

Variables

This section is empty.

Functions

func ObserveAgentRequest

func ObserveAgentRequest(path string, status int, d time.Duration)

func ObserveAuditAppend

func ObserveAuditAppend(err error)

func ObserveHTTPRequest

func ObserveHTTPRequest(path string, status int, d time.Duration, slow bool)

ObserveHTTPRequest records a path already classified by RequestPathForObservability; this string-only API cannot infer method semantics.

func ObservePluginSystemPoolCircuit added in v0.2.3

func ObservePluginSystemPoolCircuit(transition PluginSystemPoolCircuitTransition)

func ObservePluginSystemPoolDuration added in v0.2.3

func ObservePluginSystemPoolDuration(phase PluginSystemPoolDurationPhase, d time.Duration)

func ObservePluginSystemPoolLifecycle added in v0.2.3

func ObservePluginSystemPoolLifecycle(event PluginSystemPoolLifecycleEvent)

func ObservePluginSystemPoolRetirement added in v0.2.3

func ObservePluginSystemPoolRetirement(reason PluginSystemPoolRetirementReason)

func ObserveStoreSave

func ObserveStoreSave(d time.Duration, err error)

func Prometheus

func Prometheus() string

func RedactSubscriptionPath added in v0.2.3

func RedactSubscriptionPath(value string) string

RedactSubscriptionPath removes public subscription authority before a request path reaches any observability sink. ServeMux redirects non-canonical paths after cleaning dot segments and repeated slashes, so classify both the raw and effective paths without changing what routing receives.

func RequestPathForObservability added in v0.2.3

func RequestPathForObservability(r *http.Request) string

RequestPathForObservability returns one request path safe for logs and telemetry without modifying the URL used for routing. ServeMux unescapes path segments individually, so escaped slashes must remain inside their original segment while classifying the raw and effective first segments.

func ResetForTest

func ResetForTest()

Types

type PluginSystemPoolCircuitTransition added in v0.2.3

type PluginSystemPoolCircuitTransition int
const (
	PluginSystemPoolCircuitTransitionUnknown PluginSystemPoolCircuitTransition = iota
	PluginSystemPoolCircuitTransitionOpened
)

type PluginSystemPoolDurationHistogram added in v0.2.3

type PluginSystemPoolDurationHistogram struct {
	Buckets    [len(pluginSystemPoolDurationBucketLabels)]uint64
	Count      uint64
	SumSeconds float64
}

type PluginSystemPoolDurationPhase added in v0.2.3

type PluginSystemPoolDurationPhase int
const (
	PluginSystemPoolDurationPhaseUnknown PluginSystemPoolDurationPhase = iota
	PluginSystemPoolDurationPhaseQueue
	PluginSystemPoolDurationPhaseStart
	PluginSystemPoolDurationPhaseHandler
	PluginSystemPoolDurationPhaseTotal
)

type PluginSystemPoolLifecycleEvent added in v0.2.3

type PluginSystemPoolLifecycleEvent int
const (
	PluginSystemPoolLifecycleEventUnknown PluginSystemPoolLifecycleEvent = iota
	PluginSystemPoolLifecycleEventWorkerStartSuccess
	PluginSystemPoolLifecycleEventWorkerStartFailure
	PluginSystemPoolLifecycleEventInvocationReusable
	PluginSystemPoolLifecycleEventInvocationFailure
)

type PluginSystemPoolRetirementReason added in v0.2.3

type PluginSystemPoolRetirementReason int
const (
	PluginSystemPoolRetirementReasonUnknown PluginSystemPoolRetirementReason = iota
	PluginSystemPoolRetirementReasonPoisoned
	PluginSystemPoolRetirementReasonMaxUses
	PluginSystemPoolRetirementReasonMaxAge
	PluginSystemPoolRetirementReasonCircuitOpen
	PluginSystemPoolRetirementReasonShutdown
	PluginSystemPoolRetirementReasonRejected
)

type PluginSystemPoolSnapshot added in v0.2.3

type PluginSystemPoolSnapshot struct {
	Durations          [pluginSystemPoolDurationPhaseCount]PluginSystemPoolDurationHistogram
	Lifecycle          [pluginSystemPoolLifecycleEventCount]uint64
	CircuitTransitions [pluginSystemPoolCircuitTransitionCount]uint64
	Retirements        [pluginSystemPoolRetirementReasonCount]uint64
}

func (PluginSystemPoolSnapshot) CircuitCount added in v0.2.3

func (PluginSystemPoolSnapshot) Duration added in v0.2.3

func (PluginSystemPoolSnapshot) LifecycleCount added in v0.2.3

func (PluginSystemPoolSnapshot) RetirementCount added in v0.2.3

type Registry

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

func NewRegistry

func NewRegistry() *Registry

func (*Registry) ObserveAgentRequest

func (r *Registry) ObserveAgentRequest(path string, status int, d time.Duration)

func (*Registry) ObserveAuditAppend

func (r *Registry) ObserveAuditAppend(err error)

func (*Registry) ObserveHTTPRequest

func (r *Registry) ObserveHTTPRequest(path string, status int, d time.Duration, slow bool)

ObserveHTTPRequest records a path already classified by RequestPathForObservability; this string-only API cannot infer method semantics.

func (*Registry) ObservePluginSystemPoolCircuit added in v0.2.3

func (r *Registry) ObservePluginSystemPoolCircuit(transition PluginSystemPoolCircuitTransition)

func (*Registry) ObservePluginSystemPoolDuration added in v0.2.3

func (r *Registry) ObservePluginSystemPoolDuration(phase PluginSystemPoolDurationPhase, d time.Duration)

func (*Registry) ObservePluginSystemPoolLifecycle added in v0.2.3

func (r *Registry) ObservePluginSystemPoolLifecycle(event PluginSystemPoolLifecycleEvent)

func (*Registry) ObservePluginSystemPoolRetirement added in v0.2.3

func (r *Registry) ObservePluginSystemPoolRetirement(reason PluginSystemPoolRetirementReason)

func (*Registry) ObserveStoreSave

func (r *Registry) ObserveStoreSave(d time.Duration, err error)

func (*Registry) Prometheus

func (r *Registry) Prometheus() string

func (*Registry) Reset

func (r *Registry) Reset()

func (*Registry) Snapshot

func (r *Registry) Snapshot() Snapshot

type Snapshot

type Snapshot struct {
	StartedAt        time.Time
	Uptime           time.Duration
	Store            map[string]durationStats
	Audit            map[string]uint64
	HTTP             map[httpKey]durationStats
	HTTPSlow         map[string]uint64
	Agent            map[httpKey]durationStats
	PluginSystemPool PluginSystemPoolSnapshot
}

func CurrentSnapshot

func CurrentSnapshot() Snapshot

Jump to

Keyboard shortcuts

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