MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / export_trace_with_client

Function export_trace_with_client

nodedb/src/control/otel/exporter.rs:288–301  ·  view source on GitHub ↗

Public OTLP trace export using a caller-provided shared client. The `SharedState` holds a single `Arc ` that alert, SIEM, and OTEL emitters all reuse — no per-call client construction.

(
    client: &reqwest::Client,
    timeout: std::time::Duration,
    url: &str,
    spans_proto_bytes: &[u8],
)

Source from the content-addressed store, hash-verified

286/// The `SharedState` holds a single `Arc<reqwest::Client>` that alert,
287/// SIEM, and OTEL emitters all reuse — no per-call client construction.
288pub async fn export_trace_with_client(
289 client: &reqwest::Client,
290 timeout: std::time::Duration,
291 url: &str,
292 spans_proto_bytes: &[u8],
293) {
294 let _ = client
295 .post(url)
296 .header("content-type", "application/x-protobuf")
297 .timeout(timeout)
298 .body(spans_proto_bytes.to_vec())
299 .send()
300 .await;
301}
302
303// ── Helpers ──────────────────────────────────────────────────────────────
304

Callers 2

export_spanFunction · 0.85
assert_shapeFunction · 0.85

Calls 3

sendMethod · 0.45
headerMethod · 0.45
to_vecMethod · 0.45

Tested by 1

assert_shapeFunction · 0.68