vector/internal_events/
conditions.rs

1use metrics::counter;
2use vector_lib::internal_event::{InternalEvent, error_stage, error_type};
3
4#[derive(Debug, Copy, Clone)]
5pub struct VrlConditionExecutionError<'a> {
6    pub error: &'a str,
7}
8
9impl InternalEvent for VrlConditionExecutionError<'_> {
10    fn emit(self) {
11        error!(
12            message = "VRL condition execution failed.",
13            error = %self.error,
14            error_type = error_type::SCRIPT_FAILED,
15            stage = error_stage::PROCESSING,
16            internal_log_rate_limit = true,
17        );
18        counter!(
19            "component_errors_total",
20            "error_type" => error_type::SCRIPT_FAILED,
21            "stage" => error_stage::PROCESSING,
22        )
23        .increment(1);
24    }
25}