configurable flush threshold and interval (ms)#336
Open
nr-phil wants to merge 3 commits intonewrelic:mainfrom
Open
configurable flush threshold and interval (ms)#336nr-phil wants to merge 3 commits intonewrelic:mainfrom
nr-phil wants to merge 3 commits intonewrelic:mainfrom
Conversation
|
|
jtduffy
requested changes
Aug 19, 2025
Contributor
jtduffy
left a comment
There was a problem hiding this comment.
LGTM, Just the javadoc change is required for the GH checks to pass
| } | ||
|
|
||
| /** | ||
| * Updates the flush configuration. If both parameters are > 0, periodic flushing will be enabled. |
Contributor
There was a problem hiding this comment.
nit: the JDK javadoc linter is complaining about the use of >. I think you can simply replace it with >
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
context
We (SPI) use the telemetry-core SDK for our Kafka telemetry application that scrapes Kafka clusters and sends metrics to New Relic. i believe we've hit a scenario where the code is generating more metrics than the SDK can handle. this causes buffer pressure that manifest as these warnings:
WARN [2025-08-15 18:01:12,788] com.newrelic.telemetry.LimitingScheduler: Refusing to schedule batch of size 251 (would put us over max size 500000, available = 4)WARN [2025-08-15 18:01:12,788] com.newrelic.telemetry.LimitingScheduler: DATA IS BEING LOST!which come from here: https://github.com/newrelic/newrelic-telemetry-sdk-java/blob/main/telemetry-core/src/main/java/com/newrelic/telemetry/LimitingScheduler.java#L36-L46
this is not ideal as it regularly drops data and causes gaps in our Kafka charts as shown below.
This PR adds the ability to configure the flush threshold and flush interval (milliseconds) so that we can flush the internal buffer more frequently and avoid the aforementioned warnings.
usage