Skip to content

feat: Support CRaC and priming of powertools metrics and idempotency-dynamodb #1861

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 10 commits into
base: main
Choose a base branch
from

Conversation

subhash686
Copy link
Contributor

Issue #, if available:
#1588

Description of changes:

  • Added CRaC support in powertools-common, following the guide and blogs mentioned on the ticket.
  • Added automatic priming for powertools-metrics by preloading all the required classes, the list of classes is fetched from the JVM at compile time.
  • Added manual priming for dynamodb persistence store

Checklist

Breaking change checklist

RFC issue #:

  • Migration process documented
  • Implement warnings (if it can live side by side)

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@subhash686
Copy link
Contributor Author

@phipag Looks like v2 is now merged and released, so I resolved conflicts to rebase to main. Let me know if you have any other release plans for this.

@phipag
Copy link
Contributor

phipag commented Jun 12, 2025

Thanks @subhash686 and apologize the delay. I was very busy with the v2 release.

Your PR is next on my list and we'll try to get it merged for the next minor release 2.1.0.

@phipag
Copy link
Contributor

phipag commented Jun 25, 2025

Hey @subhash686, I didn't forget you. This week is very busy but I'll do my best to test your implementation very soon.

In the meantime, can you have a look at the 4 Sonar issued and either resolve them or mark them as not applicable if you think that is the case?

@subhash686
Copy link
Contributor Author

@phipag Fixed the sonar issues, I did not notice the comment earlier, thanks for pointing it out.

@phipag
Copy link
Contributor

phipag commented Jul 7, 2025

Hey @subhash686 , I am reviewing your PR now. Can you provide some details how you generated the txt file of the classes loaded? I see you say:

the list of classes is fetched from the JVM at compile time.

Can you provide the compilation command you used for this?

Ideally, I would like to reproduce the process for how to generate and then use the txt file of loaded classes.

@subhash686
Copy link
Contributor Author

subhash686 commented Jul 7, 2025

Hey @subhash686 , I am reviewing your PR now. Can you provide some details how you generated the txt file of the classes loaded? I see you say:

the list of classes is fetched from the JVM at compile time.

Can you provide the compilation command you used for this?

Ideally, I would like to reproduce the process for how to generate and then use the txt file of loaded classes.

Thanks @phipag . Here are the steps I followed

  • Ran following commands to generate the loaded classes in the project root directory
    > export MAVEN_OPTS="-Xlog:class+load=info:classloaded.txt"
    > mvn install -pl powertools-metrics -am

  • File has each line in the format [0.054s][info][class,load] java.lang.Object source: shared objects file

  • Used regex to remove all the prefix extra characters [\[\]a-z0-9.,]+ and a simple replace the text source: shared objects file which is at the end of each line.

  • Moved the file to powertools-metrics resources directory.

Copy link

sonarqubecloud bot commented Jul 7, 2025

@phipag
Copy link
Contributor

phipag commented Jul 7, 2025

Thanks @subhash686 for providing this context. I will reproduce it and run a load test of this code. Will share the results here soon and we can move forward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Pending review
Development

Successfully merging this pull request may close these issues.

2 participants