prometheus.scrape() function

The prometheus.scrape() function is experimental and subject to change at any time. By using this function, you accept the risks of experimental functions.

The prometheus.scrape() function retrieves Prometheus-formatted metrics from a specified URL. The function groups metrics (including histogram and summary values) into individual tables.

*Function type: Input*

  1. import "experimental/prometheus"
  2. prometheus.scrape(
  3. url: "http://localhost:8086/metrics"
  4. )

Parameters

url

The URL to scrape Prometheus-formatted metrics from.

*Data type: String*

Examples

Scrape Prometheus metrics and write them to InfluxDB

  1. import "experimental/prometheus"
  2. prometheus.scrape(url: "https://example-url.com/metrics")
  3. |> to(
  4. org: "example-org",
  5. bucket: "example-bucket"
  6. )

Related articles