Skip to content

Commit d676e01

Browse files
Zerpetcursoragent
andcommitted
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 c6a4490 commit d676e01

21 files changed

Lines changed: 3773 additions & 42 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ go.work.sum
3030
# Left over files from tests
3131
coverage.txt
3232
.ci/ubuntu/log/rabbitmq.log
33+
docs/examples/otel_metrics/otel_metrics
3334

3435
# Visual Studio Code
3536
.vscode/*

0 commit comments

Comments
 (0)