vector/internal_events/
eventstoredb_metrics.rs1use metrics::counter;
2use vector_lib::NamedInternalEvent;
3use vector_lib::internal_event::{InternalEvent, error_stage, error_type};
4
5#[derive(Debug, NamedInternalEvent)]
6pub struct EventStoreDbMetricsHttpError {
7 pub error: crate::Error,
8}
9
10impl InternalEvent for EventStoreDbMetricsHttpError {
11 fn emit(self) {
12 error!(
13 message = "HTTP request processing error.",
14 error = ?self.error,
15 stage = error_stage::RECEIVING,
16 error_type = error_type::REQUEST_FAILED,
17 );
18 counter!(
19 "component_errors_total",
20 "stage" => error_stage::RECEIVING,
21 "error_type" => error_type::REQUEST_FAILED,
22 )
23 .increment(1);
24 }
25}
26
27#[derive(Debug, NamedInternalEvent)]
28pub struct EventStoreDbStatsParsingError {
29 pub error: serde_json::Error,
30}
31
32impl InternalEvent for EventStoreDbStatsParsingError {
33 fn emit(self) {
34 error!(
35 message = "JSON parsing error.",
36 error = ?self.error,
37 stage = error_stage::PROCESSING,
38 error_type = error_type::PARSER_FAILED,
39 );
40 counter!(
41 "component_errors_total",
42 "stage" => error_stage::PROCESSING,
43 "error_type" => error_type::PARSER_FAILED,
44 )
45 .increment(1);
46 }
47}