open-telemetry / open-telemetry/opentelemetry-java-instrumentation

AMQP message exception handling is not part of instrumentation

Open
#11,545 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug needs triage
Dominant language
Java
Stars
2.6k
Forks
1.2k
Avg merge
2d 16h
Merged PRs (30d)
214

Description

Describe the bug

Currently the org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer::invokeListener(Channel, Object) is instrumented, which covers the message handling itself, but not the handling of exceptions raised by the message handler.

Steps to reproduce

Throw exception in @RabbitListener method and check the produced Execution of Rabbit message listener failed. log message.

Expected behavior

The log message Execution of Rabbit message listener failed. contains trace and span IDs.

Actual behavior

The log message does not contain trace nor span IDs.

Javaagent or library instrumentation version

v1.32.1

Environment

JDK: Temurin 17
OS: Debian 11 (bullseye)

Additional context

Used JAva instrumentation v1.32.1 from OpenTelemetry Kubernetes Operator v0.102.0.

I checked the code and it would be sufficient to instrument the org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer::executeListener(Channel, Object) instead of invokeListener to cover also the exception handling for the message.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the instrumentation for AbstractMessageListenerContainer::invokeListener(Channel, Object) and compare it with executeListener(Channel, Object). Reproduce the failure by throwing an exception from an @RabbitListener method, then verify that the “Execution of Rabbit message listener failed.” log contains trace and span IDs.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, rabbitmq, spring
Domain
backend, observability
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.