Package com.jsgalactic.axiom.micrometer
Class MicrometerMetrics
java.lang.Object
com.jsgalactic.axiom.micrometer.MicrometerMetrics
- All Implemented Interfaces:
Metrics
Maps the dependency-free
Metrics SPI to an application-owned Micrometer MeterRegistry. Counters become Micrometer counters, gauges become gauges backed by an AtomicLong, and timers become Micrometer timers whose service-level objectives are DEFAULT_BUCKETS, the bounds of the in-memory registry in axiom-metrics.
Micrometer publishes through whatever registry and exporters the application installs, so this
adapter adds no renderer, Prometheus endpoint, StatsD client or JMX bridge. One instrument is
registered per name and tag set and reused by later lookups; a name always has one kind and one
set of tag keys, and using it otherwise throws IllegalArgumentException. Instances are
thread-safe and can be shared across requests.
Tag values stay the caller's responsibility: Axiom's runtime tags only with route templates, methods and other fixed sets. The adapter does not truncate values or bound cardinality; use a registry filter when untrusted tags are possible.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.jsgalactic.axiom.observability.Metrics
Metrics.Counter, Metrics.Gauge, Metrics.Timer -
Field Summary
FieldsModifier and TypeFieldDescriptionTimer service-level objectives: 1 ms, 5 ms, 10 ms, 25 ms, 50 ms, 100 ms, 250 ms, 500 ms, 1 s, 2.5 s, 5 s and 10 s. -
Method Summary
Modifier and TypeMethodDescriptionReturns the monotonically increasing counter for a series, creating it if needed.static MicrometerMetricscreate(io.micrometer.core.instrument.MeterRegistry registry) Creates an adapter that registers instruments in the supplied registry.Returns the gauge for a series, creating it if needed.Returns the timer for a series, creating it if needed.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.jsgalactic.axiom.observability.Metrics
prometheusText
-
Field Details
-
DEFAULT_BUCKETS
Timer service-level objectives: 1 ms, 5 ms, 10 ms, 25 ms, 50 ms, 100 ms, 250 ms, 500 ms, 1 s, 2.5 s, 5 s and 10 s. They match the buckets ofMetricsRegistry.DEFAULT_BUCKETS.
-
-
Method Details
-
create
Creates an adapter that registers instruments in the supplied registry. The registry's lifecycle, naming conventions, filters and exporters remain the application's responsibility.- Parameters:
registry- meter registry that owns the instruments- Returns:
- an empty adapter
-
counter
Description copied from interface:MetricsReturns the monotonically increasing counter for a series, creating it if needed. -
gauge
Description copied from interface:MetricsReturns the gauge for a series, creating it if needed. A gauge is a value that moves both ways, such as a queue depth. It is changed by deltas, so several components can share one series and the value stays the sum of their contributions. -
timer
Description copied from interface:MetricsReturns the timer for a series, creating it if needed. A timer records durations and keeps their distribution, so latency percentiles can be derived from it.
-