forked from mtusi2026/mtusi2026lab6
feat(otel): lab6 route OTLP signals through the Collector
This commit is contained in:
@@ -171,6 +171,9 @@ services:
|
|||||||
image: mtusi-messenger-api:lab3
|
image: mtusi-messenger-api:lab3
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
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_HOST: "0.0.0.0"
|
||||||
APP_PORT: "8080"
|
APP_PORT: "8080"
|
||||||
DATABASE_URL_FILE: /run/secrets/database_url
|
DATABASE_URL_FILE: /run/secrets/database_url
|
||||||
@@ -234,6 +237,9 @@ services:
|
|||||||
command: ["/worker"]
|
command: ["/worker"]
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
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
|
DATABASE_URL_FILE: /run/secrets/database_url
|
||||||
S3_ENDPOINT: "http://minio:9000"
|
S3_ENDPOINT: "http://minio:9000"
|
||||||
S3_BUCKET: "${S3_BUCKET:-messenger-attachments}"
|
S3_BUCKET: "${S3_BUCKET:-messenger-attachments}"
|
||||||
@@ -273,6 +279,9 @@ services:
|
|||||||
command: ["/reconciler"]
|
command: ["/reconciler"]
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
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
|
DATABASE_URL_FILE: /run/secrets/database_url
|
||||||
S3_ENDPOINT: "http://minio:9000"
|
S3_ENDPOINT: "http://minio:9000"
|
||||||
S3_BUCKET: "${S3_BUCKET:-messenger-attachments}"
|
S3_BUCKET: "${S3_BUCKET:-messenger-attachments}"
|
||||||
@@ -365,6 +374,18 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- internal
|
- 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:
|
secrets:
|
||||||
postgres_password:
|
postgres_password:
|
||||||
file: ./secrets/postgres_password
|
file: ./secrets/postgres_password
|
||||||
|
|||||||
@@ -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]
|
||||||
Reference in New Issue
Block a user