Skip to content

Instantly share code, notes, and snippets.

@pythoninthegrass
Created November 19, 2024 21:50
Show Gist options
  • Save pythoninthegrass/e69a2a231d2daaec07761bf831f65b40 to your computer and use it in GitHub Desktop.
Save pythoninthegrass/e69a2a231d2daaec07761bf831f65b40 to your computer and use it in GitHub Desktop.
Basic macOS compatible Vector telemetry w/redis + prometheus
sources:
docker:
type: docker_logs
auto_partial_merge: true
docker_host: unix:///var/run/docker.sock
exclude_containers:
- exclude_
partial_event_marker_field: _partial
retry_backoff_secs: 2
metrics:
type: host_metrics
logs:
type: file
include:
- /var/log/**/*.log
exclude:
- fct_uninstall.log
- fsck_*.log
- launchd.log
- nix-daemon.log
- shutdown_monitor.log
- wifi.log
transforms:
dedupe:
type: dedupe
inputs:
- docker
- logs
cache:
num_events: 5000
# TODO: switch from redis to loki
# * https://vector.dev/docs/reference/configuration/sinks/loki/
sinks:
redis:
type: redis
encoding:
codec: json
inputs:
- dedupe
endpoint: redis://127.0.0.1:6379/0
key: vector
prometheus:
type: prometheus_exporter
inputs:
- metrics
address: 0.0.0.0:9090
@pythoninthegrass
Copy link
Author

pythoninthegrass commented Nov 19, 2024

vector --help
vector generate-schema > schema.json
vector validate ~/.config/vector/vector.yml
docker run -it -d --name=vector-redis -p 6379:6379 redis
brew install prometheus
brew install node_exporter
code -r /opt/homebrew/etc/prometheus.yml
brew services start node_exporter
brew services start prometheus
brew services list
sudo mkdir -p /var/lib/vector
sudo chown -R $(whoami) /var/lib/vector
vector --config ~/.config/vector/vector.yml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment