Skip to content
This repository has been archived by the owner on Dec 6, 2024. It is now read-only.

Add version label to metrics #230

Merged
merged 1 commit into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading