Struct wasmcloud_core::otel::OtelConfig

source ·
pub struct OtelConfig {
Show 15 fields pub enable_observability: bool, pub enable_traces: Option<bool>, pub enable_metrics: Option<bool>, pub enable_logs: Option<bool>, pub observability_endpoint: Option<String>, pub traces_endpoint: Option<String>, pub metrics_endpoint: Option<String>, pub logs_endpoint: Option<String>, pub protocol: OtelProtocol, pub additional_ca_paths: Vec<PathBuf>, pub trace_level: Level, pub traces_sampler: Option<String>, pub traces_sampler_arg: Option<String>, pub max_batch_queue_size: Option<usize>, pub concurrent_exports: Option<usize>,
}
Expand description

Configuration values for OpenTelemetry

Fields§

§enable_observability: bool

Determine whether observability should be enabled.

§enable_traces: Option<bool>

Determine whether traces should be enabled.

§enable_metrics: Option<bool>

Determine whether metrics should be enabled.

§enable_logs: Option<bool>

Determine whether logs should be enabled.

§observability_endpoint: Option<String>

Overrides the OpenTelemetry endpoint for all signals.

§traces_endpoint: Option<String>

Overrides the OpenTelemetry endpoint for traces.

§metrics_endpoint: Option<String>

Overrides the OpenTelemetry endpoint for metrics.

§logs_endpoint: Option<String>

Overrides the OpenTelemetry endpoint for logs.

§protocol: OtelProtocol

Determines whether http or grpc will be used for exporting the telemetry.

§additional_ca_paths: Vec<PathBuf>

Additional CAs to include in the OpenTelemetry client configuration

§trace_level: Level

The level of tracing to enable.

§traces_sampler: Option<String>

Configures type of sampler to use for tracing. This will override any sampler set via the standard environment variables

§traces_sampler_arg: Option<String>

An additional argument to pass to the sampler. Used for cases such as the trace_id_ratio_based sampler.

§max_batch_queue_size: Option<usize>

The maximum number of tracing events that can be buffered in memory before being exported. If the queue is full, events will be dropped. If not set, the default for the underlying exporter will be used. This will override any value set via the standard environment variables.

§concurrent_exports: Option<usize>

The maximum number of concurrent export threads that can be used to export tracing data to collectors. By default, this number is set to 1, which means that export batches will be exported synchronously. This setting has a direct impact on memory usage and performance. Setting to > 1 can improve the performance of the exporter, but it can also increase memory usage (and possibly CPU). This will override any value set via the standard environment variables.

Implementations§

source§

impl OtelConfig

source

pub fn logs_endpoint(&self) -> String

source

pub fn metrics_endpoint(&self) -> String

source

pub fn traces_endpoint(&self) -> String

source

pub fn logs_enabled(&self) -> bool

source

pub fn metrics_enabled(&self) -> bool

source

pub fn traces_enabled(&self) -> bool

Trait Implementations§

source§

impl Clone for OtelConfig

source§

fn clone(&self) -> OtelConfig

Returns a copy 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 OtelConfig

source§

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

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

impl Default for OtelConfig

source§

fn default() -> OtelConfig

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

impl<'de> Deserialize<'de> for OtelConfig

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for OtelConfig

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

Auto Trait Implementations§

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, dst: *mut T)

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

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> FromBase64 for T
where T: for<'de> Deserialize<'de>,

source§

fn from_base64<Input>(raw: &Input) -> Result<T, Error>
where Input: AsRef<[u8]> + ?Sized,

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

source§

type Output = T

Should always be Self
source§

impl<C> SignWithKey<String> for C
where C: ToBase64,

source§

impl<T> ToBase64 for T
where T: Serialize,

source§

fn to_base64(&self) -> Result<Cow<'_, str>, Error>

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.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

source§

impl<T> ErasedDestructor for T
where T: 'static,

source§

impl<T> MaybeSendSync for T