| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Ecluse.Runtime.Telemetry.Scrape
Description
The pull-side metrics transport: a Prometheus exposition on its own listener, never on the
proxy's data port. A backend that scrapes selects it with OTEL_METRICS_EXPORTER=prometheus, which
the SDK answers with a no-op push exporter, leaving the endpoint to the application. The exposition
carries the whole OpenTelemetry resource, naming the host, the process, and any cloud or cluster
identity the SDK detected, so it never shares the port untrusted registry clients reach and binds
localhost until an operator widens it. OTEL_EXPORTER_PROMETHEUS_HOST and
OTEL_EXPORTER_PROMETHEUS_PORT address it, as the OpenTelemetry specification defines them.
Synopsis
- data MetricScrape
- metricScrapeFor :: SdkMeterEnv -> IO (Maybe MetricScrape)
- withScrapeListener :: LogEnv -> Maybe MetricScrape -> IO a -> IO a
The collection handle
data MetricScrape Source #
One on-demand collection of the meter's current series. The substrate builds one only where the operator asked for the scrape transport.
metricScrapeFor :: SdkMeterEnv -> IO (Maybe MetricScrape) Source #
Build the scrape handle, or Nothing when the transport stayed on OTLP push. Collecting
beside the periodic reader is safe only under cumulative temporality: delta would split the points.
The dedicated listener
withScrapeListener :: LogEnv -> Maybe MetricScrape -> IO a -> IO a Source #
Run act with the scrape listener alive when the transport selected one, and unchanged when
it did not. A listener that cannot bind is reported and abandoned, never a failed boot.