Documentation
¶
Overview ¶
Package otelbeat records OpenTelemetry metrics for a beat.Beat. It implements beat.Handler and, per run, records two instruments on a meter the application supplies:
- beat.run.duration (histogram, seconds) - its count also gives the number of runs;
- beat.processed (counter) - items processed, summed.
Both carry the attributes "status" and "mode", so a single query sliced by those labels covers success/error/panic counts, latency and throughput per scheduling mode. The application owns the MeterProvider and its exporter/reader; otelbeat records, it does not export.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultStatus ¶
DefaultStatus classifies a run as "ok", "panic" (a recovered panic - a *beat.PanicError) or "error". Build on it in a custom StatusFunc.
The "panic" status only appears when beat's recovery middleware is in use; without it a panicking Job crashes the process and produces no Record.
Types ¶
type Option ¶
type Option func(*settings)
Option configures the handler built by New.
func WithStatus ¶
func WithStatus(f StatusFunc) Option
WithStatus overrides how a run is classified into the "status" attribute. The default is DefaultStatus. A nil func is ignored. Keep the set of returned values small - each distinct value is a separate metric series.
type StatusFunc ¶
StatusFunc classifies a run into the value of the "status" attribute. Use it to map domain errors to your own codes; DefaultStatus gives "ok", "error" or "panic".
Directories
¶
| Path | Synopsis |
|---|---|
|
Package otelbeatfx wires otelbeat into an Uber Fx application: it provides a beat.Handler that records OpenTelemetry metrics, built from the container's metric.MeterProvider.
|
Package otelbeatfx wires otelbeat into an Uber Fx application: it provides a beat.Handler that records OpenTelemetry metrics, built from the container's metric.MeterProvider. |