Package org.microproxy.stats
package org.microproxy.stats
-
ClassDescriptionA count that only goes up, such as
downstream_rq_total.A value that goes up and down, such asdownstream_cx_active.A distribution of recorded values in fixed buckets, such asdownstream_rq_time: oneLongAdderper bucket, plus the sum and the count of the values, so recording takes no lock and allocates nothing.The counts of a histogram at one moment.What kind of metric aMetricis.Pushes a registry's metrics to a statsd server over UDP, every flush interval (5 seconds by default, as Envoy), from a virtual thread: counters as the increase since the last flush (|c), gauges as their value (|g), by their flat names after the registry's prefix (envoy.cluster.direct.upstream_rq_total:3|c).Settings for aStatsdSink.Renders a registry's metrics as Envoy's admin endpoint does: Prometheus's text exposition format, the plain/statsdump and its JSON form.The proxy's metrics, by Envoy's flat stat names (http.<prefix>.downstream_rq_total,cluster.<name>.upstream_cx_connect_ms, ...), each with the tags its name carries (TagExtractor), forStatsFormatterandStatsdSinkto show.Settings for aStatsRegistry.What happens to a new cluster onceStatsRegistry.Builder.maxClustersclusters have stats.Metrics named<prefix>.<name>whose names come from outside the proxy, such as a script's (script.<name>), and of which there may be at most a fixed number: past it, new names get metrics that do nothing (and a warning is logged once), so their number stays bounded whatever names are asked for.A value taken out of a metric's flat name, which Prometheus shows as a label.Takes tag values out of flat stat names, once, when a metric is registered, as Envoy's tag extraction does:cluster.direct.upstream_rq_2xxbecomescluster.upstream_rq_xxwith the tagsenvoy_cluster_name="direct"andenvoy_response_code_class="2".A name with its tags taken out.One rule.