Split listener (#141)

This commit is contained in:
Adil Hafeez 2024-10-08 16:24:08 -07:00 committed by GitHub
parent 22bc3d2798
commit 285aa1419b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 449 additions and 335 deletions

View file

@ -0,0 +1,11 @@
FROM alpine:3.20@sha256:beefdbd8a1da6d2915566fde36db9db0b524eb737fc57cd1367effd16dc0d06d AS otelc_curl
RUN apk --update add curl
FROM otel/opentelemetry-collector:latest@sha256:aef3e6d742fb69b94e9c0813a028449d28438bb6f9c93cb5d0b8d0704b78ae65
COPY --from=otelc_curl / /
COPY ./otel-collector-config.yaml /etc/otel-collector-config.yaml
USER 0
RUN chmod o+r /etc/otel-collector-config.yaml
USER nobody

View file

@ -80,3 +80,6 @@ ratelimits:
limit:
tokens: 1
unit: minute
tracing:
random_sampling: 100

View file

@ -21,6 +21,22 @@ services:
- MISTRAL_API_KEY=${MISTRAL_API_KEY:?error}
- CHAT_COMPLETION_ENDPOINT=http://host.docker.internal:10000/v1
opentelemetry:
build:
context: .
dockerfile: Dockerfile-opentelemetry
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:13133 || exit 1"]
interval: 1s
timeout: 120s
retries: 120
start_period: 5s
command: ["--config=/etc/otel-collector-config.yaml"]
ports:
- "${PORT_UI:-55679}:55679"
- "${PORT_GRPC:-4317}:4317"
- "${PORT_HTTP:-4318}:4318"
prometheus:
image: prom/prometheus
container_name: prometheus

View file

@ -0,0 +1,40 @@
extensions:
memory_ballast:
size_mib: 512
zpages:
endpoint: 0.0.0.0:55679
health_check:
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:4318
processors:
batch:
memory_limiter:
# 75% of maximum memory up to 4G
limit_mib: 1536
# 25% of limit up to 2G
spike_limit_mib: 512
check_interval: 5s
exporters:
debug:
verbosity: detailed
service:
pipelines:
traces:
receivers: [otlp]
processors: [memory_limiter, batch]
exporters: [debug]
metrics:
receivers: [otlp]
processors: [memory_limiter, batch]
exporters: [debug]
extensions: [memory_ballast, zpages, health_check]