Skip to content

Record client operation durations for Kafka and Service Bus sends #296

Closed

Description

@thomhurst

During #273 outgoing adapter work, comparison with existing adapters found that native Kafka and Service Bus sends do not record the required Relayer client-operation duration histogram.

Evidence:

  • src/Relayer/Telemetry/SendTracing.cs creates an EndpointTelemetry and calls RecordSent, but never RecordDuration.
  • src/Relayer.Kafka/KafkaProducerTransport.cs and src/Relayer.AzureServiceBus/ServiceBusSendTransport.cs wrap sends with SendTracing but have no RecordDuration call or endpoint operation timer.
  • docs/design.md section 8.4 requires messaging.client.operation.duration for each send, including native operation completion.

Reproduction: attach a MeterListener to meter Relayer and instrument messaging.client.operation.duration; complete a successful or failing send through either adapter. The sent counter is recorded, but no send duration is emitted. Native-client metrics are separate and do not fill the Relayer instrument.

Expected: record one duration per actual native single or batch send operation, including confirmation/acknowledgement time, with the correct system/destination/server dimensions and bounded error.type on failure. Outbox enqueue must not count as a broker send. Avoid recording the same operation twice at the pipeline and adapter boundaries.

Acceptance:

  • Add listener tests for successful and failed direct sends, homogeneous/mixed batches and outbox dispatch.
  • Reuse the existing telemetry instruments and native instrumentation; do not add parallel meters or spans.
  • Validate any material steady-state cost with the native comparison benchmarks and update documentation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2bugin-progress

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions