Skip to content

Periodic metric reader causing 1,000 object references to be read when calculating the size of the object graph #4671

Answered by nluk
JBodkin-Amphora asked this question in Q&A
Discussion options

You must be logged in to vote

@jack-berg I don't know why a PeriodicMetricReader thread performed the read - in my case it's prometheus-http-%d threads doing that, but that's with OTEL_METRICS_EXPORTER=prometheus set on the java agent. Regardless, I encountered kind of the same behaviour - I didn't reach the warning, because the ObjectGraphWalker failed reflection on unopened java.util module. The culprit was this micrometer metric for ehcache, which is reported by OpenTelemetry on behalf of micrometer.

As this is a Spring-specific thing, the required properties to disable it are for example:

management.metrics.enable.cache.size=false
management.metrics.enable.cache.local=false

as mentioned here.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@nluk
Comment options

Answer selected by jack-berg
@jack-berg
Comment options

@nluk
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants