Complete lab 6 OpenTelemetry observability stack
This commit is contained in:
@@ -9,6 +9,8 @@ x-api: &api
|
||||
S3_ENDPOINT: http://minio:9000
|
||||
S3_ACCESS_KEY_FILE: /run/secrets/s3_access_key
|
||||
S3_SECRET_KEY_FILE: /run/secrets/s3_secret_key
|
||||
OTEL_EXPORTER_OTLP_ENDPOINT: http://collector:4317
|
||||
OTEL_SERVICE_NAME: messenger-api
|
||||
volumes:
|
||||
- ./secrets/database_url:/run/secrets/database_url:ro
|
||||
- ./secrets/s3_access_key:/run/secrets/s3_access_key:ro
|
||||
@@ -18,6 +20,8 @@ x-api: &api
|
||||
condition: service_completed_successfully
|
||||
s3init:
|
||||
condition: service_completed_successfully
|
||||
collector:
|
||||
condition: service_started
|
||||
healthcheck:
|
||||
test: [CMD, python, -c, "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8080/health/ready',timeout=4)"]
|
||||
interval: 3s
|
||||
@@ -110,6 +114,7 @@ services:
|
||||
ports: ["127.0.0.1:9090:9090"]
|
||||
volumes:
|
||||
- ./infra/prometheus.yml:/etc/prometheus/prometheus.yml:ro
|
||||
- ./infra/prometheus-alerts.yml:/etc/prometheus/prometheus-alerts.yml:ro
|
||||
- promdata:/prometheus
|
||||
mem_limit: 256m
|
||||
cpus: 0.5
|
||||
@@ -122,6 +127,31 @@ services:
|
||||
depends_on: [prometheus]
|
||||
mem_limit: 256m
|
||||
cpus: 0.5
|
||||
collector:
|
||||
image: otel/opentelemetry-collector-contrib:0.114.0
|
||||
command: [--config=/etc/otelcol-contrib/config.yaml]
|
||||
volumes:
|
||||
- ./infra/otel-collector.yaml:/etc/otelcol-contrib/config.yaml:ro
|
||||
ports: ["127.0.0.1:4317:4317", "127.0.0.1:9464:9464"]
|
||||
depends_on: [tempo, loki]
|
||||
mem_limit: 256m
|
||||
cpus: 0.5
|
||||
tempo:
|
||||
image: grafana/tempo:2.6.1
|
||||
command: [-config.file=/etc/tempo.yaml]
|
||||
volumes:
|
||||
- ./infra/tempo.yaml:/etc/tempo.yaml:ro
|
||||
- tempodata:/var/tempo
|
||||
mem_limit: 256m
|
||||
cpus: 0.5
|
||||
loki:
|
||||
image: grafana/loki:3.3.2
|
||||
command: [-config.file=/etc/loki.yaml]
|
||||
volumes:
|
||||
- ./infra/loki.yaml:/etc/loki.yaml:ro
|
||||
- lokidata:/loki
|
||||
mem_limit: 256m
|
||||
cpus: 0.5
|
||||
db:
|
||||
image: postgres:16.6-bookworm
|
||||
environment:
|
||||
@@ -148,6 +178,8 @@ volumes:
|
||||
s3data:
|
||||
promdata:
|
||||
grafanadata:
|
||||
tempodata:
|
||||
lokidata:
|
||||
secrets:
|
||||
db_password:
|
||||
file: ./secrets/db_password
|
||||
|
||||
Reference in New Issue
Block a user