feat(logs): add stateful encoding module plumbing and token types#49215
Draft
DDuongNguyen wants to merge 1 commit intojsaf/stateful-transport-initfrom
Draft
Conversation
Contributor
Author
This was referenced Apr 10, 2026
678a3d5 to
022a743
Compare
022a743 to
bf7d7b9
Compare
bf7d7b9 to
aa058a0
Compare
This was referenced Apr 15, 2026
This was referenced Apr 25, 2026
Draft
Draft
Draft
Draft
This was referenced May 4, 2026
Draft
Draft
Draft
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.

What does this PR do?
Lays the foundation for the stateful encoding feature by introducing:
pkg/logs/patterns/token/): Core types —Token,TokenList,Signature,Tokenizerinterface — that all downstream pattern modules depend onpkg/proto/datadog/stateful/): TheStatefulEncodinggRPC service contract and message types for streaming encoded log datapkg/config/setup/,comp/logs/agent/config/): Newlogs_config.use_grpcand stateful encoding knobs (max patterns, eviction thresholds, etc.)go.mod/go.sumreplacedirectives,go.work, andmodules.ymlupdates so the new sub-modules resolve across the monorepopkg/logs/patterns/DESIGN.md): Architecture overview of the full feature — read this first for context on the entire stackMotivation
The stateful encoding pipeline needs shared types, protobuf contracts, and config wiring before any feature code can be added. Splitting these into the first PR keeps every subsequent PR focused on a single architectural layer.
Describe how you validated your changes
pkg/logs/patterns/token/)go build ./...succeeds for affected modules.protosourceHow to Review this PR
pkg/logs/patterns/DESIGN.mdfor the full architecture overviewpkg/proto/datadog/stateful/stateful_encoding.protofor the gRPC contractpkg/logs/patterns/token/for the core type definitionsgo.mod/go.sumchanges are mechanicalreplacedirectives — spot-check a fewAdditional Notes
The bulk of the file count comes from
go.modreplacedirectives (~185 modules). These are additive and mechanical. The actual feature code in this PR is the token package, proto definitions, and config additions.