vector/internal_events/
conditions.rs1use metrics::counter;
2use vector_lib::NamedInternalEvent;
3use vector_lib::internal_event::{InternalEvent, error_stage, error_type};
4
5#[derive(Debug, Copy, Clone, NamedInternalEvent)]
6pub struct VrlConditionExecutionError<'a> {
7 pub error: &'a str,
8}
9
10impl InternalEvent for VrlConditionExecutionError<'_> {
11 fn emit(self) {
12 error!(
13 message = "VRL condition execution failed.",
14 error = %self.error,
15 error_type = error_type::SCRIPT_FAILED,
16 stage = error_stage::PROCESSING,
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}