feat(logs): add pattern extraction to gRPC stateful sender#49219
Draft
Conversation
This was referenced Apr 10, 2026
Contributor
Author
This was referenced Apr 10, 2026
f2d7858 to
d0fc212
Compare
381377c to
aaabc7d
Compare
aaabc7d to
f397434
Compare
d0fc212 to
27da999
Compare
27da999 to
ad5aa9b
Compare
f397434 to
095d10d
Compare
This was referenced Apr 15, 2026
This was referenced Apr 25, 2026
Draft
Draft
Draft
This was referenced Apr 29, 2026
Draft
Draft
Draft
This was referenced May 8, 2026
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?
Integrates pattern extraction into the gRPC stateful sender (built in #48879 by @TheSafo), adding:
sender.go): Attaches pattern signatures and cluster IDs to outgoing log messages, caching state to avoid redundant computationbatch_strategy.go): Pattern-aware batching that considers signature similarity when grouping messages for transmissionstream_worker.go): Wires theMessageTranslatorinto the existing gRPC streaming pipelineinflight.go): Tracks in-flight pattern state for acknowledgment handlingstate_telemetry.go): Telemetry counters for pattern cache hits/misses, encoding decisionsmock_encoder.go,mock_state.go,mock_state_cache_test.go): Test infrastructure for the pattern-aware senderMotivation
The gRPC sender needs to attach pattern metadata to log messages so the backend can perform stateful encoding (deduplication, compression). This PR adds that translation layer without changing the underlying transport mechanics.
Describe how you validated your changes
MessageTranslatorcaching behavior (mock_state_cache_test.go)How to Review this PR
sender.go— theMessageTranslatorand its pattern cachebatch_strategy.go— how pattern similarity affects batchingstream_worker.go— diff is small, focus on theMessageTranslatorintegration pointsstate_telemetry.go— new telemetry countersAdditional Notes
This PR modifies files that already exist in #48879's branch. The diff shows only incremental additions (pattern extraction logic), not the full sender implementation.