feat(otel): lab6 route OTLP signals through the Collector

This commit is contained in:
Голиков Maximillian Антон
2026-11-17 13:17:42 +03:00
parent 9f316d7ed7
commit 94865e05a9
2 changed files with 54 additions and 0 deletions
+21
View File
@@ -171,6 +171,9 @@ services:
image: mtusi-messenger-api:lab3
restart: unless-stopped
environment:
OTEL_EXPORTER_OTLP_ENDPOINT: "${OTEL_EXPORTER_OTLP_ENDPOINT:-http://otel-collector:4318}"
OTEL_METRIC_EXPORT_INTERVAL: "${OTEL_METRIC_EXPORT_INTERVAL:-15000}"
OTEL_SDK_DISABLED: "${OTEL_SDK_DISABLED:-false}"
APP_HOST: "0.0.0.0"
APP_PORT: "8080"
DATABASE_URL_FILE: /run/secrets/database_url
@@ -234,6 +237,9 @@ services:
command: ["/worker"]
restart: unless-stopped
environment:
OTEL_EXPORTER_OTLP_ENDPOINT: "${OTEL_EXPORTER_OTLP_ENDPOINT:-http://otel-collector:4318}"
OTEL_METRIC_EXPORT_INTERVAL: "${OTEL_METRIC_EXPORT_INTERVAL:-15000}"
OTEL_SDK_DISABLED: "${OTEL_SDK_DISABLED:-false}"
DATABASE_URL_FILE: /run/secrets/database_url
S3_ENDPOINT: "http://minio:9000"
S3_BUCKET: "${S3_BUCKET:-messenger-attachments}"
@@ -273,6 +279,9 @@ services:
command: ["/reconciler"]
restart: unless-stopped
environment:
OTEL_EXPORTER_OTLP_ENDPOINT: "${OTEL_EXPORTER_OTLP_ENDPOINT:-http://otel-collector:4318}"
OTEL_METRIC_EXPORT_INTERVAL: "${OTEL_METRIC_EXPORT_INTERVAL:-15000}"
OTEL_SDK_DISABLED: "${OTEL_SDK_DISABLED:-false}"
DATABASE_URL_FILE: /run/secrets/database_url
S3_ENDPOINT: "http://minio:9000"
S3_BUCKET: "${S3_BUCKET:-messenger-attachments}"
@@ -365,6 +374,18 @@ services:
networks:
- internal
otel-collector:
image: otel/opentelemetry-collector-contrib:0.135.0
restart: unless-stopped
command: ["--config=/etc/otelcol-contrib/config.yaml"]
volumes:
- ./infra/otel-collector.yaml:/etc/otelcol-contrib/config.yaml:ro
depends_on:
- jaeger
- opensearch
networks:
- internal
secrets:
postgres_password:
file: ./secrets/postgres_password
+33
View File
@@ -0,0 +1,33 @@
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:4318
exporters:
prometheus:
endpoint: 0.0.0.0:9464
resource_to_telemetry_conversion:
enabled: true
opensearch:
http:
endpoint: http://opensearch:9200
logs_index: messenger-logs
otlp/jaeger:
endpoint: jaeger:4317
tls:
insecure: true
service:
pipelines:
metrics:
receivers: [otlp]
exporters: [prometheus]
logs:
receivers: [otlp]
exporters: [opensearch]
traces:
receivers: [otlp]
exporters: [otlp/jaeger]