Skip to content

Commit

Permalink
Comply to *EventsDropped instrumentation spec in `splunk_hec_metric…
Browse files Browse the repository at this point in the history
…s` sink

Signed-off-by: Pablo Sichert <[email protected]>
  • Loading branch information
pablosichert committed Sep 21, 2022
1 parent ab3ca33 commit e0bbe14
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/internal_events/splunk_hec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ mod sink {
use vector_core::internal_event::InternalEvent;

use crate::{
emit,
event::metric::{MetricKind, MetricValue},
internal_events::{ComponentEventsDropped, UNINTENTIONAL},
sinks::splunk_hec::common::acknowledgements::HecAckApiError,
};
use vector_common::internal_event::{error_stage, error_type};
Expand All @@ -24,8 +26,9 @@ mod sink {

impl InternalEvent for SplunkEventEncodeError {
fn emit(self) {
let reason = "Failed to encode Splunk HEC event as JSON.";
error!(
message = "Error encoding Splunk HEC event to JSON.",
message = reason,
error = ?self.error,
error_code = "serializing_json",
error_type = error_type::ENCODER_FAILED,
Expand All @@ -38,6 +41,7 @@ mod sink {
"error_type" => error_type::ENCODER_FAILED,
"stage" => error_stage::PROCESSING,
);
emit!(ComponentEventsDropped::<UNINTENTIONAL> { count: 1, reason });
}
}

Expand Down

0 comments on commit e0bbe14

Please sign in to comment.