Interface LogMetrics


public sealed interface LogMetrics
Numeric metrics about the logging system itself. Counters track running totals such as dropped events; gauges track values that can rise and fall, such as queued events. Unlike LogAlerts, updating a metric does not create an alert or notify listeners. Retain a LogMetrics.Gauge for frequent updates without a name lookup.

An instance is available from every LogConfig.metrics(). Components that are provided config, or that are started with config, should prefer capturing config.metrics() over reaching for global state.

Deliberately a separate type from LogAlerts rather than more methods on it - the two are meant to be independently replaceable (e.g. a future Micrometer-backed LogMetrics without needing to also replace how alerts are recorded).

See Also: