Package com.codename1.backend.metrics


package com.codename1.backend.metrics

Metrics for a backend: counters, gauges and histograms named after the OpenTelemetry semantic conventions.

Metrics holds every instrument in the process. The server records its own -- request durations, open connections, database pool use, scheduled runs -- and an application adds more through the Timed, Counted and ManagedResource annotations, or by creating instruments directly. A MetricReader takes them from there: the OTLP exporter in com.codename1.backend.otel, or the management endpoints' JSON and Prometheus text.

Server code: this package is not available in the app.

  • Class
    Description
    A count that only goes up -- requests served, jobs run, errors seen.
    A value read when metrics are collected -- a queue's depth, a pool's size, a @ManagedAttribute.
    Where a gauge with several labelled values comes from -- one per executor, say.
    Where a gauge's value comes from.
    A distribution of values -- durations, sizes -- kept as counts per bucket.
    One named measurement: a counter, a gauge or a histogram.
    Something that reads Metrics periodically and sends them somewhere -- the OTLP exporter.
    The server's metrics: every Instrument by name, and the ones the server records about itself.