Add server-wide tags from plugins/trace/config.yml; 0.3.0 - #4
Merged
Merged
Conversation
A `tags:` block in the server-wide config is merged into every event every plugin on the server reports, so a test or CI server can mark itself with `ci: "true"`. The event's own tag wins on a conflict; entries the trace server would reject are dropped and the merge is capped at MAX_TAGS; malformed content never throws or disables reporting. Read once at build(), alongside `enabled:`, which still wins. A freshly created file carries the example commented out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016Qot8ZBn7NPiiqmjAWpGY5
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.
Summary
A
tags:block is added to the server-wide switch fileplugins/trace/config.yml. Every event any plugin on the server reports gets those tags merged in, so an automated test server can mark its events withci=trueand the trace server leaves them out of real-installation figures (ciis one of the public view's excluded tags).tags:at column 0, then indentedkey: valuelines; values double-quoted, single-quoted or bare; blank and#lines skipped; the block ends at the next unindented non-blank line or EOF. Lines indented differently from the first entry are ignored, and anenabled:entry inside the block is a tag, not the switch.version/nameare never overwritten).MetricDto: keys must match[A-Za-z0-9][A-Za-z0-9_.-]*, keys and values are at most 255 characters, at most 32 server-wide tags are read, and server-wide tags stop being added once the event carries 32 in total. Invalid entries are dropped one at a time; malformed content (including non-UTF-8 bytes) never throws and never disables reporting.build(), at the same moment asenabled:;enabled: falsestill wins.SERVER_WIDE_CONFIG_CONTENTgains a commented-out example afterenabled: true, so a freshly created file adds no tags.VERSIONconstant (used for the User-Agent),pom.xml, README JitPack snippet. The README documents the block under a new "Server-wide tags" section. Single file, no new dependencies, Java 8 source level.Tests
13 new tests in
TraceClientTest(loopbackHttpServer, injectable environment): merge into the JSON body, event tag wins, quoted/bare values, comments/blank lines, block termination, invalid keys/overlong values dropped, the MAX_TAGS cap,enabled: falsestill disabling, no file / no tags, fresh file has no active tags, malformed and non-UTF-8 files. Two existing tests were updated for the longer created-file content.mvn -B verifypasses locally on JDK 17, 21 and 11 (42 tests, 0 failures); JDK 8 is covered by CI. Mutation probes (event-wins, cap, value length, block termination) each fail a test.drafted by Claude on behalf of Daniel Stephenson
🤖 Generated with Claude Code