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],
)
| 286 | /// The `SharedState` holds a single `Arc<reqwest::Client>` that alert, |
| 287 | /// SIEM, and OTEL emitters all reuse — no per-call client construction. |
| 288 | pub 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 |