Instrument Twirl template with a java agent#28895
Merged
Merged
Conversation
Contributor
166ec20 to
de4a547
Compare
This was
linked to
issues
Jul 2, 2026
This was coded with the help of Opus 4.8
de4a547 to
2eebc6e
Compare
ff94120 to
c1d12ab
Compare
55a982a to
55d8a0f
Compare
Contributor
Author
|
I've also tested adding a "decoy" twirl template hidden behind an impossible condition (1+1 == 3) just to ensure that its name would not appear in the list (which would mean appearing simply for being referenced rather than executed). The test is conclusive. |
williammead
approved these changes
Jul 7, 2026
|
Seen on ADMIN-PROD (merged by @alexduf 9 minutes and 10 seconds ago)
|
|
Seen on FRONTS-PROD (merged by @alexduf 9 minutes and 17 seconds ago)
|
7 tasks
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.
See #28909 and #28894
This was coded with the help of Opus 4.8. I don't think I could have cooked it this quick otherwise.
What is the value of this and can you measure success?
Can we measure which twirl template is being used in production? if so: success.
What does this change?
Instrument production artefacts at runtime in order to detect which twirl templates truly are used in a live environment. The instrumentation writes a json log line in a separate file each time a new template is encountered.
The logging implementation is voluntarily naive, it's inefficient but it's a trade-off for simplicity that I'm willing to accept because:
As of now this is only applied to the
discussionservice, and it will be generalised in this ticketScreenshots
Checklist
data/databasefiles generated by tests are committed with this PR (the tests will fail in CI if you've forgotten to do this)