Skip to content

Commit a0b1d50

Browse files
committed
fix(pipeline): pin WASM-compatible trace normalization
Pre-2000 starts enter libdatadog's correction branch, where the prior revision called an unsupported standard clock and trapped in WASM.
1 parent 0831c0a commit a0b1d50

4 files changed

Lines changed: 40 additions & 26 deletions

File tree

Cargo.lock

Lines changed: 19 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/capabilities/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ http = "1"
1515
bytes = "1.4"
1616
futures-core = "0.3"
1717
anyhow = "1"
18-
libdd-capabilities = { git = "https://github.com/DataDog/libdatadog.git", rev = "0081bcbb1daffe04a6ac026cfbce3ba186ccce6c" }
18+
libdd-capabilities = { git = "https://github.com/DataDog/libdatadog.git", rev = "4e4cf372d4e461d43d9061324ecf60946d5dae53" }
1919

2020
[dev-dependencies]
2121
wasm-bindgen-test = "0.3"

crates/pipeline/Cargo.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ js-sys = "0.3"
1414
serde = { version = "1.0", features = ["derive"] }
1515
serde_json = "1"
1616
libdatadog-nodejs-capabilities = { path = "../capabilities" }
17-
libdd-capabilities = { git = "https://github.com/DataDog/libdatadog.git", rev = "0081bcbb1daffe04a6ac026cfbce3ba186ccce6c" }
18-
libdd-common = { git = "https://github.com/DataDog/libdatadog.git", rev = "0081bcbb1daffe04a6ac026cfbce3ba186ccce6c", default-features = false }
19-
libdd-data-pipeline = { git = "https://github.com/DataDog/libdatadog.git", rev = "0081bcbb1daffe04a6ac026cfbce3ba186ccce6c", default-features = false, features = ["agentless", "telemetry"] }
20-
libdd-trace-utils = { git = "https://github.com/DataDog/libdatadog.git", rev = "0081bcbb1daffe04a6ac026cfbce3ba186ccce6c", default-features = false, features = ["change-buffer"] }
21-
libdd-trace-stats = { git = "https://github.com/DataDog/libdatadog.git", rev = "0081bcbb1daffe04a6ac026cfbce3ba186ccce6c", default-features = false }
22-
libdd-trace-protobuf = { git = "https://github.com/DataDog/libdatadog.git", rev = "0081bcbb1daffe04a6ac026cfbce3ba186ccce6c", default-features = false }
23-
libdd-shared-runtime = { git = "https://github.com/DataDog/libdatadog.git", rev = "0081bcbb1daffe04a6ac026cfbce3ba186ccce6c", default-features = false }
17+
libdd-capabilities = { git = "https://github.com/DataDog/libdatadog.git", rev = "4e4cf372d4e461d43d9061324ecf60946d5dae53" }
18+
libdd-common = { git = "https://github.com/DataDog/libdatadog.git", rev = "4e4cf372d4e461d43d9061324ecf60946d5dae53", default-features = false }
19+
libdd-data-pipeline = { git = "https://github.com/DataDog/libdatadog.git", rev = "4e4cf372d4e461d43d9061324ecf60946d5dae53", default-features = false, features = ["agentless", "telemetry"] }
20+
libdd-trace-utils = { git = "https://github.com/DataDog/libdatadog.git", rev = "4e4cf372d4e461d43d9061324ecf60946d5dae53", default-features = false, features = ["change-buffer"] }
21+
libdd-trace-stats = { git = "https://github.com/DataDog/libdatadog.git", rev = "4e4cf372d4e461d43d9061324ecf60946d5dae53", default-features = false }
22+
libdd-trace-protobuf = { git = "https://github.com/DataDog/libdatadog.git", rev = "4e4cf372d4e461d43d9061324ecf60946d5dae53", default-features = false }
23+
libdd-shared-runtime = { git = "https://github.com/DataDog/libdatadog.git", rev = "4e4cf372d4e461d43d9061324ecf60946d5dae53", default-features = false }
2424
rmp-serde = "1"
2525
bytes = "1"
2626
http = "1"

test/pipeline.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,6 +1144,19 @@ describe('pipeline', { skip }, () => {
11441144
blocked: true,
11451145
value: 'encoded-struct',
11461146
})
1147+
1148+
const oldStartPayload = Buffer.from(ENCODED_TRACE_PAYLOAD)
1149+
const startMarker = Buffer.from('a57374617274cf', 'hex')
1150+
const startMarkerOffset = oldStartPayload.indexOf(startMarker)
1151+
assert.notStrictEqual(startMarkerOffset, -1)
1152+
const startOffset = startMarkerOffset + startMarker.length
1153+
oldStartPayload.writeBigUInt64BE(1_000_000_000n, startOffset)
1154+
1155+
await nativeSpans.state.sendEncodedTraces(oldStartPayload)
1156+
1157+
const normalized = JSON.parse(captured.body).traces[0].spans[0]
1158+
assert.strictEqual(Number.isInteger(normalized.start), true)
1159+
assert.ok(normalized.start >= 946_684_800)
11471160
} finally {
11481161
restoreEnv('DD_APM_REPLACE_TAGS', previousRules)
11491162
server.closeAllConnections?.()

0 commit comments

Comments
 (0)