Skip to content

Commit

Permalink
feat: add version label to metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
taco-paco committed Oct 16, 2024
1 parent cbf13fc commit ad14b33
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions api/configs/grafana-logs.config.river
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ prometheus.scrape "metrics" {
__address__ = "localhost:" + env("METRICS_PORT"),
__metrics_path__ = "/metrics",
environment = env("ENVIRONMENT"),
service_version = env("SERVICE_VERSION"),
}]
forward_to = [prometheus.remote_write.metrics.receiver]

Expand Down
11 changes: 10 additions & 1 deletion api/docker_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,16 @@
# Note: This script needs to run from inside /api dir
export PROMTAIL_BASE_DIR=$(pwd)
export METRICS_PORT=8001
export ENVIRONMENT=${ENVIRONMENT:-dev}

if [ -z ${ENVIRONMENT} ]; then
echo "ENVIRONMENT env var undefined"
exit 1
fi

if [ -z ${SERVICE_VERSION} ]; then
echo "SERVICE_VERSION env var undefined"
exit 1
fi

grafana-agent-flow run ./configs/grafana-logs.config.river &

Expand Down

0 comments on commit ad14b33

Please sign in to comment.