newrelic / newrelic/newrelic-java-agent

R2DBC query execution instrumentation resulting in unclear segment naming and categorization

Open
#996 5 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

2 breaking-change low priority
Dominant language
Java
Stars
240
Forks
170
Avg merge
3d 2h
Merged PRs (30d)
21

Description

Description

We're seeing transaction traces exceeding millions of milliseconds in a 'Custom' category segment called 'execute' after starting to use R2DBC.

image

We're still debugging the issue, could be that the long durations are an issue caused by our application as well, however, it was very confusing that a NewRelic integrated instrumentation is logged as 'Custom'.

I think this issue originates from here:

https://github.com/newrelic/newrelic-java-agent/blob/da8f5509331144d64a7ba33bf41316066e5c7f42/instrumentation/r2dbc-postgresql/src/main/java/io/r2dbc/postgresql/R2dbcUtils.java#L23

Where a segment is created with just the name execute.

Expected Behavior

Clearer categorization and naming of the R2DBC query execution.

Your Environment

NewRelic 7.9.0 on OpenJDK 64-Bit Server VM (build 18.0.2+0, mixed mode) using R2DBC(-postgresql) 0.9.1

(Migrate to Jira)

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 at instrumentation/r2dbc-postgresql/src/main/java/io/r2dbc/postgresql/R2dbcUtils.java around line 23 and inspect how the execute segment is created. Compare the current segment name and category with the requested clearer R2DBC query execution labeling; done means the instrumentation no longer appears as an ambiguously named Custom execute segment.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, postgresql
Domain
observability
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.