newrelic / newrelic/newrelic-java-agent

MetricNameFormats should use a bounded cache

Open
#1,825 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

https://github.com/newrelic/newrelic-java-agent/blob/4b53e4f75d16ebd3c5d41e3c777ea4da15480e6b/newrelic-agent/src/main/java/com/newrelic/agent/tracers/metricname/MetricNameFormats.java#L21-L23

If a customer were to create enough segments with extremely dynamic names, this cache could grow to an unreasonable size and appear to be a memory leak.

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 newrelic-agent/src/main/java/com/newrelic/agent/tracers/metricname/MetricNameFormats.java at lines 21-23 and trace how the cache is used for metric names. The work is done when dynamically generated segment names cannot cause the cache to grow without bound; run the relevant agent tests after identifying them.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.