Feat/observability otel#155
Merged
Merged
Conversation
Added OpenTelemetry support to the application, including metrics and tracing. New telemetry configuration options have been added to the settings. Logging has been enhanced to redact sensitive information, and various routes have been instrumented to track payment and streaming events. Also updated dependencies in requirements.txt to include OpenTelemetry packages.
- Introduced a new otel_collector service in docker-compose.yaml - Added environment variables for Datadog integration - Created otel-collector-config.yaml for OpenTelemetry configuration
- Implemented middleware to log request details including method, path, status code, and duration. - Enhanced JsonFormatter to include OpenTelemetry trace and span IDs. - Updated OpenTelemetry collector image version in docker-compose. - Added memory limiter processor to the OpenTelemetry collector config.
Added support for capturing request trace and span IDs in the logging middleware. This allows for better observability and tracing of requests through the application, improving debugging and monitoring capabilities.
This commit introduces a new service for the OpenTelemetry collector in the docker-compose setup. It includes configuration for the collector, environment variables, and logging options to enhance observability in the application.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ringkasan
Menambahkan OpenTelemetry Collector untuk mengirim traces dan metrics ke Datadog, serta memperbaiki korelasi antara log dan trace.
Close #148
Perubahan
otel-collector-config.yaml— konfigurasi collector (OTLP receiver, Datadog exporter, memory limiter, batch processor)docker-compose.otel.yaml— compose file terpisah untuk collectordocker-compose.yaml— normalisasi newline di akhir file.env.example— placeholderDD_API_KEYdanDD_SITEmain.py— request logging middleware dengan trace/span ID dari active span contextcore/log.py— prioritas trace/span ID (requestTraceID→otelTraceID→ fallback span),uvicorn.accessditekan keWARNINGDeployment
Collector dijalankan terpisah:
Env yang dibutuhkan:
DD_API_KEY, opsionalDD_SITE.Log aplikasi tetap stdout JSON, belum diekspor via OTLP.