Skip to content

docs: improve stdout-log-generator README with full argument documentation - #3763

Open
k15r wants to merge 1 commit into
kyma-project:mainfrom
k15r:docs/stdout-log-generator-readme
Open

docs: improve stdout-log-generator README with full argument documentation#3763
k15r wants to merge 1 commit into
kyma-project:mainfrom
k15r:docs/stdout-log-generator-readme

Conversation

@k15r

@k15r k15r commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Replaces the bare argument list in the existing README with a full flags table (flag, short form, default, description)
  • Documents both output formats (JSON padding logic, plaintext text vs. random)
  • Explains the rate-limiting strategy and the Linux 2 ms sleep-granularity workaround
  • Adds concrete usage examples for all common flag combinations
  • Adds a docker run example alongside the existing build instructions

Test plan

  • Verify flag descriptions match main.go definitions

@k15r
k15r requested a review from a team as a code owner August 7, 2026 19:58
@hyperspace-pr-bot

Copy link
Copy Markdown
Contributor

Control Panel

Hi, I'm an AI-powered Review Bot that helps you with summarizing and reviewing pull requests.
To interact with me, just use the following actions:

  • 📝 Summarize PR
  • 🔍 Review
  • 🗑️ Delete all bot comments and reviews

@k15r
k15r requested a deployment to GitHub-Actions August 7, 2026 19:58 — with GitHub Actions Waiting
@hyperspace-pr-bot

Copy link
Copy Markdown
Contributor

Summary

The following content is AI-generated and provides a summary of the pull request:


What Changed

Rewrites the stdout-log-generator README to replace a bare argument list with full flag documentation, output format explanations, rate-limiting details, usage examples, and a docker run example.

Key Changes
  • dependencies/stdout-log-generator: Replaces the minimal argument list with a complete flags table, documents JSON and plaintext output formats including padding logic and edge cases, explains the token-bucket rate-limiting strategy and the Linux 2 ms sleep-granularity workaround, and adds concrete usage examples for common flag combinations.

Notes for Reviewers

This is a documentation-only change. Verify that the flag names, short forms, defaults, and descriptions in the table match the current main.go definitions before merging.

Release Notes Input

None.


  • 🔄 Regenerate and Update Summary
  • ✏️ Insert as PR Description (deletes this comment)
  • 🗑️ Delete comment
PR Bot Information

Version: 1.29.18

  • Summary Prompt: PR Prompt File
  • File Content Strategy: Full file content
  • Output Template: PR Bot Custom Output Template
  • LLM: anthropic--claude-4.6-sonnet
  • Event Trigger: pull_request.opened
  • Correlation ID: 63de7be0-929a-11f1-9443-5a99d8bf89e7

@github-actions github-actions Bot added the kind/docs Categorizes issue or PR as related to a documentation change label Aug 7, 2026
@github-actions github-actions Bot added this to the 1.70.0 milestone Aug 7, 2026
A small tool that continuously writes log lines to stdout. Used in the e2e tests of telemetry-manager to produce configurable log traffic inside Kubernetes workloads.

Available command line args:
The tool exposes a Prometheus metrics endpoint on port `2112` (`/metrics`) with two metrics:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The tool exposes a Prometheus metrics endpoint on port `2112` (`/metrics`) with two metrics:
The tool exposes a Prometheus metrics endpoint on port `2112` (`/metrics`) with the following metrics:

never mention the exact number when introducing a list, easier for maintenancce

# Stdout Log Generator

Small tool for generating logs to stdout, used in the e2e tests of the telemetry-manager.
A small tool that continuously writes log lines to stdout. Used in the e2e tests of telemetry-manager to produce configurable log traffic inside Kubernetes workloads.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
A small tool that continuously writes log lines to stdout. Used in the e2e tests of telemetry-manager to produce configurable log traffic inside Kubernetes workloads.
`stdout-log-generator` is a tool that continuously writes log lines to stdout. Telemetry Manager e2e tests use it to generate configurable log traffic inside Kubernetes workloads.

