vector/internal_events/
aws_kinesis.rs

1/// Used in both `aws_kinesis_streams` and `aws_kinesis_firehose` sinks
2use metrics::counter;
3use vector_lib::internal_event::InternalEvent;
4use vector_lib::internal_event::{error_stage, error_type, ComponentEventsDropped, UNINTENTIONAL};
5
6#[derive(Debug)]
7pub struct AwsKinesisStreamNoPartitionKeyError<'a> {
8    pub partition_key_field: &'a str,
9}
10
11impl InternalEvent for AwsKinesisStreamNoPartitionKeyError<'_> {
12    fn emit(self) {
13        let reason = "Partition key does not exist.";
14
15        error!(
16            message = reason,
17            partition_key_field = %self.partition_key_field,
18            error_type = error_type::PARSER_FAILED,
19            stage = error_stage::PROCESSING,
20            internal_log_rate_limit = true,
21        );
22
23        counter!(
24            "component_errors_total",
25            "error_type" => error_type::PARSER_FAILED,
26            "stage" => error_stage::PROCESSING,
27        )
28        .increment(1);
29
30        emit!(ComponentEventsDropped::<UNINTENTIONAL> { count: 1, reason });
31    }
32}