Prometheus scrape

Collect metrics via the Prometheus client

status: beta role: daemon role: sidecar delivery: at-least-once egress: batch state: stateless output: metrics previously known as: prometheus

Alias

This component was previously called the prometheus source. Make sure to update your Vector configuration to accommodate the name change:

[sources.prometheus_scrape]
+type = "prometheus_scrape"
-type = "prometheus"

Configuration

Example configurations

{
  "sources": {
    "my_source_id": {
      "type": "prometheus_scrape",
      "endpoints": "http://localhost:9090/metrics",
      "scrape_interval_secs": 15
    }
  }
}
[sources.my_source_id]
type = "prometheus_scrape"
endpoints = "http://localhost:9090/metrics"
scrape_interval_secs = 15
---
sources:
  my_source_id:
    type: prometheus_scrape
    endpoints: http://localhost:9090/metrics
    scrape_interval_secs: 15
{
  "sources": {
    "my_source_id": {
      "type": "prometheus_scrape",
      "endpoints": "http://localhost:9090/metrics",
      "scrape_interval_secs": 15
    }
  }
}
[sources.my_source_id]
type = "prometheus_scrape"
endpoints = "http://localhost:9090/metrics"
scrape_interval_secs = 15
---
sources:
  my_source_id:
    type: prometheus_scrape
    endpoints: http://localhost:9090/metrics
    scrape_interval_secs: 15
    tls: null
    auth: null

auth

optional object
Configures the authentication strategy.

auth.password

required string literal
The basic authentication password.

auth.strategy

required string enum literal
The authentication strategy to use.
Enum options
OptionDescription
basicThe basic authentication strategy.
bearerThe bearer token authentication strategy.

auth.token

required string literal
The token to use for bearer authentication

auth.user

required string literal
The basic authentication user name.

endpoints

required [string]
Endpoints to scrape metrics from.
Array string literal
Examples
[
  "http://localhost:9090/metrics"
]

scrape_interval_secs

common optional uint
The interval between scrapes, in seconds.
default: 15 (seconds)

tls

optional object
Configures the TLS options for incoming connections.

tls.ca_file

optional string literal
Absolute path to an additional CA certificate file, in DER or PEM format (X.509), or an inline CA certificate in PEM format.

tls.crt_file

optional string literal
Absolute path to a certificate file used to identify this connection, in DER or PEM format (X.509) or PKCS#12, or an inline certificate in PEM format. If this is set and is not a PKCS#12 archive, key_file must also be set.

tls.key_file

optional string literal
Absolute path to a private key file used to identify this connection, in DER or PEM format (PKCS#8), or an inline private key in PEM format. If this is set, crt_file must also be set.

tls.key_pass

optional string literal
Pass phrase used to unlock the encrypted key file. This has no effect unless key_file is set.

tls.verify_hostname

optional bool
If true (the default), Vector will validate the configured remote host name against the remote host’s TLS certificate. Do NOT set this to false unless you understand the risks of not verifying the remote hostname.
default: true

Output

Metrics

counter

counter
A single value that can be incremented or reset to a zero value but not decremented.
* optional
Any tags present on the metric.

gauge

gauge
A gauge represents a point-in-time value that can increase and decrease. Vector’s internal gauge type represents changes to that value. Gauges should be used to track fluctuations in values, like current memory or CPU usage.
* optional
Any tags present on the metric.

histogram

gauge
Also called a timer. A histogram samples observations (usually things like request durations or response sizes) and counts them in configurable buckets. It also provides a sum of all observed values.
* optional
Any tags present on the metric.

summary

gauge
Similar to a histogram, a summary samples observations (usually things like request durations and response sizes). While it also provides a total count of observations and a sum of all observed values, it calculates configurable quantiles over a sliding time window.
* optional
Any tags present on the metric.

Telemetry

Metrics

link

events_in_total

counter
The number of events accepted by this component either from tagged origin like file and uri, or cumulatively from other origins.
component_kind required
The Vector component kind.
component_name required
The Vector component name.
component_type required
The Vector component type.
container_name optional
The name of the container from which the event originates.
file optional
The file from which the event originates.
mode optional
The connection mode used by the component.
peer_addr optional
The IP from which the event originates.
peer_path optional
The pathname from which the event originates.
pod_name optional
The name of the pod from which the event originates.
uri optional
The sanitized URI from which the event originates.

events_out_total

counter
The total number of events emitted by this component.
component_kind required
The Vector component kind.
component_name required
The Vector component name.
component_type required
The Vector component type.

http_error_response_total

counter
The total number of HTTP error responses for this component.

http_request_errors_total

counter
The total number of HTTP request errors for this component.

parse_errors_total

counter
The total number of errors parsing metrics for this component.

processed_bytes_total

counter
The number of bytes processed by the component.
component_kind required
The Vector component kind.
component_name required
The Vector component name.
component_type required
The Vector component type.
container_name optional
The name of the container from which the bytes originate.
file optional
The file from which the bytes originate.
mode optional
The connection mode used by the component.
peer_addr optional
The IP from which the bytes originate.
peer_path optional
The pathname from which the bytes originate.
pod_name optional
The name of the pod from which the bytes originate.
uri optional
The sanitized URI from which the bytes originate.

processed_events_total

counter
The total number of events processed by this component. This metric is deprecated in place of using events_in_total and events_out_total metrics.
component_kind required
The Vector component kind.
component_name required
The Vector component name.
component_type required
The Vector component type.

request_duration_seconds

histogram
The total request duration in seconds.

requests_completed_total

counter
The total number of requests completed by this component.
component_kind required
The Vector component kind.
component_name required
The Vector component name.
component_type required
The Vector component type.

How it works

Context

By default, the prometheus_scrape source augments events with helpful context keys.

State

This component is stateless, meaning its behavior is consistent across each input.

Transport Layer Security (TLS)

Vector uses OpenSSL for TLS protocols. You can adjust TLS behavior via the tls.* options.