| `--format` | | `json` | Output format: `json` or `plaintext` |
| `--bytes` | `-b` | `2048` | Size of each log line in bytes |
| `--rate` | `-r` | `1` | Target log lines per second. `0` means unlimited |
| `--fields` | `-f` | | Additional key=value fields to include in every JSON log record (can be repeated or comma-separated). Ignored when `--format plaintext` is used |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

less ambiguity

Suggested change
| `--fields` | `-f` | | Additional key=value fields to include in every JSON log record (can be repeated or comma-separated). Ignored when `--format plaintext` is used |
| `--fields` | `-f` | | Additional key=value fields to include in every JSON log record. You can specify it multiple times or provide a comma-separated list. Ignored when `--format plaintext` is used |

| `--bytes` | `-b` | `2048` | Size of each log line in bytes |
| `--rate` | `-r` | `1` | Target log lines per second. `0` means unlimited |
| `--fields` | `-f` | | Additional key=value fields to include in every JSON log record (can be repeated or comma-separated). Ignored when `--format plaintext` is used |
| `--text` | `-t` | | Fixed text to write for every plaintext log line. Ignored if `--bytes` is set. Only relevant when `--format plaintext` is used |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `--text` | `-t` | | Fixed text to write for every plaintext log line. Ignored if `--bytes` is set. Only relevant when `--format plaintext` is used |
| `--text` | `-t` | | Fixed text to write for every plaintext log line. Applies only if you use `--format plaintext`. Ignored if you set `--bytes`. |


### Plaintext

Each line is either the fixed string given by `--text`, or a random string of `--bytes` length when `--text` is not set.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Each line is either the fixed string given by `--text`, or a random string of `--bytes` length when `--text` is not set.
The content of each line depends on whether you set the `--bytes` flag:
- With `--bytes`, each line is a random string of the specified length.
- Without `--bytes` but with `--text`, each line is the fixed string you provide.

### Plaintext

Each line is either the fixed string given by `--text`, or a random string of `--bytes` length when `--text` is not set.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if neither flag (--bytes or --text) is set? Random string with default byte size of 2048.


## Rate limiting

The tool uses a token-bucket rate limiter (`golang.org/x/time/rate`). On Linux, the minimum achievable sleep granularity is approximately 2 ms. To compensate, the burst size is set to `2 × (rate / 1000)` so that the generator can emit multiple logs back-to-back before sleeping, keeping the long-run average close to the requested rate even at high throughputs.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Splitting the sentence for clarity

Suggested change
The tool uses a token-bucket rate limiter (`golang.org/x/time/rate`). On Linux, the minimum achievable sleep granularity is approximately 2 ms. To compensate, the burst size is set to `2 × (rate / 1000)` so that the generator can emit multiple logs back-to-back before sleeping, keeping the long-run average close to the requested rate even at high throughputs.
The tool uses a token-bucket rate limiter (`golang.org/x/time/rate`). On Linux, the minimum achievable sleep granularity is approximately 2 ms. To compensate for this, the burst size is set to `2 × (rate / 1000)`. This setting lets the generator emit multiple logs back-to-back before sleeping, keeping the long-run average close to the requested rate even at high throughput.


The tool uses a token-bucket rate limiter (`golang.org/x/time/rate`). On Linux, the minimum achievable sleep granularity is approximately 2 ms. To compensate, the burst size is set to `2 × (rate / 1000)` so that the generator can emit multiple logs back-to-back before sleeping, keeping the long-run average close to the requested rate even at high throughputs.

Setting `--rate 0` disables throttling entirely (write as fast as possible).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

purpose first, then instruction

Suggested change
Setting `--rate 0` disables throttling entirely (write as fast as possible).
To disable throttling and write logs as fast as possible, set `--rate 0`.


### JSON (default)

Each line is a JSON object with a `padding` field filled with random characters to reach the requested byte size, plus any custom fields added via `--fields`:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Each line is a JSON object with a `padding` field filled with random characters to reach the requested byte size, plus any custom fields added via `--fields`:
Each line is a JSON object with a `padding` field filled with random characters to reach the requested byte size, plus any custom fields added with `--fields`:

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

Labels

kind/docs Categorizes issue or PR as related to a documentation change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants