Skip to navigation

Struct Open Telemetry LogConfig

View as Markdown

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 OpenTelemetryLogConfig {Show 21 fields
    pub endpoint: String,
    pub headers: HashMap<String, String>,
    pub header_env: HashMap<String, String>,
    pub header_file: HashMap<String, String>,
    pub tls: Option<OpenTelemetryTlsConfig>,
    pub plaintext: PlaintextPolicy,
    pub resource_attributes: HashMap<String, String>,
    pub service_name: Option<String>,
    pub promote_resource_metadata_prefixes: Vec<String>,
    pub service_namespace: Option<String>,
    pub service_version: Option<String>,
    pub instrumentation_scope: String,
    pub timeout: Duration,
    pub transport: OtlpTransport,
    pub minimum_severity: LogSeverity,
    pub max_queue_size: usize,
    pub max_export_batch_size: usize,
    pub scheduled_delay: Duration,
    pub completed_span_context_ttl: Duration,
    pub diagnostic_field: Option<String>,
    pub automatic: bool,
}

Configuration for an OTLP log subscriber.

Fields

endpoint: String

headers: HashMap<String, String>

header_env: HashMap<String, String>

header_file: HashMap<String, String>

tls: Option<OpenTelemetryTlsConfig>

plaintext: PlaintextPolicy

resource_attributes: HashMap<String, String>

service_name: Option<String>

promote_resource_metadata_prefixes: Vec<String>

service_namespace: Option<String>

service_version: Option<String>

instrumentation_scope: String

timeout: Duration

transport: OtlpTransport

minimum_severity: LogSeverity

max_queue_size: usize

max_export_batch_size: usize

scheduled_delay: Duration

completed_span_context_ttl: Duration

diagnostic_field: Option<String>

automatic: bool

Implementations

impl OpenTelemetryLogConfig

impl OpenTelemetryLogConfig

with_transport

pub fn with_transport(self, transport: OtlpTransport) -> OpenTelemetryLogConfig

Select the OTLP transport.

with_header

pub fn with_header(
    self,
    key: impl Into<String>,
    value: impl Into<String>,
) -> OpenTelemetryLogConfig

Add an exporter header or gRPC metadata entry.

with_header_env

pub fn with_header_env(
    self,
    key: impl Into<String>,
    variable: impl Into<String>,
) -> OpenTelemetryLogConfig

Map an exporter header name to the environment variable supplying its value.

with_allow_insecure

pub fn with_allow_insecure(self, allow_insecure: bool) -> OpenTelemetryLogConfig

Allows plain HTTP to any host; data and configured headers travel unencrypted.

with_tls

pub fn with_tls(self, tls: OpenTelemetryTlsConfig) -> OpenTelemetryLogConfig

Sets the certificate and private key file paths for this endpoint.

with_resource_attribute

pub fn with_resource_attribute(
    self,
    key: impl Into<String>,
    value: impl Into<String>,
) -> OpenTelemetryLogConfig

Add an OpenTelemetry resource attribute.

with_promote_resource_metadata_prefixes

pub fn with_promote_resource_metadata_prefixes<I, S>(
    self,
    prefixes: I,
) -> OpenTelemetryLogConfigwhere
    I: IntoIterator<Item = S>,
    S: Into<String>,

Promote matching root-scope Event metadata to OTLP resource attributes.

with_service_name

pub fn with_service_name(
    self,
    service_name: impl Into<String>,
) -> OpenTelemetryLogConfig

Set the service.name resource attribute.

with_service_namespace

pub fn with_service_namespace(
    self,
    namespace: impl Into<String>,
) -> OpenTelemetryLogConfig

Set the optional service.namespace resource attribute.

with_service_version

pub fn with_service_version(
    self,
    version: impl Into<String>,
) -> OpenTelemetryLogConfig

Set the optional service.version resource attribute.

with_instrumentation_scope

pub fn with_instrumentation_scope(
    self,
    scope: impl Into<String>,
) -> OpenTelemetryLogConfig

Set the instrumentation scope name.

with_timeout

pub fn with_timeout(self, timeout: Duration) -> OpenTelemetryLogConfig

Set the OTLP request timeout.

with_minimum_severity

pub fn with_minimum_severity(
    self,
    severity: LogSeverity,
) -> OpenTelemetryLogConfig

Set the minimum mark severity exported as a log.

with_max_queue_size

pub fn with_max_queue_size(
    self,
    max_queue_size: usize,
) -> OpenTelemetryLogConfig

Set the maximum queued log records.

with_max_export_batch_size

pub fn with_max_export_batch_size(
    self,
    max_export_batch_size: usize,
) -> OpenTelemetryLogConfig

Set the maximum records in one export batch.

with_scheduled_delay

pub fn with_scheduled_delay(self, delay: Duration) -> OpenTelemetryLogConfig

Set the maximum delay before exporting a partial batch.

with_completed_span_context_ttl

pub fn with_completed_span_context_ttl(
    self,
    ttl: Duration,
) -> OpenTelemetryLogConfig

Sets how long completed scopes retain log parent context for late marks.

The value must be greater than zero. Subscriber construction fails with OpenTelemetryError::ExporterBuild when the TTL is zero.

Trait Implementations

impl Clone for OpenTelemetryLogConfig

impl Clone for OpenTelemetryLogConfig

clone

fn clone(&self) -> OpenTelemetryLogConfig

clone_from

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

impl Debug for OpenTelemetryLogConfig

impl Debug for OpenTelemetryLogConfig

fmt

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