Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add guard to hot logging location in associator #1623

Conversation

thepalbi
Copy link
Contributor

@thepalbi thepalbi commented Jan 15, 2025

This PR adds a guard over some "hot" locations in the associator where debug logging is used. A recent commit in yace removed some if-guard that were in place to protect debug logging locations. The main problem with this is not the logging call itself, but the evaluation of the arguments (for example regexpMapping.toString()), which was not executed when the guards where in place.

When running yace at scale in our dev clusters (and even worse in our prod clusters) we noticed 20% of cpu time in profiles was consumed by the evaluation of fmt.Sprintf from the logging arguments, which wasn't before.

image

@thepalbi thepalbi force-pushed the pablo/guard-debug-logging-code-paths branch from 872cb10 to 6e98760 Compare January 15, 2025 14:59
@thepalbi thepalbi force-pushed the pablo/guard-debug-logging-code-paths branch from 6e98760 to f9f0b88 Compare January 15, 2025 15:01
@cristiangreco cristiangreco merged commit e6f1b51 into prometheus-community:master Jan 15, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants