| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Ecluse.Runtime.Telemetry.Scrape.Internal
Description
The exposition handle, the listener address reads, and the WAI application behind
Ecluse.Runtime.Telemetry.Scrape, which documents the transport and re-exports the curated
surface. Importing this module opts out of that stability promise, the convention text and
bytestring use, so production code imports the public one.
Synopsis
- newtype MetricScrape = MetricScrape {}
- metricScrapeFor :: SdkMeterEnv -> IO (Maybe MetricScrape)
- scrapeSelected :: IO Bool
- data ScrapeListener = ScrapeListener {}
- scrapeListenerFrom :: [(String, String)] -> ScrapeListener
- scrapeListenerWarnings :: [(String, String)] -> [Text]
- scrapeApplication :: MetricScrape -> Application
- withScrapeListener :: LogEnv -> Maybe MetricScrape -> IO a -> IO a
The collection handle
newtype 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.
Constructors
| MetricScrape | |
Fields | |
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.
scrapeSelected :: IO Bool Source #
Whether OTEL_METRICS_EXPORTER names the Prometheus transport. It reads the SDK's own parse
of the variable, so the listener and the exporter the SDK resolves cannot disagree over one value.
The dedicated listener
data ScrapeListener Source #
Where the scrape listener binds.
Constructors
| ScrapeListener | |
Instances
| Show ScrapeListener Source # | |
Defined in Ecluse.Runtime.Telemetry.Scrape.Internal Methods showsPrec :: Int -> ScrapeListener -> ShowS # show :: ScrapeListener -> String # showList :: [ScrapeListener] -> ShowS # | |
| Eq ScrapeListener Source # | |
Defined in Ecluse.Runtime.Telemetry.Scrape.Internal Methods (==) :: ScrapeListener -> ScrapeListener -> Bool # (/=) :: ScrapeListener -> ScrapeListener -> Bool # | |
scrapeListenerFrom :: [(String, String)] -> ScrapeListener Source #
Resolve the listener from an environment. The defaults reach no interface but the loopback, so publishing the exposition any wider is an operator's deliberate act.
scrapeListenerWarnings :: [(String, String)] -> [Text] Source #
The warnings this environment raises. withScrapeListener surfaces them before it binds.
scrapeApplication :: MetricScrape -> Application Source #
Answer /metrics with the Prometheus text exposition of the current series, and every other
path with a plain 404. This is the whole surface of 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.