pub struct HttpSinkConfig {
pub max_queue_bytes: usize,
pub hard_queue_bytes: usize,
pub max_in_flight_requests: usize,
pub request_timeout: Duration,
pub retry_by_priority: [Take<ExponentialBackoff>; 4],
}Expand description
Configuration for HttpEventSink’s transport: how much to buffer, how
aggressively to shed load under backpressure, how much concurrency to
allow, and how hard to retry each priority class.
The byte caps sit far above what a healthy co-located ingestion service (e.g. a monolith) will ever accumulate, so a normal run drops nothing; they only bite during a real outage.
Fields§
§max_queue_bytes: usizeSoft cap, in bytes: once the queue holds at least this many bytes,
new Traces items (thread and image blocks) are dropped. Default 128 MiB.
hard_queue_bytes: usizeHard cap, in bytes: once the queue holds at least this many bytes,
new Logs/Metrics items are dropped too. Clamped to be at least
max_queue_bytes. Metadata (process/stream) is never dropped.
Default 256 MiB.
max_in_flight_requests: usizeMaximum number of insert_* HTTP requests in flight at once. Set to
1 to restore strictly serial sends. Default 3.
request_timeout: DurationPer-request timeout (covers connect + send + receive for one attempt).
This is a deliberate addition beyond Unreal parity: Unreal’s
per-priority retry window is a total retry budget, not a socket
timeout (it never sets one either), so a single attempt against an
ingestion service that accepts the TCP connection but never responds
can hang indefinitely. Without a bound here, that hang is fatal at
shutdown: Drop for HttpEventSink joins the worker thread, so a
short-lived process would freeze on exit whenever ingestion is
unresponsive (as opposed to merely offline, which fails fast with a
connection error). Default 10 seconds.
retry_by_priority: [Take<ExponentialBackoff>; 4]Retry strategy per UploadPriority (indexed by
UploadPriority as usize).
Implementations§
Source§impl HttpSinkConfig
impl HttpSinkConfig
Sourcepub const DEFAULT_MAX_QUEUE_BYTES: usize
pub const DEFAULT_MAX_QUEUE_BYTES: usize
Default soft byte cap: 128 MiB.
Sourcepub const DEFAULT_HARD_QUEUE_BYTES: usize
pub const DEFAULT_HARD_QUEUE_BYTES: usize
Default hard byte cap: 256 MiB.
Sourcepub const DEFAULT_MAX_IN_FLIGHT_REQUESTS: usize = 3
pub const DEFAULT_MAX_IN_FLIGHT_REQUESTS: usize = 3
Default in-flight request cap (Unreal parity).
Sourcepub const DEFAULT_REQUEST_TIMEOUT: Duration
pub const DEFAULT_REQUEST_TIMEOUT: Duration
Default per-request timeout.
Sourcepub fn default_retry_by_priority() -> [Take<ExponentialBackoff>; 4]
pub fn default_retry_by_priority() -> [Take<ExponentialBackoff>; 4]
The default per-priority retry table: Metadata gets the most retries,
Traces the fewest, mirroring the Unreal sink’s
RetryCountByPriority ({10,5,2,1}).
Trait Implementations§
Source§impl Default for HttpSinkConfig
impl Default for HttpSinkConfig
Source§fn default() -> HttpSinkConfig
fn default() -> HttpSinkConfig
Auto Trait Implementations§
impl Freeze for HttpSinkConfig
impl RefUnwindSafe for HttpSinkConfig
impl Send for HttpSinkConfig
impl Sync for HttpSinkConfig
impl Unpin for HttpSinkConfig
impl UnsafeUnpin for HttpSinkConfig
impl UnwindSafe for HttpSinkConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].