pub fn with_env(mut self) -> Self {
        let endpoint = match std::env::var(OTEL_EXPORTER_OTLP_TRACES_ENDPOINT) {
            Ok(val) => val,
            Err(_) => std::env::var(OTEL_EXPORTER_OTLP_ENDPOINT)
                .unwrap_or_else(|_| OTEL_EXPORTER_OTLP_ENDPOINT_DEFAULT.to_string()),
        };
        self.exporter_config.endpoint = endpoint;

        let timeout = match std::env::var(OTEL_EXPORTER_OTLP_TRACES_TIMEOUT) {
            Ok(val) => u64::from_str(&val).unwrap_or(OTEL_EXPORTER_OTLP_TIMEOUT_DEFAULT),
            Err(_) => std::env::var(OTEL_EXPORTER_OTLP_TIMEOUT)
                .map(|val| u64::from_str(&val).unwrap_or(OTEL_EXPORTER_OTLP_TIMEOUT_DEFAULT))
                .unwrap_or(OTEL_EXPORTER_OTLP_TIMEOUT_DEFAULT),
        };
        self.exporter_config.timeout = Duration::from_secs(timeout);
        self
    }
/// Set the trace provider configuration from the given environment variables.
///
/// If the value in environment variables is illegal, will fall back to use default value.
Set the trace provider configuration from the given environment variables.
If the value in environment variables is illegal, will fall back to use default value.
Set the trace provider configuration from the given environment variables . If the value in environment variables is illegal will fall back to use default value .
pub fn with_env(mut self) -> Self {
        let endpoint = match std::env::var(OTEL_EXPORTER_OTLP_TRACES_ENDPOINT) {
            Ok(val) => val,
            Err(_) => std::env::var(OTEL_EXPORTER_OTLP_ENDPOINT)
                .unwrap_or_else(|_| OTEL_EXPORTER_OTLP_ENDPOINT_DEFAULT.to_string()),
        };
        self.exporter_config.endpoint = endpoint;
        let timeout = match std::env::var(OTEL_EXPORTER_OTLP_TRACES_TIMEOUT) {
            Ok(val) => u64::from_str(&val).unwrap_or(OTEL_EXPORTER_OTLP_TIMEOUT_DEFAULT),
            Err(_) => std::env::var(OTEL_EXPORTER_OTLP_TIMEOUT)
                .map(|val| u64::from_str(&val).unwrap_or(OTEL_EXPORTER_OTLP_TIMEOUT_DEFAULT))
                .unwrap_or(OTEL_EXPORTER_OTLP_TIMEOUT_DEFAULT),
        };
        self.exporter_config.timeout = Duration::from_secs(timeout);
        self
    }
pub fn with_env ( mut self ) -> Self { let endpoint = match std :: env :: var ( OTEL_EXPORTER_OTLP_TRACES_ENDPOINT ) { Ok ( val ) => val , Err ( _ ) => std :: env :: var ( OTEL_EXPORTER_OTLP_ENDPOINT ) . unwrap_or_else ( | _ | OTEL_EXPORTER_OTLP_ENDPOINT_DEFAULT . to_string ( ) ) , } ; self . exporter_config . endpoint = endpoint ; let timeout = match std :: env :: var ( OTEL_EXPORTER_OTLP_TRACES_TIMEOUT ) { Ok ( val ) => u64 :: from_str ( & val ) . unwrap_or ( OTEL_EXPORTER_OTLP_TIMEOUT_DEFAULT ) , Err ( _ ) => std :: env :: var ( OTEL_EXPORTER_OTLP_TIMEOUT ) . map ( | val | u64 :: from_str ( & val ) . unwrap_or ( OTEL_EXPORTER_OTLP_TIMEOUT_DEFAULT ) ) . unwrap_or ( OTEL_EXPORTER_OTLP_TIMEOUT_DEFAULT ) , } ; self . exporter_config . timeout = Duration :: from_secs ( timeout ) ; self }
Set the trace provider configuration from the given environment variables.
Set the trace provider configuration from the given environment variables .
mut self
mut self