-
Notifications
You must be signed in to change notification settings - Fork 406
feat(native-spans): native span pipeline via libdatadog wasm #9139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
bengl
wants to merge
170
commits into
master
Choose a base branch
from
bengl/native-spans-attempt-3
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 153 commits
Commits
Show all changes
170 commits
Select commit
Hold shift + click to select a range
e999e87
feat(native-spans): add native subsystem (WASM pipeline + interface +…
bengl 8ac997a
feat(native-spans): integrate native mode into tracer, span processor…
bengl 8709a90
test(native-spans): add unit + integration specs
bengl dc06728
chore(native-spans): benchmarks and test env hygiene
bengl 535cde6
refactor(native-spans): require @datadog/libdatadog; remove JS pipeline
bengl f6a11e7
fix(native-spans): publish first-flush channel from native exporter
bengl 16bfa63
fix(config): drop dead OTLP-protocol-mismatch override
bengl 1897881
chore(native-spans): scrub dangling span_format.js comment refs
bengl d214d24
fix(native-spans): forward sampling-decision metrics to native exporter
bengl 8ce7eda
fix(native-spans): emit single-span ingestion tags from SpanSampler
bengl d7c9084
fix(native-spans): re-register extra services during span processing
bengl 0f3420c
refactor(config): remove dead _DD_APM_TRACING_AGENTLESS_ENABLED knob
bengl 1185e61
refactor(native-spans): drop async/await in flushSpans
bengl 1326740
fix(native-spans): restore _dd.tags.process emission on local root span
bengl 23e97fc
feat(native-spans): set _dd.measured when span.kind is non-internal
bengl c1fef97
fix(native-spans): restore tag coercion parity with legacy formatter
bengl f3cde7c
fix(native-spans): feed agent sampling rates back into priority sampler
bengl d67328b
feat(native-spans): migrate native layer from slot-index to span_id p…
bengl 18c8f6f
feat(native-spans): forward meta_struct to native storage
bengl 1affd4b
feat(native-spans): route unix socket and named-pipe agent URLs natively
bengl f454175
feat(native-spans): emit exporter health metrics on the native path
bengl 73ce1c0
feat(native-spans): forward span_events to the native top-level field
bengl 730b231
feat(native-spans): add v0.5 output negotiation to the native exporter
bengl 729fecc
fix(native-spans): address Codex review — otel error guard, tag-updat…
bengl 6ce033b
fix(native-spans): address Codex re-review — LE span-id fold, 128-bit…
bengl 5416a35
feat(native): export traces via OTLP when OTEL_TRACES_EXPORTER=otlp
bengl 25b23e4
refactor(native): tighten OTLP config wiring
bengl 0c5f157
fix(native): stop the exporter on a fatal libdatadog build error
bengl 3f58bfc
chore(deps): bump @datadog/libdatadog to 0.11.0
bengl 39a0f74
chore: merge master into bengl/native-spans-attempt-3
bengl cd9b24c
chore(config): regenerate config types after master merge
bengl c67e070
chore(deps): bump @datadog/libdatadog to 0.12.1
bengl a1976b6
fix(native): refresh change-buffer views at queue-write entry
bengl 1d70bef
fix(native): tolerate "span not found" instead of crashing the host
bengl 2180c7f
fix(native): preserve the change queue when a span send fails
bengl 4c2fcd2
fix(native): send one chunk per trace so multi-trace flushes stay cor…
bengl 1a8175c
chore(deps): bump @datadog/libdatadog to 0.12.2
bengl 7b8fabc
chore: merge master into bengl/native-spans-attempt-3
bengl 989d775
bench(native-spans): port benches to span_id protocol, retire exporti…
bengl a757f57
style(native): satisfy comma-dangle and padded-blocks lint
bengl 6976e05
test: accept POST /v0.x/traces in the plugin test agent
bengl e1cd69f
fix(native): dispatch batched addTags to the native span
bengl 0b2b6f8
fix(native): read span ids via toBuffer so parent_id survives export
bengl d0f4210
test: backfill error: 0 for native spans in the plugin test agent
bengl 6e0df34
feat(native): apply OTel HTTP semantics on the native span path
bengl 949b5aa
fix(ci-visibility): restore the JS pipeline for Test Optimization
bengl a275009
chore: merge master into bengl/native-spans-attempt-3
bengl 73a2a89
fix(bundlers): externalize @datadog/libdatadog for esbuild and webpack
bengl b6cdadf
fix(native): mirror a pre-set sampling priority to the native span
bengl dd31960
fix(native): sync trace propagation tags (_dd.p.tid) to the native span
bengl 2d5ac44
test: accept POST /v0.4/traces in the integration-test FakeAgent
bengl d7febf6
fix(native): pin span start time so the wire start matches _startTime
bengl ad2c357
fix(native): create the native stats collector when stats computation…
bengl 9edf5f1
test(llmobs): read service from the top-level span field
bengl c76dab4
test(bundlers): resolve @datadog/libdatadog in the openfeature reloca…
bengl 5250691
test: expect native-init debug lines in the forced-runtime init tests
bengl 4631b64
fix(native): omit undefined-valued keys when msgpack-encoding
bengl 78481bb
fix(native): default native span events on so span_events is exported
bengl e1716a9
chore(deps): bump @datadog/libdatadog to 0.13.0 and send client-compu…
bengl 82457b6
fix(native): sync trace tags after git metadata so _dd.git.* is exported
bengl dff52c1
fix(native): default a span's resource to its operation name
bengl 3f8b33c
fix(native): log the exported payload in debug for parity
bengl 8d5401c
fix(native): match the JS formatter for bare service + error-shaped tags
bengl ed37238
test: backfill parent_id:0 in the plugin test agent
bengl 0cafbb8
fix(native): send one payload per trace at flushInterval:0
bengl ce56432
fix(native): stamp language and _dd.origin like the JS formatter
bengl 063111c
fix(native): coerce the operation name so an undefined name can't crash
bengl 4edc3bc
style: fix import order and an over-long test title
bengl 47bfd6e
fix(native): flip the error bit for error.message / error.stack
bengl 4fcb12a
fix(native): don't inherit the global version on a different-service …
bengl 1672e59
test(llmobs): expect the base service, not the schematized service name
bengl d6be43b
fix(native): make trace.tags the single source of _dd.p.dm
bengl baa753b
fix(native): expose a _writer.flush shim on the native exporter
bengl 13319cb
fix(native): flatten span-event array attributes into indexed scalar …
bengl 6bbf0c8
fix(native): restore OTLP span metrics
bengl b88c830
test(http2): bind the live tracer from agent.load so manual spans don…
bengl 340be70
style(native): satisfy lint in span-event encoder and operation-name …
bengl 633d292
fix(mongodb-core): sync peer.service to native so the DBM comment mat…
bengl 500404f
test: decode native top-level span_events in unformatSpanEvents
bengl 2f88b66
Merge remote-tracking branch 'origin/master' into bengl/native-spans-…
bengl 2f5bb9c
chore(deps): bump @datadog/libdatadog to 0.14.0
bengl 2ba8153
fix(native-spans): stop syncing tags to native after a span is exported
bengl b49d593
fix(native-spans): strip nulls from meta_struct to match the legacy e…
bengl 393dbb3
fix(native-spans): satisfy eslint (no-useless-undefined, no-private-t…
bengl a34eb7a
feat(native-spans): expose a force stats-flush for the parametric sta…
bengl ce7d5a2
chore(deps): bump @datadog/libdatadog to 0.15.0
bengl 8bd434d
ci(system-tests): pin system-tests ref to the native stats-flush branch
bengl 55f6668
fix(native-spans): typed array span-event attrs + `events` tag fallback
bengl 5c26f9e
chore(codeowners): own native-spans files (lang-platform-js)
bengl dc41800
fix(native-spans): route the electron exporter through the JS pipeline
bengl dd7bfa4
fix(native-spans): publish first-flush on send attempt, not success
bengl 3a9a1b1
test(init): gate native-init debug lines on a supported runtime
bengl 8031d49
chore(deps): bump @datadog/libdatadog to 0.16.0
bengl 5fab654
fix(native-spans): report JavaScriptCore interpreter under Bun
bengl c17c51e
fix(native-spans): force-flush client stats via _writer.flush shim
bengl 2cfc06a
fix(native-spans): suppress native v0.6 stats when OTLP trace metrics…
bengl 5d778b1
test(native-spans): accept any truthy Datadog-Client-Computed-Stats v…
bengl e13a103
fix(native-spans): add setTag to mongodb benchmark stub span
bengl 996aa6a
fix(native-spans): default DD_TRACE_NATIVE_SPAN_EVENTS back to false
bengl f399674
fix(native-spans): add trailing comma in _writer shim (lint)
bengl 007b8c8
fix(native-spans): stamp process tags before export
bengl 80da20c
test(test-optimization): accept native trace POSTs
bengl daaeaef
Merge remote-tracking branch 'origin/master' into bengl/native-spans-…
bengl fcb3902
fix(native-spans): emit collapsed stats health metric
bengl 37c0314
Merge remote-tracking branch 'origin/master' into bengl/native-spans-…
bengl 94cc3ee
chore(codeowners): own JS span processor
bengl 6aec7c3
test(aerospike): target native-batched command spans
bengl 324273b
chore(native): bump libdatadog to 0.17.0
bengl e02d720
Merge remote-tracking branch 'origin/master' into bengl/native-spans-…
bengl f2129aa
test(opentelemetry): read native exports in next span naming spec
bengl fd17aa8
bench(sirun): bound native benchmark runtime
bengl 9c59e4e
test(aerospike): close agent between config suites
bengl 7c1b0b0
fix(native): bump libdatadog to 0.18.0
bengl 1827feb
perf(native): reduce addTags overhead
bengl 2a0dcd1
perf(native): reduce processor flush overhead
bengl 5e27669
style(native): fix span lint failures
bengl 059671d
ci: update serverless benchmark ref
bengl f10468c
fix(native): replay error meta at export
bengl 47614d9
fix(native): wait for in-flight sends during flush
bengl db6a3c9
perf(native): avoid batch arrays for setTag
bengl 72cf390
fix(native): bump libdatadog to 0.18.1
bengl 4d1e86f
fix(native): flush pending spans before setUrl
bengl b9f433e
merge master into native spans
bengl bf4c846
fix(native): defer setUrl until active spans drain
bengl a1bdbac
test(native): cover wasm memory growth view refresh
bengl c74fd33
fix(aerospike): preserve callback parent context
bengl 36032cc
ci: restore serverless benchmark ref
bengl 6db723c
fix(openfeature): register feature from bootstrap
bengl 2d43162
fix(native): keep libdatadog optional
bengl b1ba53c
fix(native): use js spans in aws lambda
bengl f625bb5
Merge remote-tracking branch 'origin/master' into native spans
bengl 8ad4ec6
fix(native): preserve JS fallback and chunk boundaries
bengl ab8ccdc
fix(native-spans): harden native span cleanup
bengl 5cb4811
fix(bench): restore native span drain helper
bengl 2ea449e
Merge remote-tracking branch 'origin/master' into bengl/native-spans-…
bengl 41805d1
test(native-spans): align tracing specs with final sync
bengl ed328a9
test(native-spans): fix lint and windows ci validation
bengl ab8472b
Merge remote-tracking branch 'origin/master' into bengl/native-spans-…
bengl 5c80167
ci(native-spans): harden benchmark dependency install
bengl 5419f3b
ci(native-spans): bypass proxy for benchmark registry fetches
bengl 9346fe9
ci(native-spans): pass benchmark proxy bypass downstream
bengl ce2b703
ci(native-spans): harden serverless benchmark installs
bengl eb9dc11
ci(native-spans): use npm registry for serverless benchmark
bengl cced1e7
fix(native-spans): correct flush protocol and WASM reclamation
bengl 0d5b587
fix(native-spans): send one request per trace chunk again
bengl 8cb759d
fix(native-spans): let an explicit agent exporter win in a Lambda
bengl 25364a4
fix(native-spans): restore the parent commit's payload composition
bengl b52ea60
fix(native-spans): reset the export path to the last green state
bengl b092cfd
fix(native-spans): honour a custom DNS lookup by using the JS pipeline
bengl 9e5b16d
fix(native-spans): stop registering the primary service as an extra s…
bengl 7e706a5
fix(native-spans): drop span events with a non-string name
bengl 25d2a94
fix(native-spans): apply sampling rates from every request in a flush
bengl 3786df7
fix(native-spans): restore container-tag hash updates on agent responses
bengl 956052e
fix(native-spans): keep OTLP export when a custom lookup is configured
bengl e6dfb9f
fix(opentelemetry): guard forceFlush for exporters without flush
bengl 78201a7
fix(native-spans): normalize core span fields before native export
bengl 3f3148e
fix(native-spans): keep OTLP span events on the native event slot
bengl bca8cc8
perf(native-spans): reduce change-buffer writes
bengl 3b2aeab
perf(native-spans): fast sync primitive tags
bengl 429a2c1
refactor(native-spans): simplify native pipeline
bengl fdffe88
bench(native-spans): use JS exporting processor
bengl edcaa00
bench(native-spans): support baseline benchmark source
bengl 93e1e27
refactor(native-spans): simplify span processing
bengl 240baef
perf(native-spans): bound exporter batching
BridgeAR d0eb020
perf(native-spans): reuse trace ID bytes
BridgeAR f6da51c
perf(native-spans): keep context shapes stable
BridgeAR 5629dd2
fix(native-spans): preserve long resource names
BridgeAR 56f9631
fix(native-spans): preserve base service in fast sync
BridgeAR cbf2cbf
bench(spans): discard native mutations before processing
BridgeAR a127870
test(native-spans): reuse existing test contracts
bengl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| 'use strict' | ||
|
|
||
| const DEFAULT_DRAIN_THRESHOLD = 5000 | ||
|
|
||
| function createNativeSpanDrain (tracer, threshold = DEFAULT_DRAIN_THRESHOLD) { | ||
| const nativeSpans = tracer._tracer._nativeSpans | ||
| const pendingSpanIds = nativeSpans ? [] : null | ||
|
|
||
| function add (span) { | ||
| if (pendingSpanIds) { | ||
| pendingSpanIds.push(span.context()._nativeSpanId) | ||
| } | ||
| } | ||
|
|
||
| function addAll (spans) { | ||
| if (!pendingSpanIds) return | ||
|
|
||
| for (const span of spans) { | ||
| pendingSpanIds.push(span.context()._nativeSpanId) | ||
| } | ||
| } | ||
|
|
||
| async function drain () { | ||
| if (!pendingSpanIds || pendingSpanIds.length === 0) return | ||
|
|
||
| nativeSpans.flushChangeQueue() | ||
|
|
||
| const spanIds = Buffer.allocUnsafe(pendingSpanIds.length * 8) | ||
| let offset = 0 | ||
| for (const spanId of pendingSpanIds) { | ||
| spanIds.set(spanId, offset) | ||
| offset += 8 | ||
| } | ||
|
|
||
| nativeSpans._state.prepareChunk(pendingSpanIds.length, false, spanIds) | ||
| await nativeSpans._state.sendPreparedChunk().catch(() => {}) | ||
| pendingSpanIds.length = 0 | ||
| } | ||
|
|
||
| function needsDrain () { | ||
| return pendingSpanIds && pendingSpanIds.length >= threshold | ||
| } | ||
|
|
||
| return { add, addAll, drain, needsDrain } | ||
| } | ||
|
|
||
| module.exports = { createNativeSpanDrain } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the
spansandplugin-redis-tracedbenchmarks, this array contains thousands of independently created root spans, each with a different native segment, but it is passed to oneprepareChunkcall. The native flush contract innative_spans.jsrequires each prepared group to contain exactly one trace/segment; combining them applies one segment's chunk handling to unrelated traces and then clears every ID from the helper, so native state may not be reclaimed correctly and the measured memory/time results are invalid. Group IDs by trace segment and prepare each group separately.Useful? React with 👍 / 👎.