Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

chore(capture): reduce client-error log noise in analytics, AI, and replay paths (#60244)

Paweł Ledwoń5e7fda59a86b
diff --git a/rust/capture/src/ai_endpoint.rs b/rust/capture/src/ai_endpoint.rs
index 6edb8a3c8b0e..2c5f6a197e4e 100644
--- a/rust/capture/src/ai_endpoint.rs
+++ b/rust/capture/src/ai_endpoint.rs
@@ -13,7 +13,7 @@ use serde_json::Value;
use std::collections::HashSet;
use time::format_description::well_known::Iso8601;
use time::OffsetDateTime;
-use tracing::{debug, warn};
+use tracing::{debug, error, warn};
use uuid::Uuid;
// Blob metrics
@@ -29,7 +29,7 @@ use crate::event_restrictions::{
use crate::events::overflow_stamping::stamp_overflow_reason;
use crate::extractors::extract_body_with_timeout;
use crate::payload::decompression::decompress_gzip_to_bytes;
-use crate::prometheus::report_dropped_events;
+use crate::prometheus::{report_dropped_events, report_internal_error_metrics};
use crate::router::State as AppState;
use crate::timestamp;
use crate::token::validate_token;
@@ -126,6 +126,18 @@ pub async fn ai_handler(
path: MatchedPath,
headers: HeaderMap,
body: Body,
+) -> Result<Json<AIEndpointResponse>, CaptureError> {
+ ai_handler_inner(state, ip, path, headers, body)
+ .await
+ .inspect_err(|err| report_internal_error_metrics(err.to_metric_tag(), "ai"))
+}
+
+async fn ai_handler_inner(
+ state: AppState,
+ ip: Option<InsecureClientIp>,
+ path: MatchedPath,
+ headers: HeaderMap,
+ body: Body,
) -> Result<Json<AIEndpointResponse>, CaptureError> {
debug!("Received request to /i/v0/ai endpoint");
@@ -143,7 +155,6 @@ pub async fn ai_handler(
// Check for empty body
if body.is_empty() {
- warn!("AI endpoint received empty body");
return Err(CaptureError::EmptyPayload);
}
@@ -154,7 +165,6 @@ pub async fn ai_handler(
.unwrap_or("");
if !auth_header.starts_with("Bearer ") {
- warn!("AI endpoint missing or invalid Authorization header");
return Err(CaptureError::NoTokenError);
}
@@ -181,10 +191,6 @@ pub async fn ai_handler(
.unwrap_or("");
if !content_type.starts_with("multipart/form-data") {
- warn!(
- "AI endpoint received non-multipart content type: {}",
- content_type
- );
return Err(CaptureError::RequestDecodingError(
"Content-Type must be multipart/form-data".to_string(),
));
@@ -192,7 +198,6 @@ pub async fn ai_handler(
// Extract boundary from Content-Type header using multer's built-in parser
let boundary = parse_boundary(content_type).map_err(|e| {
- warn!("Failed to parse boundary from Content-Type: {}", e);
CaptureError::RequestDecodingError(format!("Invalid boundary in Content-Type: {e}"))
})?;
@@ -304,7 +309,7 @@ pub async fn ai_handler(
// Upload blobs to S3 and insert URLs into event properties
if !parsed.blob_parts.is_empty() {
let blob_storage = state.ai_blob_storage.as_ref().ok_or_else(|| {
- warn!("AI endpoint received blobs but S3 is not configured");
+ error!("AI endpoint received blobs but S3 is not configured");
CaptureError::ServiceUnavailable("blob storage not configured".to_string())
})?;
@@ -403,10 +408,7 @@ async fn retrieve_event_metadata(
let field = multipart
.next_field()
.await
- .map_err(|e| {
- warn!("Multipart parsing error: {}", e);
- CaptureError::RequestDecodingError(format!("Multipart parsing failed: {e}"))
- })?
+ .map_err(|e| CaptureError::RequestDecodingError(format!("Multipart parsing failed: {e}")))?
.ok_or_else(|| {
CaptureError::RequestParsingError(
"Missing required 'event' part in multipart data".to_string(),
@@ -430,7 +432,6 @@ async fn retrieve_event_metadata(
// Read the field data
let field_data = field.bytes().await.map_err(|e| {
- warn!("Failed to read event field data: {}", e);
CaptureError::RequestDecodingError(format!("Failed to read field data: {e}"))
})?;
@@ -515,7 +516,7 @@ fn build_kafka_event(
// Serialize the event to JSON (this is what goes in the "data" field)
let data = serde_json::to_string(&parsed.event).map_err(|e| {
- warn!("Failed to serialize AI event: {}", e);
+ error!("Failed to serialize AI event: {}", e);
CaptureError::NonRetryableSinkError
})?;
@@ -590,13 +591,11 @@ fn process_event_part(
}
// Parse the event JSON
- let event_json_str = std::str::from_utf8(&field_data).map_err(|e| {
- warn!("Event part is not valid UTF-8: {}", e);
+ let event_json_str = std::str::from_utf8(&field_data).map_err(|_| {
CaptureError::RequestParsingError("Event part must be valid UTF-8".to_string())
})?;
- let event_json = serde_json::from_str(event_json_str).map_err(|e| {
- warn!("Event part is not valid JSON: {}", e);
+ let event_json = serde_json::from_str(event_json_str).map_err(|_| {
CaptureError::RequestParsingError("Event part must be valid JSON".to_string())
})?;
@@ -618,13 +617,11 @@ fn process_properties_part(
content_encoding: Option<String>,
) -> Result<(Value, PartInfo), CaptureError> {
// Parse the properties JSON
- let properties_json_str = std::str::from_utf8(&field_data).map_err(|e| {
- warn!("Properties part is not valid UTF-8: {}", e);
+ let properties_json_str = std::str::from_utf8(&field_data).map_err(|_| {
CaptureError::RequestParsingError("Properties part must be valid UTF-8".to_string())
})?;
- let properties_json = serde_json::from_str(properties_json_str).map_err(|e| {
- warn!("Properties part is not valid JSON: {}", e);
+ let properties_json = serde_json::from_str(properties_json_str).map_err(|_| {
CaptureError::RequestParsingError("Properties part must be valid JSON".to_string())
})?;
@@ -714,10 +711,11 @@ async fn retrieve_multipart_parts(
accepted_parts.push(event_metadata.event_part_info);
// Parse each part
- while let Some(field) = multipart.next_field().await.map_err(|e| {
- warn!("Multipart parsing error: {}", e);
- CaptureError::RequestDecodingError(format!("Multipart parsing failed: {e}"))
- })? {
+ while let Some(field) = multipart
+ .next_field()
+ .await
+ .map_err(|e| CaptureError::RequestDecodingError(format!("Multipart parsing failed: {e}")))?
+ {
part_count += 1;
// Extract all field information before consuming the field
@@ -743,7 +741,6 @@ async fn retrieve_multipart_parts(
// Read the field data to get the length (this consumes the field)
let field_data = field.bytes().await.map_err(|e| {
- warn!("Failed to read field data for '{}': {}", field_name, e);
CaptureError::RequestDecodingError(format!("Failed to read field data: {e}"))
})?;
@@ -784,8 +781,6 @@ async fn retrieve_multipart_parts(
blob_parts.push(blob_part);
accepted_parts.push(part_info);
} else {
- warn!("Unknown multipart field: {}", field_name);
-
// Reject unknown fields that don't match expected patterns
return Err(CaptureError::RequestParsingError(format!(
"Unknown multipart field: '{field_name}'. Expected 'event', 'event.properties', or 'event.properties.<property_name>'"
@@ -892,10 +887,8 @@ fn parse_multipart_data(
.and_then(|v| v.as_str())
.ok_or_else(|| CaptureError::RequestParsingError("Event UUID is required".to_string()))
.and_then(|uuid_str| {
- Uuid::parse_str(uuid_str).map_err(|e| {
- warn!("Invalid UUID format: {}", e);
- CaptureError::RequestParsingError(format!("Invalid UUID format: {e}"))
- })
+ Uuid::parse_str(uuid_str)
+ .map_err(|e| CaptureError::RequestParsingError(format!("Invalid UUID format: {e}")))
})?;
let timestamp = event
@@ -932,7 +925,6 @@ fn parse_multipart_data(
fn validate_event_structure(event: &Value) -> Result<(), CaptureError> {
// Check if event is an object
let event_obj = event.as_object().ok_or_else(|| {
- warn!("Event must be a JSON object");
CaptureError::RequestParsingError("Event must be a JSON object".to_string())
})?;
@@ -941,7 +933,6 @@ fn validate_event_structure(event: &Value) -> Result<(), CaptureError> {
.get("event")
.and_then(|v| v.as_str())
.ok_or_else(|| {
- warn!("Event missing 'event' field");
CaptureError::RequestParsingError("Event missing 'event' field".to_string())
})?;
@@ -974,7 +965,6 @@ fn validate_event_structure(event: &Value) -> Result<(), CaptureError> {
.get("distinct_id")
.and_then(|v| v.as_str())
.ok_or_else(|| {
- warn!("Event missing 'distinct_id' field");
CaptureError::RequestParsingError("Event missing 'distinct_id' field".to_string())
})?;
@@ -989,7 +979,6 @@ fn validate_event_structure(event: &Value) -> Result<(), CaptureError> {
.get("properties")
.and_then(|v| v.as_object())
.ok_or_else(|| {
- warn!("Event missing 'properties' field");
CaptureError::RequestParsingError("Event missing 'properties' field".to_string())
})?;
@@ -1004,7 +993,6 @@ fn validate_event_structure(event: &Value) -> Result<(), CaptureError> {
.get("$ai_model")
.and_then(|v| v.as_str())
.ok_or_else(|| {
- warn!("$ai_model must be a string");
CaptureError::RequestParsingError("$ai_model must be a string".to_string())
})?;
diff --git a/rust/capture/src/otel/filtering.rs b/rust/capture/src/otel/filtering.rs
index 5658cc032a14..38298fab222e 100644
--- a/rust/capture/src/otel/filtering.rs
+++ b/rust/capture/src/otel/filtering.rs
@@ -1,7 +1,7 @@
use chrono::{DateTime, Utc};
use common_types::CapturedEvent;
use serde_json::json;
-use tracing::warn;
+use tracing::error;
use uuid::Uuid;
use crate::api::CaptureError;
@@ -95,7 +95,7 @@ pub fn build_events(
});
let data = serde_json::to_string(&event_data).map_err(|e| {
- warn!("Failed to serialize OTel event data: {}", e);
+ error!("Failed to serialize OTel event data: {}", e);
CaptureError::InternalError(format!("failed to serialize event data: {e}"))
})?;
diff --git a/rust/capture/src/otel/ingestion.rs b/rust/capture/src/otel/ingestion.rs
index 948386f203f2..c3818150c342 100644
--- a/rust/capture/src/otel/ingestion.rs
+++ b/rust/capture/src/otel/ingestion.rs
@@ -3,7 +3,6 @@ use bytes::Bytes;
use opentelemetry_proto::tonic::collector::trace::v1::ExportTraceServiceRequest;
use prost::Message;
use serde_json::Value;
-use tracing::warn;
use crate::api::CaptureError;
use crate::payload::decompression::decompress_gzip_to_bytes;
@@ -78,27 +77,18 @@ pub fn parse_request(
let is_json = content_type.starts_with("application/json");
if is_protobuf {
- ExportTraceServiceRequest::decode(&body[..]).map_err(|e| {
- warn!("Failed to decode OTEL protobuf: {}", e);
- CaptureError::RequestParsingError(format!("Invalid protobuf: {e}"))
- })
+ ExportTraceServiceRequest::decode(&body[..])
+ .map_err(|e| CaptureError::RequestParsingError(format!("Invalid protobuf: {e}")))
} else if is_json {
- let mut json_value: Value = serde_json::from_slice(&body).map_err(|e| {
- warn!("Failed to parse OTEL JSON: {}", e);
- CaptureError::RequestParsingError(format!("Invalid JSON: {e}"))
- })?;
+ let mut json_value: Value = serde_json::from_slice(&body)
+ .map_err(|e| CaptureError::RequestParsingError(format!("Invalid JSON: {e}")))?;
patch_otel_json(&mut json_value);
serde_json::from_value(json_value).map_err(|e| {
- warn!("Failed to parse OTEL trace request: {}", e);
CaptureError::RequestParsingError(format!("Invalid OTLP trace format: {e}"))
})
} else {
- warn!(
- "OTEL endpoint received unsupported content type: {}",
- content_type
- );
Err(CaptureError::RequestDecodingError(
"Content-Type must be application/x-protobuf or application/json".to_string(),
))
diff --git a/rust/capture/src/otel/mod.rs b/rust/capture/src/otel/mod.rs
index 7138f6c167d5..227dfdf136d8 100644
--- a/rust/capture/src/otel/mod.rs
+++ b/rust/capture/src/otel/mod.rs
@@ -134,10 +134,6 @@ pub async fn otel_handler(
// size limit (4 MB) bounds the absolute maximum, but compact protobuf can
// pack many spans into that budget.
if raw_span_count > MAX_RAW_SPANS_PER_REQUEST {
- warn!(
- "OTEL request contains {} raw spans, exceeding limit of {}",
- raw_span_count, MAX_RAW_SPANS_PER_REQUEST
- );
let err = CaptureError::RequestParsingError(format!(
"Too many spans: {raw_span_count} exceeds limit of {MAX_RAW_SPANS_PER_REQUEST}"
));
@@ -162,10 +158,6 @@ pub async fn otel_handler(
return Ok(Json(json!({})));
}
if span_count > MAX_SPANS_PER_REQUEST {
- warn!(
- "OTEL request contains {} AI spans, exceeding limit of {} ({} raw spans received)",
- span_count, MAX_SPANS_PER_REQUEST, raw_span_count
- );
let err = CaptureError::RequestParsingError(format!(
"Too many AI spans: {span_count} exceeds limit of {MAX_SPANS_PER_REQUEST}"
));
diff --git a/rust/capture/src/payload/common.rs b/rust/capture/src/payload/common.rs
index aebe28e8a8af..241a6198e465 100644
--- a/rust/capture/src/payload/common.rs
+++ b/rust/capture/src/payload/common.rs
@@ -6,7 +6,7 @@
use axum::http::{HeaderMap, Method};
use bytes::Bytes;
-use tracing::{error, Span};
+use tracing::{debug, Span};
use crate::{
api::CaptureError,
@@ -81,7 +81,6 @@ pub fn extract_payload_bytes(
} else if !body.is_empty() {
body
} else {
- error!("missing payload on {:?} request", method);
return Err(CaptureError::EmptyPayload);
};
@@ -119,7 +118,7 @@ pub fn extract_payload_bytes(
let max_chars = std::cmp::min(payload.len(), MAX_PAYLOAD_SNIPPET_SIZE);
let form_data_snippet = String::from_utf8(payload[..max_chars].to_vec())
.unwrap_or(String::from("INVALID_UTF8"));
- error!(
+ debug!(
form_data = form_data_snippet,
"expected form data in {} request payload", *method
);
diff --git a/rust/capture/src/payload/decompression.rs b/rust/capture/src/payload/decompression.rs
index 61bea14a2fdc..2d66e3a935ed 100644
--- a/rust/capture/src/payload/decompression.rs
+++ b/rust/capture/src/payload/decompression.rs
@@ -8,7 +8,7 @@ use std::io::prelude::*;
use bytes::Bytes;
use flate2::read::GzDecoder;
use metrics;
-use tracing::{debug, error, instrument, warn, Span};
+use tracing::{debug, info, instrument, warn, Span};
use crate::{
api::CaptureError,
@@ -42,8 +42,7 @@ pub fn decompress_gzip_to_bytes(compressed: &[u8], limit: usize) -> Result<Vec<u
loop {
let got = match zipstream.read(&mut chunk) {
Ok(got) => got,
- Err(e) => {
- error!("decompress_gzip_to_bytes: failed to read GZIP chunk: {}", e);
+ Err(_) => {
return Err(CaptureError::RequestDecodingError(String::from(
"invalid GZIP data",
)));
@@ -54,12 +53,6 @@ pub fn decompress_gzip_to_bytes(compressed: &[u8], limit: usize) -> Result<Vec<u
}
if total_read + got > limit {
- error!(
- decompressed_size = total_read + got,
- compressed_size = len,
- limit = limit,
- "decompress_gzip_to_bytes: GZIP decompression would exceed size limit"
- );
metrics::counter!(METRIC_PAYLOAD_SIZE_EXCEEDED, "kind" => "gzip").increment(1);
metrics::histogram!("capture_full_payload_size", "oversize" => "true")
.record((total_read + got) as f64);
@@ -131,8 +124,7 @@ pub fn decompress_payload(
match String::from_utf8(buf) {
Ok(s) => s,
- Err(e) => {
- error!("decompress_payload: failed to decode gzip: {e:#}");
+ Err(_) => {
return Err(CaptureError::RequestDecodingError(String::from(
"invalid gzip data",
)));
@@ -143,13 +135,7 @@ pub fn decompress_payload(
payload_len = bytes.len(),
"decompress_payload: matched LZ64 compression"
);
- match decompress_lz64(&bytes, limit) {
- Ok(payload) => payload,
- Err(e) => {
- error!("decompress_payload: failed LZ64 decompress: {e:#}");
- return Err(e);
- }
- }
+ decompress_lz64(&bytes, limit)?
} else {
debug!(
path = path,
@@ -158,14 +144,13 @@ pub fn decompress_payload(
);
let s = String::from_utf8(bytes.into()).map_err(|e| {
- error!(
+ debug!(
valid_up_to = &e.utf8_error().valid_up_to(),
"decompress_payload: failed to convert request payload to UTF8: {e:#}"
);
CaptureError::RequestDecodingError(String::from("invalid UTF8 in request payload"))
})?;
if s.len() > limit {
- error!("decompress_payload: request size limit reached");
metrics::counter!(METRIC_PAYLOAD_SIZE_EXCEEDED, "kind" => "none").increment(1);
metrics::histogram!("capture_full_payload_size", "oversize" => "true")
.record(s.len() as f64);
@@ -190,8 +175,6 @@ pub fn decompress_payload(
Ok(unwrapped_payload) => {
let unwrapped_size = unwrapped_payload.len();
if unwrapped_size > limit {
- error!(unwrapped_size,
- "decompress_payload: request size limit exceeded after post-decode base64 unwrap");
report_dropped_events("event_too_big", 1);
return Err(CaptureError::EventTooBig(format!(
"decompress_payload: payload size limit {limit} exceeded after post-decode base64 unwrap: {unwrapped_size}",
@@ -200,12 +183,14 @@ pub fn decompress_payload(
unwrapped_payload
}
Err(e) => {
- error!("decompress_payload: failed UTF8 conversion after post-decode base64: {e:#}");
+ info!(
+ "decompress_payload: failed UTF8 conversion after post-decode base64: {e:#}"
+ );
payload
}
},
Err(e) => {
- error!(
+ info!(
path = path,
"decompress_payload: failed post-decode base64 unwrap: {e:#}"
);
diff --git a/rust/capture/src/payload/recordings.rs b/rust/capture/src/payload/recordings.rs
index 82b552d5320e..abb36b3d51d0 100644
--- a/rust/capture/src/payload/recordings.rs
+++ b/rust/capture/src/payload/recordings.rs
@@ -9,7 +9,7 @@ use axum::extract::{MatchedPath, State};
use axum::http::{HeaderMap, Method};
use axum_client_ip::InsecureClientIp;
use metrics::counter;
-use tracing::{instrument, warn, Span};
+use tracing::{info, instrument, Span};
use crate::{
api::CaptureError,
@@ -99,7 +99,7 @@ pub async fn handle_recording_payload(
debug_or_info!(chatty_debug_enabled, metadata=?metadata, event_count=?events.len(), "hydrated events");
if events.is_empty() {
- warn!("rejected empty recording batch");
+ info!(metadata = ?metadata, "rejected empty recording batch");
return Err(CaptureError::EmptyBatch);
}
diff --git a/rust/capture/src/utils.rs b/rust/capture/src/utils.rs
index 702870840944..dc9e4a2ee79e 100644
--- a/rust/capture/src/utils.rs
+++ b/rust/capture/src/utils.rs
@@ -3,7 +3,7 @@ use base64::Engine;
use common_types::RawEvent;
use rand::RngCore;
use std::collections::HashSet;
-use tracing::error;
+use tracing::debug;
use uuid::Uuid;
use crate::{
@@ -149,7 +149,7 @@ pub fn decode_base64(payload: &[u8], location: &str) -> Result<Vec<u8>, CaptureE
let max_chars = std::cmp::min(payload.len(), MAX_PAYLOAD_SNIPPET_SIZE);
let data_snippet = String::from_utf8(payload[..max_chars].to_vec())
.unwrap_or(String::from("INVALID_UTF8"));
- error!(
+ debug!(
location = location,
data_snippet = data_snippet,
"decode_base64 failure: {}",
@@ -170,7 +170,7 @@ pub fn decode_form(payload: &[u8]) -> Result<EventFormData, CaptureError> {
let max_chars: usize = std::cmp::min(payload.len(), MAX_PAYLOAD_SNIPPET_SIZE);
let form_data_snippet = String::from_utf8(payload[..max_chars].to_vec())
.unwrap_or(String::from("INVALID_UTF8"));
- error!(
+ debug!(
form_data = form_data_snippet,
"failed to decode urlencoded form body: {e:#}"
);
@@ -190,7 +190,7 @@ pub fn decompress_lz64(payload: &[u8], limit: usize) -> Result<String, CaptureEr
let max_chars: usize = std::cmp::min(payload.len(), MAX_PAYLOAD_SNIPPET_SIZE);
let payload_snippet = String::from_utf8(payload[..max_chars].to_vec())
.unwrap_or(String::from("INVALID_UTF8"));
- error!(
+ debug!(
payload_snippet = payload_snippet,
"decompress_lz64: failed decompress to UTF16"
);
@@ -204,11 +204,7 @@ pub fn decompress_lz64(payload: &[u8], limit: usize) -> Result<String, CaptureEr
// obtain the JSON event batch payload we've come to know and love
let decompressed = match String::from_utf16(&decomp_utf16) {
Ok(result) => result,
- Err(e) => {
- error!(
- "decompress_lz64: failed UTF16 to UTF8 conversion, got: {}",
- e
- );
+ Err(_) => {
return Err(CaptureError::RequestDecodingError(String::from(
"decompress_lz64: failed UTF16 to UTF8 conversion",
)));
@@ -216,10 +212,6 @@ pub fn decompress_lz64(payload: &[u8], limit: usize) -> Result<String, CaptureEr
};
if decompressed.len() > limit {
- error!(
- "lz64 request payload size limit exceeded: {}",
- decompressed.len()
- );
report_dropped_events("event_too_big", 1);
return Err(CaptureError::EventTooBig(String::from(
"lz64 request payload size limit exceeded",
diff --git a/rust/capture/src/v0_endpoint.rs b/rust/capture/src/v0_endpoint.rs
index 55cd9ca93ac5..e99b89063df1 100644
--- a/rust/capture/src/v0_endpoint.rs
+++ b/rust/capture/src/v0_endpoint.rs
@@ -3,7 +3,7 @@ use axum::extract::{MatchedPath, Query, State};
use axum::http::{HeaderMap, Method};
use axum::{debug_handler, Json};
use axum_client_ip::InsecureClientIp;
-use tracing::{error, instrument, warn, Span};
+use tracing::{instrument, Span};
use crate::{
api::{CaptureError, CaptureResponse, CaptureResponseCode},
@@ -64,7 +64,6 @@ pub async fn event(
Err(err) => {
report_internal_error_metrics(err.to_metric_tag(), "parsing");
- error!("event: request payload parsing error: {err:#}");
Err(err)
}
@@ -84,7 +83,6 @@ pub async fn event(
{
report_dropped_events(err.to_metric_tag(), event_count);
report_internal_error_metrics(err.to_metric_tag(), "processing");
- warn!("event: rejected payload: {err:#}");
return Err(err);
}
@@ -133,7 +131,6 @@ pub async fn recording(
}),
Err(err) => {
report_internal_error_metrics(err.to_metric_tag(), "parsing");
- error!("recordings: request payload parsing error: {err:#}");
Err(err)
}
Ok((context, events)) => {
@@ -149,7 +146,6 @@ pub async fn recording(
{
report_dropped_events(err.to_metric_tag(), count);
report_internal_error_metrics(err.to_metric_tag(), "processing");
- warn!("recordings: rejected payload: {err:#}");
return Err(err);
}
Ok(CaptureResponse {
diff --git a/rust/capture/src/v0_request.rs b/rust/capture/src/v0_request.rs
index 754908fc34d5..a9756828adf4 100644
--- a/rust/capture/src/v0_request.rs
+++ b/rust/capture/src/v0_request.rs
@@ -4,7 +4,7 @@ use common_types::{CapturedEvent, RawEngageEvent, RawEvent};
use serde::Deserialize;
use time::format_description::well_known::Iso8601;
use time::OffsetDateTime;
-use tracing::{error, instrument, warn, Span};
+use tracing::{instrument, Span};
use crate::{
api::CaptureError,
@@ -84,9 +84,9 @@ impl RawRequest {
properties: engage_event.properties,
}])
} else {
- let err_msg = String::from("non-engage request missing event name attribute");
- error!("event hydration from request failed: {err_msg}");
- Err(CaptureError::RequestHydrationError(err_msg))
+ Err(CaptureError::RequestHydrationError(String::from(
+ "non-engage request missing event name attribute",
+ )))
}
}
};
@@ -95,7 +95,6 @@ impl RawRequest {
match result {
Ok(mut events) => {
if events.is_empty() {
- warn!("rejected empty batch");
return Err(CaptureError::EmptyBatch);
}