Skip to content

Change to DEBUG (from INFO) 'Not re-registering MeterRegistry ...' - #2914

Merged
jackshirazi merged 3 commits into
elastic:mainfrom
jackshirazi:micrometer-less-verbose
Dec 7, 2022
Merged

jackshirazi merged 3 commits into
elastic:mainfrom
jackshirazi:micrometer-less-verbose

Conversation

@jackshirazi

Copy link
Copy Markdown
Contributor

What does this PR do?

Change to DEBUG (from INFO) 'Not re-registering MeterRegistry ...' message as it is too verbose

@ghost

ghost commented Dec 6, 2022 •

Copy link
Copy Markdown

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-12-07T09:54:30.798+0000

  • Duration: 63 min 32 sec

Test stats 🧪

Test Results
Failed 0
Passed 3236
Skipped 41
Total 3277

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • run benchmark tests : Run the benchmark tests.

  • run jdk compatibility tests : Run the JDK Compatibility tests.

  • run integration tests : Run the Agent Integration tests.

  • run end-to-end tests : Run the APM-ITs.

  • run windows tests : Build & tests on windows.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

Step hopefullyNull = meterRegistries.putIfAbsent(meterRegistry, newStep);
if (hopefullyNull != null) {
logger.info("Not re-registering MeterRegistry as it is already registered from another compound meter registry: {}", meterRegistry);
logger.debug("Not re-registering MeterRegistry as it is already registered from another compound meter registry: {}", meterRegistry);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If my understanding is correct, this code path is executed basically on every interaction with a meter, which in turn causes the large amounts of logging.

I feel like DEBUG-level is still to much: It would clutter the logs we use for support cases.
I would move it to trace or even remove this statement completely, because I don't know hat it would be used for.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't comment on unchanged code, so adding this here:

        if (step >= 0 && step < 1000) {
            logger.warn("Not registering unsupported step interval of {} milliseconds (1 seconds is the minimum supported) for Micrometer MeterRegistry: {}", step, meterRegistry);
            return;
        }

This will also cause a spam of warnings IINM. Maybe we should make sure to log only once per registry?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And another one I'm not sure about:

logger.warn("Identified Micrometer SimpleConfig: {}", config);

Shouldn't this one be debug?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes agree, will move to trace. I don't want to add additional memory cost to track which have been logged, trace is fine. It is useful when there is a problem tracing which meters are being processed.

Also agree that other should be debug

@siddharth76

Copy link
Copy Markdown

@JonasKunz @jackshirazi Hey i am using apm-agent-attach/1.35.0, latest version of apm-agent-attach, still getting above logs undefinetely

@code4mankind

Copy link
Copy Markdown

@JonasKunz @jackshirazi any idea when this fix will be released? We are currently blocked on upgrading until that time - presumably we will be seeing a 1.35.1 release soon that includes this fix.

@jackshirazi

Copy link
Copy Markdown
Contributor Author

Targeting this month

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants