Repository navigation
Send metric handles with telemetry - #406
cataphract wants to merge 3 commits into
Conversation
Raw distribution payloads grow with traffic. Like libdatadog, telemetry will send DDSketches instead. This adds the sketch; it is not wired in.
A metric is registered once with typed tags, so recording a point builds, copies and hashes no tag strings. Nothing uses the handles yet.
Telemetry owns a registry of handles, created with counter::create, rate::create and distribution::create. Distributions go out as sketches.
BenchmarksBenchmark execution time: 2026-11-14 01:36:18 Comparing candidate commit 106be1f in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 8 metrics, 0 unstable metrics.
|
Overview
Makes
Telemetrysend the metric handles of #404.counter::create,rate::createanddistribution::createcreate a handle and register it with the runningTelemetry:The string-tagged functions still work. Nothing in dd-trace-cpp creates handles yet.
Stacked on #404.
Motivation
The handles of #404 record points, but nothing sends them. This PR connects them to the payloads:
generate-metricsas before.sketchespayload, at each heartbeat and inapp-closing. Each series carries its encoded sketch insketch_b64. As explained in Add a DDSketch-compatible distribution for telemetry #401,sketchesreplacesdistributions. The string-taggeddistribution::addstill sendsdistributionsuntil Replace the string-tagged metric functions with handles #407 removes it.Additional Notes
Telemetry, found through the global instance. A handle created while telemetry is not running records values that are never sent, so create handles aftertelemetry::init.Telemetryholds only weak references, as in Add a metric handle API for telemetry #404.sketch_b64is standard base64 with padding, which is what the intake's Go decoder (base64.StdEncoding) reads.base64_encodegives the same output as Go's encoder, and its output decodes with sketches-go.generate-metricsandsketches. The full suite passes.References
Jira ticket: APPSEC-70954
Contributor Checklist