diff --git a/compose.tracing.yaml b/compose.tracing.yaml new file mode 100644 index 00000000..80d6a3c1 --- /dev/null +++ b/compose.tracing.yaml @@ -0,0 +1,18 @@ +services: + letta_server: + environment: + - OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317 + + otel-collector: + image: otel/opentelemetry-collector-contrib:0.92.0 + command: ["--config=/etc/otel-collector-config.yaml"] + volumes: + - ./otel-collector-config.yaml:/etc/otel-collector-config.yaml + environment: + - CLICKHOUSE_ENDPOINT=${CLICKHOUSE_ENDPOINT} + - CLICKHOUSE_DATABASE=${CLICKHOUSE_DATABASE} + - CLICKHOUSE_USER=${CLICKHOUSE_USER} + - CLICKHOUSE_PASSWORD=${CLICKHOUSE_PASSWORD} + ports: + - "4317:4317" + - "4318:4318" diff --git a/otel-collector-config.yaml b/otel-collector-config.yaml new file mode 100644 index 00000000..d13164ea --- /dev/null +++ b/otel-collector-config.yaml @@ -0,0 +1,32 @@ +receivers: + otlp: + protocols: + grpc: + endpoint: 0.0.0.0:4317 + http: + endpoint: 0.0.0.0:4318 + +processors: + batch: + timeout: 1s + send_batch_size: 1024 + +exporters: + clickhouse: + endpoint: ${CLICKHOUSE_ENDPOINT} + username: ${CLICKHOUSE_USER} + password: ${CLICKHOUSE_PASSWORD} + database: ${CLICKHOUSE_DATABASE} + timeout: 10s + retry_on_failure: + enabled: true + initial_interval: 5s + max_interval: 30s + max_elapsed_time: 300s + +service: + pipelines: + traces: + receivers: [otlp] + processors: [batch] + exporters: [clickhouse]