Add OpenTelemetry metrics support with semantic conventions#84
Conversation
d676e01 to
e4433d3
Compare
|
@Gsantomaggio in theory, we are in the code freeze period. I'll let you decide if you want to squeeze this feature in Feb release, or include in March release. |
|
Thank you, @Zerpet. I will wait for the next release. |
Gsantomaggio
left a comment
There was a problem hiding this comment.
Thanks @Zerpet
Can we use the same .NET client names and metrics
26ebb1d to
bfd64f6
Compare
We have mostly the same metrics. I renamed |
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>
bfd64f6 to
fdb7bd5
Compare
|
Thanks @Zerpet, we can merge! Great job! |
This pull request introduces OpenTelemetry (OTEL) metrics support to the RabbitMQ AMQP 1.0 Go client, allowing users to collect, export, and observe metrics related to connections, publishers, consumers, and message flows. The changes include a new OTEL metrics example, enhancements to the environment and connection APIs for metrics configuration, and integration of metrics collection throughout the connection and consumer lifecycles.
OTEL Metrics Integration:
docs/examples/otel_metrics/demonstrating how to configure and use OTEL metrics with a stdout exporter, including ago.modfile and a comprehensivemain.gowalkthrough. [1] [2]go.modto require OpenTelemetry dependencies and updated other dependencies to support metrics collection. [1] [2]Environment and API Enhancements:
EnvironmentandClusterEnvironmentconstructors to accept functional options, includingWithMetricsCollectorandWithStrategy, making metrics configuration flexible and extensible. [1] [2] [3] [4]Connection and Consumer Metrics Instrumentation:
These changes provide a robust foundation for observability and monitoring, making it easier to integrate the client with modern telemetry systems.
Most important changes:
OTEL Metrics Example and Dependencies
main.goandgo.modindocs/examples/otel_metrics/to demonstrate metrics collection and export. [1] [2]go.modto include OTEL dependencies and update related modules. [1] [2]Environment and API Improvements
EnvironmentandClusterEnvironmentconstructors to use functional options (WithMetricsCollector,WithStrategy), making metrics and strategy configuration more flexible. Deprecated the old strategy-based constructor. [1] [2] [3] [4]Connection Metrics Instrumentation
Consumer and Message Metrics Instrumentation
Documentation and Example Updates
Closes #9