newrelic / newrelic/newrelic-java-agent

[Spike] NewRelic stops displaying external service calls after enabling use of the virtual threads

Open
#2,835 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

spike
Dominant language
Java
Stars
240
Forks
170
Avg merge
3d 2h
Merged PRs (30d)
21

Description

Description

We have a Java Spring Boot application which uses Spring GraphQL, and makes calls to external services using RestClient. When we enable use of virtual threads, the calls to external services stop being displayed on NewRelic.

Expected Behavior

The calls to external services should keep being displayed after enabling the use of virtual threads.

Troubleshooting or NR Diag results

Didn't manage to troubleshoot the issue, and couldn't find existing issues/forum threads on the issue.

Steps to Reproduce

  1. Have a Java Spring Boot application that uses Spring GraphQL, and makes calls to external services using RestClient.
  2. Enable the use virtual threads within the application.
  3. The calls to external services should stop being displayed.

Unfortunately haven't got a sample application on hand, and can't share the actual application.

Your Environment

Java 21
Spring Boot 3.5.11
NewRelic Java Agent 9.1.0

Additional context

The current workaround seems to be creating our own NewRelicTokenTaskDecorator implementing org.springframework.core.task.TaskDecorator, which links the com.newrelic.api.agent.Token, runs the runnable, and then expires the token.

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 reviewing the interaction between the New Relic Java Agent 9.1.0, Java 21 virtual threads, Spring GraphQL, and Spring Boot's RestClient. Compare the missing external-service calls with the reported NewRelicTokenTaskDecorator workaround and seek a reproducible sample, since the issue provides no shareable application or agent entry point. Done means those calls are displayed when virtual threads are enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring-boot
Domain
backend, observability
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.