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: StringTCP 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: StringUnix 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: usizeMaximum 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: boolWhether 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: DurationHow 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
impl Domain
Sourcepub fn validate_receiver_endpoint(&self) -> Result<(), Error>
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.