Configuration

Configuration

Vector is configured using one/more configuration files.

Example

The following is an example of a node_exporter alternative configuration that collect machine metrics and expose those metrics with prometheus_exporter sink.

sources:
  # collect machine metrics
  node:
    type: node
  # the metrics of Vertex itself, like CPU, RSS and open fds
  selfstat:
    type: selfstat

transforms:
  relabel:
    type: relabel
    inputs:
      - node
      - selfstat
    operations:
      # add `host` tag with hostname value 
      - action: set
        key: host
        value: ${HOSTNAME}

sinks:
  prom:
    # default listen to 9100
    type: prometheus_exporter
    inputs:
      - relabel
{
  "sources": {
    "node": {
      "type": "node"
    },
    "selfstat": {
      "type": "selfstat"
    }
  },
  "transforms": {
    "relabel": {
      "type": "relabel",
      "inputs": [
        "node",
        "selfstat"
      ],
      "operations": [
        {
          "action": "set",
          "key": "host",
          "value": "${HOSTNAME}"
        }
      ]
    }
  },
  "sinks": {
    "prom": {
      "type": "prometheus_exporter",
      "inputs": [
        "relabel"
      ]
    }
  }
}

Note that sources, transforms and sinks are defined as a map, and the key is the component name, the value of the key are a map with a must contained field type which identify the component type, e.g. node, docker…

YAML

multiple documents is supported.

sources:
  selfstat:
    type: selfstat
---
sinks:
  prom:
    type: prometheus_exporter
    inputs:
      - selfstat

Pages