pub struct ConfigBuilder { /* private fields */ }Implementations§
Source§impl ConfigBuilder
impl ConfigBuilder
Sourcepub fn set_service(&mut self, service: String) -> &mut Self
pub fn set_service(&mut self, service: String) -> &mut Self
Sets the service name for your application
Default: unnamed-rust-service
Env variable: DD_SERVICE
Sourcepub fn set_env(&mut self, env: String) -> &mut Self
pub fn set_env(&mut self, env: String) -> &mut Self
Set the application’s environment, for example: prod, staging.
Default: (none)
Env variable: DD_ENV
Sourcepub fn set_version(&mut self, version: String) -> &mut Self
pub fn set_version(&mut self, version: String) -> &mut Self
Set the application’s version, for example: 1.2.3 or 6c44da20.
Default: (none)
Env variable: DD_VERSION
A list of default tags to be added to every span, in (key, value) format. Example:
[(layer, api), (team, intake)].
Default: (none)
Env variable: DD_TAGS
Sourcepub fn add_global_tag(&mut self, tag: (String, String)) -> &mut Self
pub fn add_global_tag(&mut self, tag: (String, String)) -> &mut Self
Add a tag to be added to every span, in (key, value) format.
Example: (layer, api).
Sourcepub fn set_telemetry_enabled(&mut self, enabled: bool) -> &mut Self
pub fn set_telemetry_enabled(&mut self, enabled: bool) -> &mut Self
Enable or disable telemetry data collection and sending.
Default: true
Env variable: DD_INSTRUMENTATION_TELEMETRY_ENABLED
Sourcepub fn set_telemetry_log_collection_enabled(
&mut self,
enabled: bool,
) -> &mut Self
pub fn set_telemetry_log_collection_enabled( &mut self, enabled: bool, ) -> &mut Self
Enable or disable log collection for telemetry.
Default: true
Env variable: DD_TELEMETRY_LOG_COLLECTION_ENABLED
Sourcepub fn set_telemetry_heartbeat_interval(&mut self, seconds: f64) -> &mut Self
pub fn set_telemetry_heartbeat_interval(&mut self, seconds: f64) -> &mut Self
Interval in seconds for sending telemetry heartbeat messages.
Default: 60.0
Env variable: DD_TELEMETRY_HEARTBEAT_INTERVAL
Sourcepub fn set_agent_host(&mut self, host: String) -> &mut Self
pub fn set_agent_host(&mut self, host: String) -> &mut Self
Sets the hostname of the Datadog Agent.
Default: localhost
Env variable: DD_AGENT_HOST
Sourcepub fn set_trace_agent_port(&mut self, port: u32) -> &mut Self
pub fn set_trace_agent_port(&mut self, port: u32) -> &mut Self
Sets the port of the Datadog Agent for trace collection.
Default: 8126
Env variable: DD_TRACE_AGENT_PORT
Sourcepub fn set_trace_agent_url(&mut self, url: String) -> &mut Self
pub fn set_trace_agent_url(&mut self, url: String) -> &mut Self
Sets the URL of the Datadog Agent. This takes precedence over DD_AGENT_HOST and
DD_TRACE_AGENT_PORT.
Default: http://localhost:8126
Env variable: DD_TRACE_AGENT_URL
Sourcepub fn set_dogstatsd_agent_host(&mut self, host: String) -> &mut Self
pub fn set_dogstatsd_agent_host(&mut self, host: String) -> &mut Self
Sets the hostname for DogStatsD metric collection.
Default: localhost
Env variable: DD_DOGSTATSD_HOST
Sourcepub fn set_dogstatsd_agent_port(&mut self, port: u32) -> &mut Self
pub fn set_dogstatsd_agent_port(&mut self, port: u32) -> &mut Self
Sets the port for DogStatsD metric collection.
Default: 8125
Env variable: DD_DOGSTATSD_PORT
Sourcepub fn set_trace_partial_flush_enabled(&mut self, enabled: bool) -> &mut Self
pub fn set_trace_partial_flush_enabled(&mut self, enabled: bool) -> &mut Self
Enable partial flushing of traces.
Default: false
Env variable: DD_TRACE_PARTIAL_FLUSH_ENABLED
Sourcepub fn set_trace_partial_flush_min_spans(
&mut self,
min_spans: usize,
) -> &mut Self
pub fn set_trace_partial_flush_min_spans( &mut self, min_spans: usize, ) -> &mut Self
Minimum number of spans in a trace before partial flush is triggered.
Default: 300
Env variable: DD_TRACE_PARTIAL_FLUSH_MIN_SPANS
Sourcepub fn set_trace_sampling_rules(
&mut self,
rules: Vec<SamplingRuleConfig>,
) -> &mut Self
pub fn set_trace_sampling_rules( &mut self, rules: Vec<SamplingRuleConfig>, ) -> &mut Self
A JSON array of objects to apply for trace sampling. Each rule must have a sample_rate
between 0.0 and 1.0 (inclusive).
Default: []
Env variable: DD_TRACE_SAMPLING_RULES
Sourcepub fn set_trace_rate_limit(&mut self, rate_limit: i32) -> &mut Self
pub fn set_trace_rate_limit(&mut self, rate_limit: i32) -> &mut Self
Maximum number of traces to sample per second. Only applied if trace_sampling_rules are matched
Default: 100
Env variable: DD_TRACE_RATE_LIMIT
Sourcepub fn set_trace_propagation_style(
&mut self,
styles: Vec<TracePropagationStyle>,
) -> &mut Self
pub fn set_trace_propagation_style( &mut self, styles: Vec<TracePropagationStyle>, ) -> &mut Self
A list of propagation styles to use for both extraction and injection. Supported values are
datadog and tracecontext.
Default: [Datadog, TraceContext]
Env variable: DD_TRACE_PROPAGATION_STYLE
Sourcepub fn set_trace_propagation_style_extract(
&mut self,
styles: Vec<TracePropagationStyle>,
) -> &mut Self
pub fn set_trace_propagation_style_extract( &mut self, styles: Vec<TracePropagationStyle>, ) -> &mut Self
A list of propagation styles to use for extraction. When set, this overrides
DD_TRACE_PROPAGATION_STYLE for extraction.
Default: (none)
Env variable: DD_TRACE_PROPAGATION_STYLE_EXTRACT
Sourcepub fn set_trace_propagation_style_inject(
&mut self,
styles: Vec<TracePropagationStyle>,
) -> &mut Self
pub fn set_trace_propagation_style_inject( &mut self, styles: Vec<TracePropagationStyle>, ) -> &mut Self
A list of propagation styles to use for injection. When set, this overrides
DD_TRACE_PROPAGATION_STYLE for injection.
Default: (none)
Env variable: DD_TRACE_PROPAGATION_STYLE_INJECT
Sourcepub fn set_trace_propagation_extract_first(&mut self, first: bool) -> &mut Self
pub fn set_trace_propagation_extract_first(&mut self, first: bool) -> &mut Self
When set to true, stops extracting after the first successful trace context extraction.
Default: false
Env variable: DD_TRACE_PROPAGATION_EXTRACT_FIRST
Sourcepub fn set_enabled(&mut self, enabled: bool) -> &mut Self
pub fn set_enabled(&mut self, enabled: bool) -> &mut Self
Set to false to disable tracing.
Default: true
Env variable: DD_TRACE_ENABLED
Sourcepub fn set_log_level_filter(&mut self, filter: LevelFilter) -> &mut Self
pub fn set_log_level_filter(&mut self, filter: LevelFilter) -> &mut Self
Sets the internal log level for the tracer.
Default: Error
Env variable: DD_LOG_LEVEL
Sourcepub fn set_trace_stats_computation_enabled(
&mut self,
trace_stats_computation_enabled: bool,
) -> &mut Self
pub fn set_trace_stats_computation_enabled( &mut self, trace_stats_computation_enabled: bool, ) -> &mut Self
Enable computation of trace statistics.
Default: true
Env variable: DD_TRACE_STATS_COMPUTATION_ENABLED
Sourcepub fn set_remote_config_enabled(&mut self, enabled: bool) -> &mut Self
pub fn set_remote_config_enabled(&mut self, enabled: bool) -> &mut Self
Enable or disable remote configuration.
Default: true
Env variable: DD_REMOTE_CONFIGURATION_ENABLED
Sourcepub fn set_remote_config_poll_interval(&mut self, seconds: f64) -> &mut Self
pub fn set_remote_config_poll_interval(&mut self, seconds: f64) -> &mut Self
Interval in seconds for polling remote configuration updates.
Default: 5.0
Env variable: DD_REMOTE_CONFIG_POLL_INTERVAL_SECONDS
Maximum length of the x-datadog-tags header in bytes.
Default: 512
Env variable: DD_TRACE_X_DATADOG_TAGS_MAX_LENGTH
Auto Trait Implementations§
impl !Freeze for ConfigBuilder
impl RefUnwindSafe for ConfigBuilder
impl Send for ConfigBuilder
impl Sync for ConfigBuilder
impl Unpin for ConfigBuilder
impl UnwindSafe for ConfigBuilder
Blanket Implementations§
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
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more