-
Notifications
You must be signed in to change notification settings - Fork 0
Feature | Add middleware for OpenTelemetry #95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@smarcet please review again as all the requested changes were incorporated. |
smarcet
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@matiasperrone-exo please review comments
|
@smarcet, thanks for the comment. |
smarcet
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Overview
This PR adds comprehensive OpenTelemetry (OTEL) middleware integration to the IdP API, enabling distributed tracing, metrics collection, and centralized logging through OTLP (OpenTelemetry Protocol).
Key Features
TrackRequestMiddlewarethat captures request/response metadata including timing, CloudFlare Ray ID, and baggage contextkeepsuit/laravel-opentelemetrypackage (v1.14)Files Added
app/Http/Middleware/TrackRequestMiddleware.php- Request/response tracking middlewareconfig/opentelemetry.php- OpenTelemetry configuration filedocker-compose/opentelemetry/otel-collector-config.yaml- OTEL Collector configuration.env.example- Updated with OpenTelemetry environment variablesFiles Modified
app/Http/Kernel.php- AddedTrackRequestMiddlewareto middleware stackcomposer.json- Added OpenTelemetry dependencies and PSR-compatible autoloaderscomposer.lock- Updated dependenciesdocker-compose.yml- Added Elasticsearch and OpenTelemetry Collector servicesConfiguration Highlights
Environment Variables
OTEL_SERVICE_ENABLED- Enable/disable OpenTelemetryOTEL_SERVICE_NAME- Service name (defaults to app name)OTEL_EXPORTER_OTLP_ENDPOINT- Collector endpoint (default: http://otel-collector:4318)OTEL_EXPORTER_OTLP_PROTOCOL- Protocol: grpc, http/protobuf, http/jsonOTEL_TRACES_SAMPLER_TYPE- Sampler: always_on, always_off, traceidratioOTEL_INSTRUMENTATION_*- Toggle individual instrumentationsDocker Services
Architecture
Dependencies Added
keepsuit/laravel-opentelemetry^1.14 - Laravel OpenTelemetry wrapperopen-telemetry/api^1.4 - OTEL APIopen-telemetry/sdk^1.9 - OTEL SDKopen-telemetry/exporter-otlp^1.3 - OTLP exportergoogle/protobuf^4.33 - Protocol Buffers supportcomposer/semver^3.4.4 - Version constraint handlingTask:
Ref: https://app.clickup.com/t/86b7ccrnm