Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
144 changes: 90 additions & 54 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,18 @@ Node.js bindings for [libdatadog](https://github.com/DataDog/libdatadog).

This project is currently meant to be used only by [dd-trace-js](https://github.com/DataDog/dd-trace-js)
and installing it directly is not supported at the moment.

## Pipeline

`pipelineApiVersion` is `1` when the package provides encoded trace and agentless pipeline APIs. Consumers can inspect
this value without loading a native or WASM addon; an absent or older value must use the legacy pipeline.

`WasmSpanState#sendEncodedTraces(data)` accepts an owned `Uint8Array` containing a v0.4 MessagePack array32 payload.
It forwards the payload directly when no configured feature needs span objects. Native stats decode it for aggregation,
and alternate output formats decode it before transforming and sending it through the configured exporter.
Only one trace send may be active per state; an overlapping call rejects with an `already in flight` error.

`WasmSpanState#setAgentlessEndpoint(url, apiKey)` selects direct trace intake before the first send.
The binding reads obfuscation settings from Node.js `process.env` through its environment capability;
libdatadog normalizes and obfuscates spans before emitting JSON to the configured intake. Structured
AppSec metadata remains attached to the emitted spans.
2 changes: 1 addition & 1 deletion crates/capabilities/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ http = "1"
bytes = "1.4"
futures-core = "0.3"
anyhow = "1"
libdd-capabilities = { git = "https://github.com/DataDog/libdatadog.git", rev = "3081603d3c74f209be4e3be951f78a1a7469397f" }
libdd-capabilities = { git = "https://github.com/DataDog/libdatadog.git", rev = "4e4cf372d4e461d43d9061324ecf60946d5dae53" }

[dev-dependencies]
wasm-bindgen-test = "0.3"
4 changes: 4 additions & 0 deletions crates/capabilities/src/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ impl HttpClientCapability for WasmHttpClient {
Self
}

fn new_without_connection_pooling() -> Self {
Self
}

#[allow(clippy::manual_async_fn)]
fn request(
&self,
Expand Down
4 changes: 4 additions & 0 deletions crates/capabilities/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ impl HttpClientCapability for WasmCapabilities {
Self::new()
}

fn new_without_connection_pooling() -> Self {
Self::new()
}

fn request(
&self,
req: ::http::Request<::bytes::Bytes>,
Expand Down
Loading
Loading