Skip to content

fix(deploy): forward three-axis SDK env vars into fake-exporter container - #194

Merged
zzylol merged 1 commit into
mainfrom
diag/raw-buffer-bytes-check
Apr 23, 2026
Merged

zzylol merged 1 commit into
mainfrom
diag/raw-buffer-bytes-check

Conversation

@zzylol

@zzylol zzylol commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Root-cause fix for the suspiciously-low producer_bytes_out_per_s values I saw smoke-testing #193. base.yml was hard-coding EXPORTER_RATE=1000 and ignoring the new EXPORTER_SDK_* knobs from #190 — every cell of the sweep was silently running the SDK at its defaults (window=15s, agg=default, projection="") regardless of what the driver set in env.

Fix: switch the fake-exporter container's env block to \${VAR:-default} interpolation so sweep-time host env actually reaches the container.

Before / after (same cell: W=5s, card=50, freq=5, agg=raw-buffer, no gzip, 60s soak)

                        before     after
  sdk config logged   default/15s  raw-buffer/5s
  producer_bytes_out    1923 B/s   48546 B/s   ×25
  gateway_points_per_s   3.18      280.4
  backend_samples_per_s  2.91      247.9

48 KB/s matches the naive estimate (50 card × 5 Hz × 2 instruments × ~80 B/datapoint ≈ 40 KB/s). Before the fix the SDK was running Sum on the Counter instead — one data point per attribute set per 15s tick ≈ 7 pts/s, matching the low gateway rate.

Also adds a regression test

deploy/fake-exporter/sdk_emit_test.go runs a ManualReader + AggregationRawBuffer pipeline the same way main.go does, and asserts the data-point count equals cardinality × instruments × samples_each. This catches wiring-level mistakes (wrong Aggregation type reaching the SDK) that unit tests inside the aggregator package can't.

Test result:

=== RUN   TestRawBufferEmitsExpectedCount
    main_diag_test.go:85: metric=http_requests_total datapoints=150
    main_diag_test.go:85: metric=http_requests_total_latency_ms datapoints=150
--- PASS

Unblocks

The §6.2 a/b/c sub-sweeps can now run cleanly. Each one is ~15-20 min wall time:

  • 6.2a time: 4 W values × 180s soak → ~14 min
  • 6.2b label: 4 L values × 180s soak → ~14 min
  • 6.2c encoding: 6 agg types × 180s soak → ~21 min

🤖 Generated with Claude Code

…iner

base.yml was hard-coding EXPORTER_RATE=1000 and ignoring the new
EXPORTER_SDK_* knobs introduced in PR #190. Smoke-testing
run-three-axis-sweep.sh (#193) produced suspiciously-low
producer_bytes_out_per_s values because every cell of the sweep
was silently running the SDK at its defaults (window=15s,
agg=default, projection="") instead of the swept values.

Switches the fake-exporter container's environment block to
`${VAR:-default}` interpolation for every sweep-relevant knob so
the sweep driver's env assignments actually reach the container:

  EXPORTER_FREQ_HZ
  EXPORTER_SDK_WINDOW
  EXPORTER_SDK_PROJECTION
  EXPORTER_SDK_AGG
  EXPORTER_MAX_BUFFER_PER_SERIES

Legacy EXPORTER_RATE is kept but drops to empty by default so the
deprecation warning doesn't fire spuriously.

Before/after on the same cell (W=5s, card=50, freq=5,
agg=raw-buffer, no gzip, 60s soak):

                        before     after
  sdk config logged   default/15s  raw-buffer/5s
  producer_bytes_out    1923 B/s   48546 B/s  (×25)
  gateway_points_per_s   3.18      280.4
  backend_samples_per_s  2.91      247.9

48 KB/s matches the naive estimate (50 card × 5 Hz × 2 instruments
× ~80 B/datapoint ≈ 40 KB/s), confirming AggregationRawBuffer is
emitting the expected per-event stream. Before the fix, the SDK was
running Sum aggregation on the Counter instead — one data point per
attribute set per 15s tick = ~7 pts/s, which matches the low
gateway rate seen.

Also adds `deploy/fake-exporter/sdk_emit_test.go` as a regression
test for the aggregator contract: a ManualReader + AggregationRawBuffer
should emit exactly `cardinality × instruments × samples_each`
data points. This is the counterpart of the unit test in
opentelemetry-go-patch/sdk/metric/internal/aggregate/ but runs at
the MeterProvider+View level, catching wiring mistakes like the one
above.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@zzylol
zzylol merged commit 21fd869 into main Apr 23, 2026
@zzylol
zzylol deleted the diag/raw-buffer-bytes-check branch April 23, 2026 18:03
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