Skip to content

Add a temporary seeded scenario generator receiver - #24

Open
zzylol wants to merge 1 commit into
refactor/asapv1-onlyfrom
feat/scenario-generator
Open

zzylol wants to merge 1 commit into
refactor/asapv1-onlyfrom
feat/scenario-generator

Conversation

@zzylol

@zzylol zzylol commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Part 2 of the RFC 0001 stack.

The official OpenTelemetry traffic generator cannot yet shape attribute cardinality, key popularity or value distributions, or change them over time: synthetic mode uses fixed value pools, and semantic_conventions mode sends every metric value as 1.0 (its TODO: "add configurable value range, distribution"). These options are planned upstream. Until then, this receiver stands in, with a config shaped like the upstream proposal so it can be swapped out.

What it does

urn:asap:receiver:scenario_generator sends Gauge points at signals_per_second, in max_batch_size batches, following the official generator's pacing and control handling.

config:
  seed: 1
  signals_per_second: 20000
  metric_name: http.server.request.duration
  attributes:
    - {key: http.route, cardinality: 200, zipf: 1.1}
    - {key: user.id, unique: true}
    - {key: k8s.pod.name, cardinality: 50, growth_per_minute: 0.05}
  value: {lognormal: {median: 50.0, sigma: 0.6}}
  changes:
    - {after_seconds: 600, attribute: http.route, equals: http.route-3,
       value: {lognormal: {median: 150.0, sigma: 0.6}}}
    - {after_seconds: 600, attribute: http.route, inject: /new/hot-route, share: 0.15}

Values are seeded, so a seed and config reproduce the same stream. Unique values include the seed, so two sources never share them.

Validation

Unit tests cover cardinality (fixed and unique), Zipf skew, changes after their time, and reproducibility. cargo fmt --check, cargo clippy --all-targets --features otap-engine,stream-benchmark -- -D warnings and cargo test --features otap-engine,stream-benchmark pass at this PR's head.

urn:asap:receiver:scenario_generator sends Gauge points whose attribute
cardinality (fixed, unique per source, growing), key popularity (uniform or
Zipf) and value distribution follow a config, with changes at set times: a
drifting series or a new heavy key. It stands in until the official OTAP
traffic generator gains these options.
@zzylol
zzylol force-pushed the feat/scenario-generator branch from 2059d27 to dac5fa3 Compare October 13, 2026 00:20
@zzylol
zzylol force-pushed the refactor/asapv1-only branch from 2bd3e0c to 974b425 Compare October 13, 2026 00:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant