You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bug: reject event if fields count exceed 250 (#1311)
Also remove other_attributes from otel logs/traces/metrics.
We keep all attributes as individual columns in the ingested event.
If total column count in flattened event > the allowed limit
log the error, and reject the event
Fixes: #1310
Signed-off-by: Nikhil Sinha <[email protected]>
Co-authored-by: Nitish Tiwari <[email protected]>
Copy file name to clipboardExpand all lines: src/handlers/http/ingest.rs
+3
Original file line number
Diff line number
Diff line change
@@ -467,6 +467,8 @@ pub enum PostError {
467
467
KnownFormat(#[from] known_schema::Error),
468
468
#[error("Ingestion is not allowed to stream {0} as it is already associated with a different OTEL format")]
469
469
IncorrectLogFormat(String),
470
+
#[error("Failed to ingest events in dataset {0}. Total number of fields {1} exceeds the permissible limit of {2}. We recommend creating a new dataset beyond {2} for better query performance.")]
471
+
FieldsCountLimitExceeded(String,usize,usize),
470
472
}
471
473
472
474
impl actix_web::ResponseErrorforPostError{
@@ -495,6 +497,7 @@ impl actix_web::ResponseError for PostError {
let dataset_fields_warn_threshold = 0.8*PARSEABLE.options.dataset_fields_allowed_limitasf64;
218
+
// Check if the fields count exceeds the warn threshold
219
+
if fields_count > dataset_fields_warn_threshold asusize{
220
+
tracing::warn!(
221
+
"Dataset {0} has {1} fields, which exceeds the warning threshold of {2}. Ingestion will not be possible after reaching {3} fields. We recommend creating a new dataset.",
222
+
stream_name,
223
+
fields_count,
224
+
dataset_fields_warn_threshold asusize,
225
+
PARSEABLE.options.dataset_fields_allowed_limit
226
+
);
227
+
}
228
+
// Check if the fields count exceeds the limit
229
+
// Return an error if the fields count exceeds the limit
230
+
if fields_count > PARSEABLE.options.dataset_fields_allowed_limit{
231
+
let error = PostError::FieldsCountLimitExceeded(
232
+
stream_name.to_string(),
233
+
fields_count,
234
+
PARSEABLE.options.dataset_fields_allowed_limit,
235
+
);
236
+
tracing::error!("{}", error);
237
+
// Return an error if the fields count exceeds the limit
0 commit comments