Skip to content

Cache prometheusize rename between scrapes #1080

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

vigno88
Copy link

@vigno88 vigno88 commented May 9, 2025

After profiling the exporter because it had a somewhat high cpu usage, it reported that the regexp operations in this function accounts for more than 10% of the cpu time.

More precisely, the first call to prometheusize uses 3.79%, the second 5.86% (in exporter.MakeMetrics) and lastly it 1.03% (in exporter.MakeRawMetrics)

This all goes to zero if we cache them.

@vigno88 vigno88 requested a review from a team as a code owner May 9, 2025 18:19
@vigno88 vigno88 requested review from ademidoff and JiriCtvrtka and removed request for a team May 9, 2025 18:19
@it-percona-cla
Copy link

it-percona-cla commented May 9, 2025

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
2 out of 3 committers have signed the CLA.

✅ vigno88
✅ idoqo
❌ vigno99
You have signed the CLA already but the status is still pending? Let us recheck it.

@vigno88
Copy link
Author

vigno88 commented May 9, 2025

Copy link
Contributor

@idoqo idoqo left a comment

Choose a reason for hiding this comment

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

Thanks a lot for your contribution. Please

  • Fix failing tests.
  • Sign the CLA

@idoqo
Copy link
Contributor

idoqo commented May 10, 2025

Hi @vigno88 looks like tests are still failing - also looks like the profile you shared was from before the change - will be nice to have both to see how they compare.

@vigno88
Copy link
Author

vigno88 commented May 10, 2025

Hi, thanks for the quick response.

I'll take a look at the tests and yes i will provide a new profile.

Nathan AV

@BupycHuk
Copy link
Member

Hi, please also make sure that it's thread-safe.

@vigno88
Copy link
Author

vigno88 commented May 12, 2025

i've signed the CLA a lot of time last week and I tried again today. It says that the signature was made, but the status of the issue doesn't update..

Copy link

codecov bot commented May 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 65.50%. Comparing base (dc46ed5) to head (24099d3).
Report is 101 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1080      +/-   ##
==========================================
- Coverage   70.88%   65.50%   -5.39%     
==========================================
  Files          28       29       +1     
  Lines        3569     3073     -496     
==========================================
- Hits         2530     2013     -517     
- Misses        904      922      +18     
- Partials      135      138       +3     
Flag Coverage Δ
agent 65.50% <100.00%> (-5.39%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@vigno88
Copy link
Author

vigno88 commented May 12, 2025

There are other changes is this profile, but this show the cpu usage of prometheusize after the changes.
https://flamegraph.com/share/a322d13f-2f3a-11f0-8b23-2a8f4480f552

@vigno88
Copy link
Author

vigno88 commented May 13, 2025

All the test have passed, and the signature for my account has passed (vigno99 is the user of my computer)

@idoqo
Copy link
Contributor

idoqo commented May 13, 2025

Thanks a lot for your contribution, @vigno88. I'll check with our internal QA team about testing this, and then we can merge.

@BupycHuk BupycHuk requested a review from idoqo May 29, 2025 09:43
@idoqo idoqo self-assigned this Jun 9, 2025
@idoqo
Copy link
Contributor

idoqo commented Jun 10, 2025

Hi @vigno88 , ready to merge this now, but seems there were also some commits from @vigno99 , so the CLA needs to be signed by both accounts

@vigno88
Copy link
Author

vigno88 commented Jun 10, 2025

vigno99 looks like an autogenerated git user on my work computer. It's not linked to any github account.. I can't log to anything with it

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.

5 participants