Skip to navigation

Struct Open Telemetry Metric Config

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 OpenTelemetryMetricConfig {Show 20 fields
    pub endpoint: String,
    pub headers: HashMap<String, String>,
    pub header_env: HashMap<String, String>,
    pub header_file: HeaderFiles,
    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 export_interval: Duration,
    pub temporality: MetricTemporality,
    pub max_instruments: usize,
    pub cardinality_limit: usize,
    pub diagnostic_field: Option<String>,
    pub automatic: bool,
}

Configuration for an OTLP metric subscriber.

Fields

endpoint: String

headers: HashMap<String, String>

header_env: HashMap<String, String>

header_file: HeaderFiles

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

export_interval: Duration

temporality: MetricTemporality

max_instruments: usize

cardinality_limit: usize

diagnostic_field: Option<String>

automatic: bool

Implementations

impl OpenTelemetryMetricConfig

impl OpenTelemetryMetricConfig

with_transport

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

Select the OTLP transport.

with_header

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

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>,
) -> Self

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

with_allow_insecure

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

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

with_tls

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

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>,
) -> Self

Add an OpenTelemetry resource attribute.

with_promote_resource_metadata_prefixes

pub fn with_promote_resource_metadata_prefixes<I, S>(self, prefixes: I) -> Selfwhere
    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>) -> Self

Set the service.name resource attribute.

with_service_namespace

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

Set the optional service.namespace resource attribute.

with_service_version

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

Set the optional service.version resource attribute.

with_instrumentation_scope

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

Set the instrumentation scope name.

with_timeout

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

Set the OTLP request timeout.

with_export_interval

pub fn with_export_interval(self, interval: Duration) -> Self

Set the interval between metric collections.

with_temporality

pub fn with_temporality(self, temporality: MetricTemporality) -> Self

Set the preferred aggregation temporality.

with_max_instruments

pub fn with_max_instruments(self, max_instruments: usize) -> Self

Set the maximum number of distinct instrument names retained by this endpoint.

with_cardinality_limit

pub fn with_cardinality_limit(self, cardinality_limit: usize) -> Self

Set the SDK series cardinality limit per instrument.

Trait Implementations

impl Clone for OpenTelemetryMetricConfig

impl Clone for OpenTelemetryMetricConfig

clone

fn clone(&self) -> OpenTelemetryMetricConfig

clone_from

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

impl Debug for OpenTelemetryMetricConfig

impl Debug for OpenTelemetryMetricConfig

fmt

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