Rust

transport

Module

[Transport]: how OTLP payloads reach a collector, and HttpTransport, the default.

Contents

use utopia_telemetry::HttpTransport;
Rust
pub struct HttpTransport

OTLP over HTTP/1.1 (TLS for https), reusing keep-alive connections from a pool.

A request that fails on a reused connection before any answer (the collector dropped the idle connection) is sent again once on a new one; a timeout is not, since the collector may have accepted it. A connection that failed, or got a 5xx answer, is closed.

Rust
use utopia_telemetry::{HttpTransport, Transport};

let transport = HttpTransport::new("http://collector:4318/v1/metrics")?
    .with_header("Authorization", "Bearer token");
assert_eq!(transport.content_type(), "application/x-protobuf");
Also implements Debug.
use utopia_telemetry::Transport;
Rust
pub trait Transport: Send + Sync

Sends encoded OTLP requests to a collector. Implement it to export another way (a test capture, a queue).

Implemented byHttpTransport