VictoriaMetrics/docs/data-ingestion/Vector.md
Andrii Chubatiuk 77c3bbf3fc
docs: updated guides structure, removed deprecated sort option ()
### Describe Your Changes

* `sort` param is unused by the current website engine, and was present only for compatibility
with previous website engine. It is time to remove it as it makes no effect
* re-structure guides content into folders to simplify assets management

### Checklist

The following checks are **mandatory**:

- [ ] My change adheres [VictoriaMetrics contributing
guidelines](https://docs.victoriametrics.com/contributing/).

(cherry picked from commit 35d77a3bed)
2024-08-07 16:59:22 +02:00

2.8 KiB

title weight menu aliases
Vector 4
docs
identifier parent weight
Vector data-ingestion 4
/data-ingestion/Vector.html
/data-ingestion/vector.html

To Send data to Vector you need to configure with a Prometheus remote write sink and forward metrics to that sink from at least 1 source. You will need to replace the values in <> to match your setup.

Minimum Config

sources:
  host_metrics_source:
    type: host_metrics
sinks:
  victoriametrics_sink:
    type: prometheus_remote_write
    inputs:
      - host_metrics_source
    endpoint: "https://<victoriametrics_url>/api/v1/write"
    healthcheck:
      enabled: false

Basic Authentication

This adds support for basic authentication by defining the auth strategy, user, and password fields:

sources:
  host_metrics_source:
    type: host_metrics
sinks:
  victoriametrics_sink:
    type: prometheus_remote_write
    inputs:
      - host_metrics_source
    endpoint: "https://<victoriametrics_url>/api/v1/write"
    auth:
      strategy: "basic"
      user: "<victoriametrics_user"
      password: "<victoriametrics_password>"
    healthcheck:
      enabled: false

Bearer / Token Authentication

This adds support for bearer/token authentication by defining the auth strategy and token fields:

sources:
  host_metrics_source:
    type: host_metrics
sinks:
  victoriametrics_sink:
    type: prometheus_remote_write
    inputs:
      - host_metrics_source
    endpoint: "https://<victoriametrics_url>/api/v1/write"
    auth:
      strategy: "bearer"
      token: "<victoriametrics_token>"
    healthcheck:
      enabled: false

VictoriaMetrics and VictoriaLogs

This combines the Bearer Authentication section with the VictoriaLogs docs for Vector, so you can send metrics and logs with 1 agent to multiple sources:

sources:
  host_metrics_source:
    type: host_metrics
  journald_source:
    type: journald
sinks:
  victoriametrics_sink:
    type: prometheus_remote_write
    inputs:
      - host_metrics_source
    endpoint: "https://<victoriametrics_url>/api/v1/write"
    auth:
      strategy: "bearer"
      token: "<token>"
    healthcheck:
      enabled: false
  victorialogs_sink:
    inputs:
      - journald_source
    type: elasticsearch
    endpoints:
      - "https://<victorialogs_url>/insert/elasticsearch/"
    mode: bulk
    api_version: "v8"
    healthcheck:
      enabled: false
    query:
      _msg_field: "message"
      _time_field: "timestamp"
      _stream_fields: "host,container_name"

References