newrelic / newrelic/newrelic-java-agent

Missing Kafka producer Span

Open
#2,059 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

2 jan-mar qtr
Dominant language
Java
Stars
240
Forks
170
Avg merge
3d 2h
Merged PRs (30d)
21

Description

Description

In a test application using distributed tracing, the Span that should be created by the KafkaProducer#doSend method is never sent.

The screenshot below shows the Spans sent to the backend, but there is a highlighted parend.id which does not have a corresponding Span.
Screenshot 2024-09-10 at 5 11 50 PM

The headers are added correctly to the Kafka message and the distributed trace is created between services.

Audit logs showed that the agent does not send that Span.

Although, the missing Span is shown in the Transaction Traces.

Reproduction code in https://github.com/prodjito/kafka-producer-consumer

The test was executed by invoking the ProducerServlet and the ConsumerServlet manually, from apps running in different JVMs.

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 with the linked kafka-producer-consumer reproduction and trace the distributed flow through KafkaProducer#doSend, using the ProducerServlet and ConsumerServlet setup described in the report. Determine why the producer Span is absent from audit logs despite appearing in Transaction Traces; done means the producer Span is sent and corresponds to the highlighted parent.id.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, kafka
Domain
distributed-systems, observability-sre
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.