Prometheus Source

The Vector prometheus source ingests data through the Prometheus text exposition format and outputs metric events.


type = "prometheus" # required
hosts = ["http://localhost:9090"] # required
scrape_interval_secs = 15 # optional, default, seconds
  • [string]commonrequired


    Host addresses to scrape metrics from.

    • No default
    • View examples
  • uint (seconds)commonoptional


    The interval between scrapes, in seconds.

    • Default: 15 (seconds)


Given the following input:

Example input
# TYPE promhttp_metric_handler_requests_total counter
promhttp_metric_handler_requests_total{code="200"} 100

A metric event will be output with the following structure:

Example metric event
"name": "promhttp_metric_handler_requests_total",
"kind": "absolute",
"timestamp": "2019-05-02T12:22:46.658503Z" // current time / time ingested
"tags": {
"code": "200"
"value": {
"type": "counter",
"value": 100.0

How It Works

Environment Variables

Environment variables are supported through all of Vector's configuration. Simply add ${MY_ENV_VAR} in your Vector configuration file and the variable will be replaced before being evaluated.

You can learn more in the Environment Variables section.