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

import "experimental/prometheus"

  url: "http://localhost:8086/metrics"



The URL to scrape Prometheus-formatted metrics from.

Data type: String


Scrape Prometheus metrics and write them to InfluxDB

import "experimental/prometheus"

prometheus.scrape(url: "")
  |> to(
    org: "example-org",
    bucket: "example-bucket"

Cloud or OSS?

InfluxDB OSS 2.0 now generally available!

InfluxDB OSS 2.0 is now generally available and ready for production use. See the InfluxDB OSS 2.0 release notes.

For information about upgrading to InfluxDB OSS 2.0, see: