Skip to content

feat: SDK pipeline configuration files (sketch type, transmit_sketch, instruments, ASAPQuery integration) - #55

Merged
zzylol merged 5 commits into
mainfrom
SDK-transmit-mode
Mar 19, 2026
Merged

zzylol merged 5 commits into
mainfrom
SDK-transmit-mode

Conversation

@zzylol

@zzylol zzylol commented Mar 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add YAML configuration files to opentelemetry-app/ for the full SDK→collector pipeline, one per sketch type plus a raw-gauge baseline
  • Expose sketch.transmit_sketch as a first-class config knob: true = SDK pre-aggregates into a sketch payload; false = SDK emits raw gauges and the collector-side processor aggregates
  • Cover all supported sketch types: DDSketch, KLL, HLL, CountSketch, CountMinSketch, and a baseline (no sketch)
  • Add an asap_query block that mirrors the ControllerConfig schema from asap-planner-rs PR #174 — metrics, query_groups (with accuracy_sla / latency_sla), and sketch_parameters — so the same config can be consumed by asap-planner-rs directly
  • Replace the current pattern of scattered CLI flags with structured YAML sections: exporter, reader, sketch, instruments, load

Files

File Sketch transmit_sketch
config.yaml DDSketch (base template) true
config-ddsketch.yaml DDSketch true
config-kll.yaml KLL true
config-hll.yaml HLL true
config-countminsketch.yaml CountMinSketch true
config-countsketch.yaml CountSketch true
config-baseline.yaml none (raw gauge) false

Schema highlights

  • sketch.transmit_sketch — controls SDK-side vs collector-side aggregation path
  • instruments[].group_by — attribute keys that form the sketch dimension (maps to --series-per-sketch and attribute labels in the existing apps)
  • instruments[].series_per_sketch — 1=per-series, 0=all-in-one, N=matrix grouping
  • asap_query.sketch_parameters — uses the same key names as SketchParameterOverrides in asap-planner-rs (DatasketchesKLL, CountMinSketch, etc.)
  • exporter.max_send_msg_size_mb: 64 included by default (required for HLL/CountSketch at scale)

Test plan

  • Verify each config YAML parses correctly when wired into fakemetricload / e2esdkbench
  • Confirm transmit_sketch: true configs produce sketch-typed OTLP data points at the collector
  • Confirm config-baseline.yaml (transmit_sketch: false) produces raw gauge data points
  • Validate asap_query block round-trips into asap-planner-rs ControllerConfig

🤖 Generated with Claude Code

zzylol and others added 4 commits March 18, 2026 19:27
Introduce YAML config files for the opentelemetry-app SDK pipeline,
covering all supported sketch types (DDSketch, KLL, HLL, CountSketch,
CountMinSketch) and a raw-gauge baseline. Each config exposes:
- sketch.type and sketch.transmit_sketch (SDK-side vs collector-side aggregation)
- per-sketch tuning parameters (k, relative_accuracy, rows/cols, etc.)
- instruments block: which metrics to aggregate, group_by label keys, series_per_sketch
- asap_query block: mirrors ControllerConfig from asap-planner-rs (PR #174)
  with metrics, query_groups (accuracy_sla / latency_sla), and sketch_parameters
- exporter, reader, and load generation knobs (replaces scattered CLI flags)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Document the new config.yaml / config-<sketch>.yaml files:
- transmit_sketch semantics (SDK-side vs collector-side aggregation)
- full config schema with all sections (exporter, reader, sketch, instruments,
  asap_query, load)
- per-file table mapping sketch type to transmit_sketch value
- asap_query block note linking to asap-planner-rs ControllerConfig schema

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Wire the YAML pipeline config files into the SDK and app layer.

opentelemetry-go-patch/sdk/metric/pipelineconfig.go (new):
- PipelineConfig struct hierarchy matching the YAML schema
- LoadPipelineConfig(path) — reads and unmarshals the YAML file
- ToAggregation() — maps sketch.type + params to AggregationXxx
- ToViews() — builds Views from instruments[] when transmit_sketch:true;
  returns nil for baseline / transmit_sketch:false
- ReaderInterval() — returns reader.interval with a 1s default

opentelemetry-go-patch/sdk/metric/go.mod:
- Promote go.yaml.in/yaml/v2 from indirect to direct dependency

opentelemetry-app/cmd/fakemetricload/main.go:
opentelemetry-app/cmd/e2esdkbench/main.go:
- Add --config flag; LoadPipelineConfig() propagates YAML values into
  existing flag variables (fully backward compatible — CLI-only usage
  unchanged)
- Provider construction uses pipelineCfg.ToViews() when config is
  loaded, so transmit_sketch is config-file driven

opentelemetry-app/.gitignore:
- Anchor binary patterns (/fakemetricload, /e2esdkbench) so they no
  longer accidentally ignore the cmd/ source directories

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
20 tests covering all three public methods and LoadPipelineConfig:

LoadPipelineConfig: parses DDSketch, KLL, HLL, CountSketch,
CountMinSketch, baseline, and ASAPQuery blocks; errors on missing
file and invalid YAML.

ToAggregation: table-driven across all 7 sketch types (including
baseline and unknown → nil).

ToViews: transmit_sketch:true returns one View per instrument;
transmit_sketch:false returns nil; baseline returns nil regardless
of transmit_sketch; no instruments returns empty slice.

ReaderInterval: configured value, unset default (1s), zero default (1s).

All 20 tests pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@zzylol

zzylol commented Mar 19, 2026

Copy link
Copy Markdown
Contributor Author

closes #56

fakemetricload: add baseline mode
- Valid sketch types now: ddsketch|kll|countsketch|countminsketch|hll|baseline
- baseline sets delivery=sdkGauge (raw LastValue gauge, no sketch view)

e2esdkbench: add countsketch and countminsketch modes
- Valid sketch types now: ddsketch|kll|hll|countsketch|countminsketch|baseline
- countsketch uses AggregationCountSketch{Epsilon, Delta}
- countminsketch uses AggregationCountMinSketch{Rows, Cols}
- Flags for both (--countsketch-epsilon/delta, --countmin-rows/cols) were
  already present; only the validation switch and aggregation cases were missing

Both binaries now support the full set of modes symmetrically.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@zzylol
zzylol merged commit bc51fb4 into main Mar 19, 2026
@zzylol
zzylol deleted the SDK-transmit-mode branch March 19, 2026 00:55
SieDeta pushed a commit that referenced this pull request Apr 17, 2026
feat: SDK pipeline configuration files (sketch type, transmit_sketch, instruments, ASAPQuery integration)
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