pub struct TelemetryOptions {
pub console_log_disabled: bool,
pub console_log_format: Format,
pub file_log_directory: Option<PathBuf>,
pub file_log_rotation_period: Option<RotationPeriod>,
pub file_log_max_files: Option<usize>,
pub otel_trace_exporter_enabled: bool,
pub otel_log_exporter_enabled: bool,
}
Expand description
Contains options which can be passed to Tracing::pre_configured()
.
Additionally, this struct can be used as operator CLI arguments. This functionality is only
available if the feature clap
is enabled.
use clap::Parser;
#[derive(Parser)]
struct Cli {
#[arg(short, long)]
namespace: String,
#[clap(flatten)]
telemetry_arguments: TelemetryOptions,
}
Fields§
§console_log_disabled: bool
Disable console logs.
console_log_format: Format
Console log format.
file_log_directory: Option<PathBuf>
Enable logging to files located in the specified DIRECTORY.
file_log_rotation_period: Option<RotationPeriod>
Time PERIOD after which log files are rolled over.
file_log_max_files: Option<usize>
Maximum NUMBER of log files to keep.
otel_trace_exporter_enabled: bool
Enable exporting OpenTelemetry traces via OTLP.
otel_log_exporter_enabled: bool
Enable exporting OpenTelemetry logs via OTLP.
Trait Implementations§
Source§impl Args for TelemetryOptions
impl Args for TelemetryOptions
Source§fn group_id() -> Option<Id>
fn group_id() -> Option<Id>
Report the [
ArgGroup::id
][crate::ArgGroup::id] for this set of argumentsSource§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Append to [
Command
] so it can instantiate self
via
[FromArgMatches::update_from_arg_matches_mut
] Read moreSource§impl Debug for TelemetryOptions
impl Debug for TelemetryOptions
Source§impl Default for TelemetryOptions
impl Default for TelemetryOptions
Source§fn default() -> TelemetryOptions
fn default() -> TelemetryOptions
Returns the “default value” for a type. Read more
Source§impl FromArgMatches for TelemetryOptions
impl FromArgMatches for TelemetryOptions
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
Assign values from
ArgMatches
to self
.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
Assign values from
ArgMatches
to self
.Source§impl PartialEq for TelemetryOptions
impl PartialEq for TelemetryOptions
impl Eq for TelemetryOptions
impl StructuralPartialEq for TelemetryOptions
Auto Trait Implementations§
impl Freeze for TelemetryOptions
impl RefUnwindSafe for TelemetryOptions
impl Send for TelemetryOptions
impl Sync for TelemetryOptions
impl Unpin for TelemetryOptions
impl UnwindSafe for TelemetryOptions
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
Mutably borrows from an owned value. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request