Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhancement(splunk_hec_metrics sink): Comply to *EventsDropped instrumentation spec in splunk_hec_metrics sink #14514

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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