pub struct OtlpConfig {
pub endpoint: String,
pub transport: OtlpTransport,
pub service_name: String,
pub service_version: String,
pub service_instance_id: Option<String>,
pub resource_attributes: Vec<(String, String)>,
pub batch_size: usize,
pub export_interval: Duration,
pub timeout: Duration,
pub max_retries: u32,
pub retry_delay: Duration,
pub authorization: Option<String>,
}Expand description
Configuration for OTLP exporter.
Fields§
§endpoint: StringOTLP endpoint URL (e.g., “http://localhost:4318/v1/traces”).
transport: OtlpTransportTransport protocol.
service_name: StringService name for resource attributes.
service_version: StringService version.
service_instance_id: Option<String>Service instance ID.
resource_attributes: Vec<(String, String)>Additional resource attributes.
batch_size: usizeExport batch size.
export_interval: DurationExport interval.
timeout: DurationRequest timeout.
max_retries: u32Maximum retry attempts.
retry_delay: DurationRetry delay (base for exponential backoff).
Optional authorization header.
Implementations§
Source§impl OtlpConfig
impl OtlpConfig
Sourcepub fn new(endpoint: impl Into<String>) -> OtlpConfig
pub fn new(endpoint: impl Into<String>) -> OtlpConfig
Create a new OTLP configuration.
Sourcepub fn with_service_name(self, name: impl Into<String>) -> OtlpConfig
pub fn with_service_name(self, name: impl Into<String>) -> OtlpConfig
Set the service name.
Sourcepub fn with_service_version(self, version: impl Into<String>) -> OtlpConfig
pub fn with_service_version(self, version: impl Into<String>) -> OtlpConfig
Set the service version.
Sourcepub fn with_instance_id(self, id: impl Into<String>) -> OtlpConfig
pub fn with_instance_id(self, id: impl Into<String>) -> OtlpConfig
Set the service instance ID.
Sourcepub fn with_attribute(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> OtlpConfig
pub fn with_attribute( self, key: impl Into<String>, value: impl Into<String>, ) -> OtlpConfig
Add a resource attribute.
Sourcepub fn with_batch_size(self, size: usize) -> OtlpConfig
pub fn with_batch_size(self, size: usize) -> OtlpConfig
Set the batch size.
Sourcepub fn with_export_interval(self, interval: Duration) -> OtlpConfig
pub fn with_export_interval(self, interval: Duration) -> OtlpConfig
Set the export interval.
Set the authorization header.
Sourcepub fn jaeger(endpoint: impl Into<String>) -> OtlpConfig
pub fn jaeger(endpoint: impl Into<String>) -> OtlpConfig
Configure for Jaeger OTLP endpoint.
Sourcepub fn honeycomb(api_key: impl Into<String>) -> OtlpConfig
pub fn honeycomb(api_key: impl Into<String>) -> OtlpConfig
Configure for Honeycomb.
Sourcepub fn grafana_cloud(
instance_id: impl Into<String>,
api_key: impl Into<String>,
) -> OtlpConfig
pub fn grafana_cloud( instance_id: impl Into<String>, api_key: impl Into<String>, ) -> OtlpConfig
Configure for Grafana Cloud.
Trait Implementations§
Source§impl Clone for OtlpConfig
impl Clone for OtlpConfig
Source§fn clone(&self) -> OtlpConfig
fn clone(&self) -> OtlpConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OtlpConfig
impl Debug for OtlpConfig
Source§impl Default for OtlpConfig
impl Default for OtlpConfig
Source§fn default() -> OtlpConfig
fn default() -> OtlpConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for OtlpConfig
impl RefUnwindSafe for OtlpConfig
impl Send for OtlpConfig
impl Sync for OtlpConfig
impl Unpin for OtlpConfig
impl UnwindSafe for OtlpConfig
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.