Commit fdb7bd5
Add OpenTelemetry metrics support with semantic conventions
Implement metrics collection using the OpenTelemetry API following
OTEL semantic conventions for RabbitMQ messaging. The implementation
uses a pluggable MetricsCollector interface that allows users to
integrate with any metrics backend.
Key changes:
- Add MetricsCollector interface with NoOp and OTEL implementations
- Add OTELMetricsCollector using OTEL API (SDK kept separate)
- Implement OTEL semantic convention attributes (messaging.system,
messaging.destination.name, messaging.operation.name, etc.)
- Refactor Environment constructors to use functional options pattern
- Add comprehensive unit and E2E tests in separate tests/otelmetrics
module
- Add standalone example demonstrating OTEL metrics with stdout exporter
- Update METRICS_IMPLEMENTATION_GUIDE.md with OTEL semantic conventions
The metrics collected include:
- Connection/publisher/consumer gauges
- Published/consumed message counters
- Disposition counters (accepted/rejected/released/discarded/requeued)
Co-authored-by: Cursor <cursoragent@cursor.com>1 parent 850965c commit fdb7bd5
21 files changed
Lines changed: 3732 additions & 53 deletions
File tree
- docs
- development
- examples
- advanced_settings
- getting_started
- otel_metrics
- pkg/rabbitmqamqp
- tests/otelmetrics
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
0 commit comments