Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements a comprehensive observability system for the FluxAI Gateway, adding Prometheus metrics collection, OpenTelemetry distributed tracing, and structured logging with trace correlation.
Key Changes:
- Enhanced metrics collection with 15+ new metrics covering requests, costs, cache performance, and model health
- Added OpenTelemetry-based distributed tracing middleware with support for OTLP export
- Implemented structured JSON logging with automatic trace ID correlation
Reviewed Changes
Copilot reviewed 8 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| app/services/metrics.py | Enhanced metrics service with additional collectors, region support, and new methods for tracking errors, model health, and cache savings |
| app/middleware/tracing.py | New OpenTelemetry tracing middleware providing context managers for tracing requests, Bedrock calls, cache lookups, and other operations |
| app/middleware/logging.py | New structured logging middleware with JSON output and trace correlation for requests, responses, errors, and cache events |
| app/middleware/init.py | New middleware package initialization |
| app/core/config.py | Added configuration for OTLP endpoint and logging options |
| app/api/v1/endpoints/metrics.py | New API endpoints for exposing Prometheus metrics and health checks |
| README.md | Updated documentation to reference new observability system |
| OBSERVABILITY.md | Comprehensive documentation covering metrics reference, tracing guide, logging guide, Grafana dashboards, and alerting |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
No description provided.