Designing a Pattern-Based Log Generator for Realistic Load #1581
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.
PR by Bits for Dev Agent Session
You can ask for changes by mentioning @DataDog in a comment.
Feedback (especially what can be better) welcome in #code-gen-feedback!
What does this PR do?
Adds a new
PatternedLoggenerator that produces realistic Datadog-style logs with common patterns instead of fully random content. The generator uses weighted templates for different log levels (info, warn, error) and includes realistic fields like hostnames, services, routes, and structured message formats.Motivation
The existing random log generators produce payloads that don't reflect real-world logging patterns. This new generator creates more realistic load by constraining randomness to common patterns, helping downstream systems surface aggregation behavior that can be masked by fully random payloads.
Related issues
Implements the feature request for a pattern-driven log generator built on top of existing generators like filegen.
Additional Notes
patterned_logmodule with weighted template selection for log levelsLevelWeightsand timestamp jitter settingsdatadog_logs::MemberandMessagetypes for consistency