feat(saf): add Micrometer metrics instrumentation - #382
Merged
Conversation
Collaborator
Author
|
Thanks, @chhil. I implemented your Prompt Request and opened this PR. I followed a TDD flow and kept the SAF metrics pattern aligned with Since this is the first Prompt Request we're receiving, here's the short write-up on the idea as well: |
Contributor
|
The prompt missed adding |
chhil
reviewed
Jun 13, 2026
| private Entry send(Entry entry) { | ||
| String mti = getMTI(entry); | ||
| if (shouldIgnore(entry)) { | ||
| metrics.sendExpired(mti, isMaxRetransmission(entry) ? "max-retransmissions" : "expired"); |
Contributor
There was a problem hiding this comment.
Should 2 events get logged if its max retransmission and expired?
i.e. preserves both when both conditions apply
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements Chhil's Prompt Request to add Micrometer instrumentation to the jPOS-EE SAF module, following a red-green-refactor flow and mirroring the existing
QRestMetricspattern.Because this is our first Prompt Request, a quick note on the idea is here:
https://jpos.org/blog/2026/02/prompt-requests
What's included:
SAFMetricswith null-safe no-op behavior when noMeterRegistryis configuredjpos.saf.queue.sizejpos.saf.send.durationjpos.saf.send.successjpos.saf.send.retriedjpos.saf.send.expiredjpos.saf.send.discardedSAF.initService()andSAF.send(Entry)micrometer.coretomodules/safmodule-infoBehavior covered by tests:
Verification:
./gradlew :modules:saf:testgit diff --check