Skip to content

feat(logging): added a structured payload logging with masking and truncation - #1234

Closed
katepallewarprathmesh-sketch wants to merge 1 commit into
a2aproject:mainfrom
katepallewarprathmesh-sketch:feat/1221-structured-payload-logging
Closed

katepallewarprathmesh-sketch wants to merge 1 commit into
a2aproject:mainfrom
katepallewarprathmesh-sketch:feat/1221-structured-payload-logging

Conversation

@katepallewarprathmesh-sketch

Copy link
Copy Markdown

Provided structured DEBUG-level log events for A2A protocol messages including task requests, state changes, artifacts, negotiation payloads, authorization decisions, and notification subscriptions/deliveries.

  • Added A2APayloadLoggingConfig with system property support (enabled, max-size default 4KB, masking toggle, custom strategy/sensitive-keys)
  • Added PayloadMaskingStrategy interface with Default (recursive JSON traversal, regex fallback) and NoOp implementations; default masks token/credentials/password/secret/url etc. case-insensitively
  • Added PayloadTruncator with [truncated] marker
  • Added TraceCorrelation via OpenTelemetry reflection + MDC for trace_id/ span_id log correlation
  • Added StructuredPayloadLogger with fluent SLF4J keyValue fields and convenience methods for task/auth/push/negotiation events
  • Integrate server-side logging in DefaultRequestHandler (requests, results, auth, push subs), AgentEmitter (state/artifact/message), TaskManager (persisted state/artifact), BasePushNotificationSender (delivery)
  • Integrate client logging in JSONRPCTransport (requests/results, streaming, push, negotiation) and OpenTelemetry decorators
  • Added defaults to a2a-defaults.properties and documentation
  • Added unit tests for truncation, masking, config and structured logger

Fixes #1221

…tion

Provide structured DEBUG-level log events for A2A protocol messages
including task requests, state changes, artifacts, negotiation payloads,
authorization decisions, and notification subscriptions/deliveries.

- Add A2APayloadLoggingConfig with system property support (enabled,
  max-size default 4KB, masking toggle, custom strategy/sensitive-keys)
- Add PayloadMaskingStrategy interface with Default (recursive JSON
  traversal, regex fallback) and NoOp implementations; default masks
  token/credentials/password/secret/url etc. case-insensitively
- Add PayloadTruncator with [truncated] marker
- Add TraceCorrelation via OpenTelemetry reflection + MDC for trace_id/
  span_id log correlation
- Add StructuredPayloadLogger with fluent SLF4J keyValue fields and
  convenience methods for task/auth/push/negotiation events
- Integrate server-side logging in DefaultRequestHandler (requests,
  results, auth, push subs), AgentEmitter (state/artifact/message),
  TaskManager (persisted state/artifact), BasePushNotificationSender
  (delivery)
- Integrate client logging in JSONRPCTransport (requests/results,
  streaming, push, negotiation) and OpenTelemetry decorators
- Add defaults to a2a-defaults.properties and documentation
- Add unit tests for truncation, masking, config and structured logger

Fixes a2aproject#1221

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No structured payload logging

1 participant