Struct Open Telemetry Config
Generated from cargo doc --no-deps -p nemo-relay-builtins -p nemo-relay-diagnostics -p nemo-relay-logging -p nemo-relay-plugin-host -p nemo-relay-codecs -p nemo-relay -p nemo-relay-runtime -p nemo-relay-model-pricing -p nemo-relay-resource-metrics -p nemo-relay-observability -p nemo-relay-adaptive -p nemo-relay-pii-redaction -p nemo-relay-ffi -p nemo-relay-types -p nemo-relay-plugin -p nemo-relay-worker-proto -p nemo-relay-worker.
pub struct OpenTelemetryConfig {
pub shared: SharedTraceOptions,
pub automatic: bool,
pub endpoint: String,
pub transport: OtlpTransport,
pub headers: HashMap<String, String>,
pub header_env: HashMap<String, String>,
pub header_file: HashMap<String, String>,
pub tls: Option<Box<OpenTelemetryTlsConfig>>,
pub plaintext: PlaintextPolicy,
pub timeout: Duration,
}
Configuration for an OpenTelemetry subscriber exporting to a collector.
Fields
shared: SharedTraceOptions
automatic: bool
Whether the exporter takes its endpoint and protocol from OTEL_* vars.
endpoint: String
transport: OtlpTransport
headers: HashMap<String, String>
header_env: HashMap<String, String>
header_file: HashMap<String, String>
tls: Option<Box<OpenTelemetryTlsConfig>>
plaintext: PlaintextPolicy
timeout: Duration
Implementations
impl OpenTelemetryConfig
impl OpenTelemetryConfig
with_service_name
pub fn with_service_name(
self,
service_name: impl Into<String>,
) -> OpenTelemetryConfig
Sets the service.name resource attribute.
with_service_namespace
pub fn with_service_namespace(
self,
namespace: impl Into<String>,
) -> OpenTelemetryConfig
Sets the optional service.namespace resource attribute.
with_service_version
pub fn with_service_version(
self,
version: impl Into<String>,
) -> OpenTelemetryConfig
Sets the optional service.version resource attribute.
with_instrumentation_scope
pub fn with_instrumentation_scope(
self,
scope: impl Into<String>,
) -> OpenTelemetryConfig
Sets the instrumentation scope name.
with_resource_attribute
pub fn with_resource_attribute(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> OpenTelemetryConfig
Adds a resource attribute as a string key/value pair.
with_mark_projection
pub fn with_mark_projection(
self,
mark_projection: MarkProjection,
) -> OpenTelemetryConfig
Selects how point-in-time marks are represented.
with_mark_exclude_names
pub fn with_mark_exclude_names<I, S>(self, names: I) -> OpenTelemetryConfigwhere
I: IntoIterator<Item = S>,
S: Into<String>,
Replaces the mark names excluded from tool projection.
with_attribute_mapping
pub fn with_attribute_mapping(
self,
key: impl Into<String>,
alias: impl Into<String>,
) -> OpenTelemetryConfig
Copies a projected attribute to a second attribute name.
with_attribute_mappings
pub fn with_attribute_mappings<I>(self, mappings: I) -> OpenTelemetryConfigwhere
I: IntoIterator<Item = OtlpAttributeMapping>,
Replaces the projected attribute aliases.
with_promote_metadata_prefixes
pub fn with_promote_metadata_prefixes<I, S>(
self,
prefixes: I,
) -> OpenTelemetryConfigwhere
I: IntoIterator<Item = S>,
S: Into<String>,
Replaces the Event metadata prefixes copied to span attributes.
with_promote_resource_metadata_prefixes
pub fn with_promote_resource_metadata_prefixes<I, S>(
self,
prefixes: I,
) -> OpenTelemetryConfigwhere
I: IntoIterator<Item = S>,
S: Into<String>,
Replaces the root-scope metadata prefixes copied to resource attributes.
with_completed_span_context_ttl
pub fn with_completed_span_context_ttl(
self,
ttl: Duration,
) -> OpenTelemetryConfig
Sets how long completed scopes retain trace context for late marks.
impl OpenTelemetryConfig
impl OpenTelemetryConfig
with_endpoint
pub fn with_endpoint(self, endpoint: impl Into<String>) -> OpenTelemetryConfig
Overrides the OTLP endpoint. If unset, exporter defaults and OTEL_* env vars apply.
with_tls
pub fn with_tls(self, tls: OpenTelemetryTlsConfig) -> OpenTelemetryConfig
Sets the certificate and private key file paths for this endpoint.
with_transport
pub fn with_transport(self, transport: OtlpTransport) -> OpenTelemetryConfig
Selects the OTLP transport.
with_header
pub fn with_header(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> OpenTelemetryConfig
Adds a header/metadata entry for the exporter.
with_header_env
pub fn with_header_env(
self,
key: impl Into<String>,
variable: impl Into<String>,
) -> OpenTelemetryConfig
Maps an exporter header name to the environment variable supplying its value.
with_allow_insecure
pub fn with_allow_insecure(self, allow_insecure: bool) -> OpenTelemetryConfig
Allows plain HTTP to any host; data and configured headers travel unencrypted.
with_timeout
pub fn with_timeout(self, timeout: Duration) -> OpenTelemetryConfig
Sets the OTLP request timeout.
Trait Implementations
impl Clone for OpenTelemetryConfig
impl Clone for OpenTelemetryConfig
clone
fn clone(&self) -> OpenTelemetryConfig
clone_from
fn clone_from(&mut self, source: &Self)
impl Debug for OpenTelemetryConfig
impl Debug for OpenTelemetryConfig
fmt
fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>
impl Default for OpenTelemetryConfig
impl Default for OpenTelemetryConfig
default
fn default() -> OpenTelemetryConfig