Documentation
¶
Overview ¶
Package metrics provides the metrics sink interface for GRIP.
This package defines the MetricsSink interface that all metrics implementations (Prometheus, OpenTelemetry) satisfy. A NoopSink is provided as the default, ensuring zero overhead when metrics are disabled.
Sub-packages:
- prommetrics: Prometheus counter-based implementation
- otelmetrics: OpenTelemetry meter-based implementation
Example:
sink := prommetrics.New(prommetrics.DefaultOptions()) u := unary.New(unary.WithMetricsSink(sink))
Package metrics provides the public metrics interfaces for GRIP.
This package re-exports the metrics types from the internal implementation, making them available for external consumers who want to provide custom metrics implementations or use the built-in Prometheus/OpenTelemetry sinks.
The Sink interface is the primary extension point. Implement it to receive supervisor lifecycle events (start, success, failure, retry, give-up).
Built-in implementations:
- metrics.Noop() — no-op sink (default)
- prommetrics.New(opts) — Prometheus counters
- otelmetrics.New(meter) — OpenTelemetry counters
Index ¶
Constants ¶
This section is empty.
Variables ¶
var BindSupervisorHooks = metrics.BindSupervisorHooks
BindSupervisorHooks converts a Sink into supervisor.Hooks. This is used internally by the pipeline but exported for advanced use cases.
var FromContext = metrics.FromContext
FromContext extracts metric metadata from a context.
var WithContext = metrics.WithContext
WithContext attaches metric metadata to a context.
Functions ¶
This section is empty.
Types ¶
type ContextData ¶
type ContextData = metrics.ContextData
ContextData holds request-scoped metric labels.
type NoopSink ¶
NoopSink is a metrics sink that discards all events. It is the default when no metrics provider is configured.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package otelmetrics provides an OpenTelemetry metrics sink for GRIP supervisor events.
|
Package otelmetrics provides an OpenTelemetry metrics sink for GRIP supervisor events. |
|
Package prommetrics provides a Prometheus metrics sink for GRIP supervisor events.
|
Package prommetrics provides a Prometheus metrics sink for GRIP supervisor events. |