Skip to content

Commit

Permalink
#219: Setup local telemetry stack with Jaeger, Grafana, VictoriaMetri…
Browse files Browse the repository at this point in the history
…cs and OTEL Collector
  • Loading branch information
roma-glushko committed Apr 28, 2024
1 parent bc5d95f commit 88492d3
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ COMMIT ?= $(shell git describe --dirty --long --always --abbrev=15)
BUILD_DATE ?= $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
VERSION ?= "latest"

LDFLAGS_COMMON := "-s -w -X $(VERSION_PACKAGE).commitSha=$(COMMIT) -X $(VERSION_PACKAGE).Version=$(VERSION) -X $(VERSION_PACKAGE).buildDate=$(BUILD_DATE)"
LDFLAGS_COMMON := "-X $(VERSION_PACKAGE).commitSha=$(COMMIT) -X $(VERSION_PACKAGE).Version=$(VERSION) -X $(VERSION_PACKAGE).buildDate=$(BUILD_DATE)"

.PHONY: help

Expand Down Expand Up @@ -51,3 +51,11 @@ test: ## Run tests

docs-api: install-checkers ## Generate OpenAPI API docs
@$(CHECKER_BIN)/swag init

telemetry-up: ## Start observability services needed to receive Glides signals
@docker-compose --profile telemetry up --wait
@echo "Jaeger UI: http://localhost:16686/"
@echo "Grafana UI: http://localhost:3000/"

telemetry-down: ## Shutdown observability services needed to receive Glides signals
@docker-compose --profile telemetry down
61 changes: 61 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
version: "3.7"
services:
otel-collector:
profiles:
- telemetry
image: otel/opentelemetry-collector-contrib-dev:latest
command: ["--config=/etc/otel-col-config.yaml", "${OTELCOL_ARGS}"]
volumes:
- ./tools/otel-col-config.yaml:/etc/otel-col-config.yaml
ports:
- "1888:1888" # pprof extension
- "8888" # Prometheus metrics exposed by the collector
- "8889:8889" # Prometheus exporter metrics
- "13133:13133" # health_check extension
- "4317:4317" # OTLP gRPC receiver
- "55679" # zpages extension
depends_on:
- jaeger-all-in-one

jaeger-all-in-one:
profiles:
- telemetry
image: jaegertracing/all-in-one:latest
environment:
- COLLECTOR_OTLP_ENABLED=true
ports:
- "16686:16686"
- "14268"
- "14250:14250"
- "6831:6831"

victoriametrics:
profiles:
- telemetry
container_name: victoriametrics
image: victoriametrics/victoria-metrics
ports:
- "8428:8428"
- "8089:8089"
- "8089:8089/udp"
- "2003:2003"
- "2003:2003/udp"
- "4242:4242"
command:
- '--storageDataPath=/storage'
- '--graphiteListenAddr=:2003'
- '--opentsdbListenAddr=:4242'
- '--httpListenAddr=:8428'
- '--influxListenAddr=:8089'
restart: always

grafana:
profiles:
- telemetry
image: grafana/grafana:latest
environment:
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
- GF_AUTH_DISABLE_LOGIN_FORM=true
ports:
- "3000:3000"
35 changes: 35 additions & 0 deletions tools/otel-col-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
receivers:
otlp:
protocols:
grpc:

exporters:
prometheusremotewrite:
endpoint: "http://victoriametrics:8428/api/v1/write"

otlp:
endpoint: jaeger-all-in-one:4317
tls:
insecure: true

processors:
batch:

extensions:
health_check:
pprof:
endpoint: :1888
zpages:
endpoint: :55679

service:
extensions: [ pprof, zpages, health_check ]
pipelines:
traces:
receivers: [ otlp ]
processors: [ batch ]
exporters: [ otlp ]
metrics:
receivers: [ otlp ]
processors: [ batch ]
exporters: [ prometheusremotewrite ]

0 comments on commit 88492d3

Please sign in to comment.