diff --git a/src/append/opentelemetry.rs b/src/append/opentelemetry.rs index 7a84d4a..c0539a9 100644 --- a/src/append/opentelemetry.rs +++ b/src/append/opentelemetry.rs @@ -80,16 +80,26 @@ impl OpentelemetryLogBuilder { } /// Add a label to the resource. - pub fn add_label(mut self, key: impl Into>, value: impl Into>) -> Self { + pub fn add_label( + mut self, + key: impl Into>, + value: impl Into>, + ) -> Self { self.labels.push((key.into(), value.into())); self } /// Build the [`OpentelemetryLog`] appender. pub fn build(self) -> Result { - let OpentelemetryLogBuilder { name, endpoint, protocol, labels } = self; + let OpentelemetryLogBuilder { + name, + endpoint, + protocol, + labels, + } = self; - let collector_timeout = Duration::from_secs(opentelemetry_otlp::OTEL_EXPORTER_OTLP_TIMEOUT_DEFAULT); + let collector_timeout = + Duration::from_secs(opentelemetry_otlp::OTEL_EXPORTER_OTLP_TIMEOUT_DEFAULT); let exporter = match protocol { Protocol::Grpc => opentelemetry_otlp::new_exporter() .tonic() @@ -141,7 +151,7 @@ impl Append for OpentelemetryLog { let mut record = LogRecord::default(); record.observed_timestamp = Some(SystemTime::now()); record.severity_number = Some(log_level_to_otel_severity(log_record.level())); - record.severity_text = Some(log_record.level().as_str().into()); + record.severity_text = Some(log_record.level().as_str()); record.target = Some(log_record.target().to_string().into()); record.body = Some(AnyValue::from(log_record.args().to_string())); diff --git a/src/append/rolling_file/non_blocking.rs b/src/append/rolling_file/non_blocking.rs index a668181..fc5cf95 100644 --- a/src/append/rolling_file/non_blocking.rs +++ b/src/append/rolling_file/non_blocking.rs @@ -117,7 +117,6 @@ impl NonBlocking { } pub(super) fn send(&self, record: Vec) -> anyhow::Result<()> { - // TODO(tisonkun): consider drop the message if the channel is full self.sender .send(Message::Record(record)) .context("failed to send log message")