Domain

Struct Domain 

Source
pub struct Domain {
    pub receiver_endpoint: String,
    pub receiver_socket: String,
    pub max_payload_size: usize,
    pub non_local_traffic: bool,
    pub dispatch_timeout: Duration,
}
Expand description

Resolved APM configuration.

Fields§

§receiver_endpoint: String

TCP address the v1.0 trace receiver listens on, as host:port.

Defaults to localhost:8127. An empty value disables the TCP listener; when the Unix domain socket is also disabled, enabling the APM pipeline is an error rather than a silent no-op. Binding a non-loopback address additionally requires non_local_traffic.

§receiver_socket: String

Unix domain socket path the v1.0 trace receiver listens on.

Defaults to empty, which disables the Unix domain socket listener. Set this for deployments where tracers share a filesystem with ADP but not a network namespace. Not subject to non_local_traffic, which governs TCP only.

§max_payload_size: usize

Maximum accepted v1.0 trace request body size, in bytes.

Defaults to 25 MB, matching the reference trace-agent. Requests over this size are rejected before any decoding, so this bounds peak memory per in-flight request. A value of 0 rejects every request and is not a way to disable the limit.

§non_local_traffic: bool

Whether the v1.0 trace receiver may bind a non-loopback TCP address.

Defaults to false: a receiver_endpoint whose host is not a loopback address is rejected at startup rather than quietly exposing the receiver. Set this to true when tracers run outside ADP’s network namespace, such as application containers reaching an agent container, and the port is not reachable from untrusted networks.

§dispatch_timeout: Duration

How long the receiver waits for the pipeline to accept a payload before refusing it.

Defaults to 1 second, matching the reference trace-agent’s apm_config.decoder_timeout. The receiver waits this long for memory-limiter capacity and for room in the queue feeding the decoder; past it, the payload is dropped and the tracer gets a refusal, so a stalled pipeline sheds load instead of holding tracer connections open indefinitely.

Raise this to tolerate longer downstream stalls at the cost of slower refusals; lower it to shed load sooner. A value of 0 refuses any payload the pipeline cannot accept immediately.

Implementations§

Source§

impl Domain

Source

pub fn validate_receiver_endpoint(&self) -> Result<(), Error>

Validates receiver_endpoint against the non-local traffic gate.

A disabled TCP listener, or an enabled non_local_traffic, permits anything. Otherwise the endpoint’s host must be a loopback address.

Only the host is examined. A host that is neither localhost nor a literal IP address cannot be shown to be loopback without resolving it, which startup validation does not do, so such a host is rejected while the gate is off.

§Errors

Returns an error when the TCP listener is enabled, non_local_traffic is false, and the configured host is not a loopback address.

Trait Implementations§

Source§

impl Clone for Domain

Source§

fn clone(&self) -> Domain

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Domain

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Domain

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for Domain

Source§

fn eq(&self, other: &Domain) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Domain

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for Domain

Source§

impl StructuralPartialEq for Domain

Auto Trait Implementations§

§

impl Freeze for Domain

§

impl RefUnwindSafe for Domain

§

impl Send for Domain

§

impl Sync for Domain

§

impl Unpin for Domain

§

impl UnwindSafe for Domain

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.