Skip to content

Conversation

@TheSafo
Copy link
Contributor

@TheSafo TheSafo commented Nov 3, 2025

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 PatternedLog generator 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

  • Introduces patterned_log module with weighted template selection for log levels
  • Includes configurable LevelWeights and timestamp jitter settings
  • Reuses existing datadog_logs::Member and Message types for consistency
  • Comprehensive property-based tests ensure payloads respect max_bytes constraints and deserialize correctly
  • Default configuration produces 85% info, 10% warning, and 5% error level logs

Co-authored-by: TheSafo <2309416+TheSafo@users.noreply.github.com>
@datadog-official
Copy link

datadog-official bot commented Nov 3, 2025

Bits AI Dev Agent Status: ✅ Done [Fix CI Errors]

Status History (2 entries)
2025-11-03 16:11:49 UTC ✅ Processed user query
2025-11-08 01:02:07 UTC ❎️ Stopped monitoring for CI failures due to age of PR

You can ask for changes by mentioning @DataDog in a comment.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants