feat(profiling): surface native-heap partition arming via dogstatsd gauge + warning - #19376
Conversation
Codeowners resolved as |
Circular import analysis
|
|
…auge + warning The native-heap ownership-partition arming decision was only observable via a one-shot stdlib INFO log, which real deploys drop (structured JSON loggers filter ddtrace stdlib records) and pods/exec is RBAC-blocked, so armed=true|false could not be confirmed at runtime. Surface the decision two ways at service start (gated on native-heap being enabled, so the default majority of processes stay silent): - emit a dogstatsd gauge profiling.native_heap.partition_armed (1=armed, 0=not) via the canonical internal client; fail-safe if the client is unavailable - upgrade the existing INFO arming line to WARNING (same fields)
…vability Annotate the arming-observability additions: the _NATIVE_HEAP_SIZE_THRESHOLD_BYTES / _NATIVE_HEAP_PARTITION_ARMED_METRIC module globals and the _emit_native_heap_partition_armed_gauge local (profiler.py), plus the locals in the new dogstatsd-gauge/WARNING tests.
8c9f8bc to
ba29a15
Compare
fa3b058 to
2f180af
Compare
|
Closing: the deterministic ownership-handoff integration test (test_native_heap_ownership_handoff_end_to_end on #19349) proves Phase-2 partition arming without needing the dogstatsd gauge. Arming is also confirmable via eBPF on covered nodes. The stdlib INFO log was already invisible in JSON-logging setups; this metric was a workaround for that observability gap, superseded by the CI proof. |
|
Closing rationale (recorded for the stack): superseded by the deterministic ownership-handoff integration test on #19349 ( The arming observability metric was draft/pending keep-or-close; closing it as redundant with the CI proof. If we still want prod dogfooding visibility later, we can revisit as optional follow-up work. |
Stack: A — cdylib/build (#19078) ← B — activation (#19079) ← C — live-heap (#19325) ← Phase 2 — ownership partition (#19349) ← F — arming observability (this PR).
Prev: #19349 (base of this PR).
Description
Target 1 of the native-heap observability follow-ups: make the ownership-partition arming decision confirmable at runtime.
Today the decision is emitted only as a one-shot stdlib
LOG.info(...)inprofiler._start_service. In real deploys the app's structured JSON logger drops ddtrace stdlib records andpods/execis RBAC-blocked, soarmed=true|falseis unconfirmable at runtime — which blocks Phase 2 A/B validation.This surfaces the decision two ways at service start, gated on native-heap profiling being enabled so the default majority of processes (which never enable it) stay completely silent — no new WARNING/metric noise:
profiling.native_heap.partition_armed—1when armed,0when not. Tags:domains:OBJ_MEM,size_threshold_bytes:512. Emitted via the canonical internal client (get_dogstatsd_client(agent_config.dogstatsd_url)), the same accessorruntime_metrics/writeruse.LOG.warning(...)with the same fields (armed=<bool> size_threshold_bytes=512 domains=OBJ|MEM) so it survives deploys whose JSON loggers filter ddtrace INFO records.Emission is one-shot at
_start_service(never on a hot path) and fail-safe: if the dogstatsd client is unavailable/raises, the error is swallowed (LOG.debug) and arming/startup is unaffected.Out of scope (separate follow-up): the
DD_PROFILING_NATIVE_HEAP_ENABLEDconfig registration, which collides on append-only config files.Testing
tests/profiling/test_native_heap_gotter.py(run via therun-testsskill / riotprofilevenv, py3.13):1+ WARNING logged witharmed=True0+ WARNING witharmed=FalseRisks
Low. The WARNING/gauge only emit when
DD_PROFILING_NATIVE_HEAP_ENABLED=true; the default path is byte-for-byte silent as before. The gauge is best-effort and cannot break profiler startup.Additional Notes
No release note: native-heap profiling is behind unmerged/unreleased stacked PRs, so this is observability for a not-yet-released feature (
changelog/no-changelog).