docs-v2/content/flux/v0/stdlib/experimental/prometheus/scrape.md

1.6 KiB

title description menu weight flux/v0/tags
prometheus.scrape() function `prometheus.scrape()` scrapes Prometheus metrics from an HTTP-accessible endpoint and returns them as a stream of tables.
flux_v0_ref
name parent identifier
prometheus.scrape experimental/prometheus experimental/prometheus/scrape
201
inputs
prometheus

prometheus.scrape() scrapes Prometheus metrics from an HTTP-accessible endpoint and returns them as a stream of tables.

Function type signature
(url: string) => stream[A] where A: Record

{{% caption %}} For more information, see Function type signatures. {{% /caption %}}

Parameters

url

({{< req >}}) URL to scrape Prometheus metrics from.

Examples

Scrape InfluxDB OSS internal metrics

import "experimental/prometheus"

prometheus.scrape(url: "http://localhost:8086/metrics")