Skip to content

Commit 99c1345

Browse files
committed
create a working example of vector internal metrics monitoring
Signed-off-by: Jérémie Drouet <[email protected]>
1 parent 7ecceaf commit 99c1345

File tree

4 files changed

+74
-0
lines changed

4 files changed

+74
-0
lines changed

internal-metrics-monitoring/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Vector internal metrics monitoring
2+
3+
This demo shows how to monitor Vector's [internal metrics](https://vector.dev/docs/reference/configuration/sources/internal_metrics/) using [Prometheus](https://prometheus.io/).
4+
5+
## How to start it
6+
7+
To start it, you first need to clone this repository, go into the `internal-metrics-monitoring` folder and run `docker-compose up`.
8+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
version: '3.9'
2+
3+
services:
4+
vector:
5+
image: timberio/vector:latest-alpine
6+
environment:
7+
- LOG=info
8+
networks:
9+
- backend
10+
volumes:
11+
- ./vector:/etc/vector:ro
12+
13+
prometheus:
14+
image: bitnami/prometheus:latest
15+
networks:
16+
- backend
17+
ports:
18+
- 9090:9090
19+
volumes:
20+
- ./prometheus/prometheus.yml:/opt/bitnami/prometheus/conf/prometheus.yml:ro
21+
22+
networks:
23+
backend: {}
24+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# my global config
2+
global:
3+
scrape_interval: 10s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
4+
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
5+
# scrape_timeout is set to the global default (10s).
6+
7+
# Attach these labels to any time series or alerts when communicating with
8+
# external systems (federation, remote storage, Alertmanager).
9+
external_labels:
10+
monitor: 'vector-monitor'
11+
12+
# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
13+
rule_files:
14+
# - "first.rules"
15+
# - "second.rules"
16+
17+
# A scrape configuration containing exactly one endpoint to scrape:
18+
# Here it's Prometheus itself.
19+
scrape_configs:
20+
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
21+
- job_name: 'activity'
22+
23+
# metrics_path defaults to '/metrics'
24+
# scheme defaults to 'http'.
25+
26+
static_configs:
27+
- targets: ['vector:9090']
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[sources.random]
2+
type = "demo_logs"
3+
format = "json"
4+
5+
[sinks.blackhole]
6+
type = "blackhole"
7+
inputs = ["random"]
8+
9+
[sources.internal_metrics]
10+
type = "internal_metrics"
11+
12+
[sinks.prometheus]
13+
type = "prometheus_exporter"
14+
inputs = ["internal_metrics"]
15+
address = "0.0.0.0:9090"

0 commit comments

Comments
 (0)