Skip to content

Add native JsonTemplateLayout resolvers for W3C tracing fields#4175

Open
ramanathan1504 wants to merge 2 commits into
2.xfrom
json-template-layout-resolvers
Open

Add native JsonTemplateLayout resolvers for W3C tracing fields#4175
ramanathan1504 wants to merge 2 commits into
2.xfrom
json-template-layout-resolvers

Conversation

@ramanathan1504

Copy link
Copy Markdown
Contributor

Follow-up to PR #4171

As discussed with @rgoers, this PR adds the TraceIdResolver, SpanIdResolver, and TraceFlagsResolver to log4j-layout-template-json.

Currently, users outputting structured JSON to Elasticsearch would have to fall back to the pattern resolver ({"$resolver": "pattern", "pattern": "%traceId"}), which introduces intermediate StringBuilder allocations.

By providing these nativeJTL event resolvers, structured logging can utilize the native trace fields with absolute zero-allocation performance on the hot path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

1 participant