pub trait WithExportConfig {
// Required methods
fn with_endpoint<T: Into<String>>(self, endpoint: T) -> Self;
fn with_protocol(self, protocol: Protocol) -> Self;
fn with_timeout(self, timeout: Duration) -> Self;
fn with_export_config(self, export_config: ExportConfig) -> Self;
}
Expand description
Expose methods to override ExportConfig.
This trait will be implemented for every struct that implemented HasExportConfig
trait.
§Examples
use crate::opentelemetry_otlp::WithExportConfig;
let exporter_builder = opentelemetry_otlp::SpanExporter::builder()
.with_tonic()
.with_endpoint("http://localhost:7201");
Required Methods§
Sourcefn with_endpoint<T: Into<String>>(self, endpoint: T) -> Self
fn with_endpoint<T: Into<String>>(self, endpoint: T) -> Self
Set the address of the OTLP collector. If not set or set to empty string, the default address is used.
Note: Programmatically setting this will override any value set via the environment variable.
Sourcefn with_protocol(self, protocol: Protocol) -> Self
fn with_protocol(self, protocol: Protocol) -> Self
Set the protocol to use when communicating with the collector.
Note that protocols that are not supported by exporters will be ignored. The exporter will use default protocol in this case.
§Note
All exporters in this crate only support one protocol, thus choosing the protocol is a no-op at the moment.
Sourcefn with_timeout(self, timeout: Duration) -> Self
fn with_timeout(self, timeout: Duration) -> Self
Set the timeout to the collector.
Note: Programmatically setting this will override any value set via the environment variable.
Sourcefn with_export_config(self, export_config: ExportConfig) -> Self
fn with_export_config(self, export_config: ExportConfig) -> Self
Set export config. This will override all previous configurations.
Note: Programmatically setting this will override any value set via environment variables.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.