open-telemetry / semantic-conventions

Defines standards for generating consistent, accessible telemetry across a variety of domains
Apache License 2.0
250 stars 162 forks source link

Review Kafka and RabbitMQ attributes #751

Open lmolkova opened 7 months ago

lmolkova commented 7 months ago

Based on the messaging SIG discussion on 2/15/24, we should target stabilizing Kafka and RabbitMQ semconv along with the messaging semconv stability.

While we can always add span attributes, but adding attributes to the metrics is breaking #722.

So prior to stability, we should

Update: see https://github.com/open-telemetry/semantic-conventions/pull/798#discussion_r1516427699

lmolkova commented 7 months ago

Dropping some initial research results for Kafka here.

TL;DR: looking into kafka JMX metrics, 'native' metrics proposal, javadocs for client APIs, I can see the following properties that might be interesting on metrics, have low cardinality, no sensitive information, apply on the operation level (rather than transport).

Others like client.id (messaging.client_id) would be controversial.


Producer

Documented in 'native' kafka metrics:

These are per-client instance and potentially have high cardinality. Reporting them on OTel metrics is controversial.

Consumer

Documented in 'native' kafka metrics:

Consumer config

Links:

  1. Kafka 'native' metrics https://cwiki.apache.org/confluence/display/KAFKA/KIP-714%3A+Client+metrics+and+observability
  2. Java API docs
  3. Kafka configuration options for producers and consumers
  4. Kafka JMX metrics
lmolkova commented 7 months ago

adding research on RabbitMQ

TL;DR: pre-stability:

can be added incrementally:


Java otel instr reports

Python otel doesn't report anything new

RabbitMQ message properties that could be interesting on metrics (low cardinality, logical level):

Collector rabbitmq scraper does not report any attributes.

Client JMX metrics don't seem to have any attributes

pyohannes commented 6 months ago

we should also check rabbitmq/kafka attributes to see if any of the existing ones are good candidates to be generalized

Based on discussions in #798, we should also look into standardizing messaging.kafka.message.offset.

pyohannes commented 3 months ago

Discussed in the messaging workgroup: we'll need a RabbitMQ-specific extension for metrics because the routing key is needed on RabbitMQ metrics.

pyohannes commented 3 months ago

This issue is related: https://github.com/open-telemetry/semantic-conventions/issues/1156