repo_description: A high-performance observability data pipeline.
repo_topics: agent cloud-native data-transformation datadog etl events forwarder hacktoberfest high-performance logs metrics monitoring observability pipelines rust-lang stream-processing telemetry traces
code: use metrics::counter;
  use vector_lib::NamedInternalEvent;
  use vector_lib::internal_event::{InternalEvent, error_stage, error_type};
  
  #[derive(Debug, NamedInternalEvent)]
  pub(crate) struct DnstapParseError<E> {
      pub error: E,
  }
  
  impl<E: std::fmt::Display> InternalEvent for DnstapParseError<E> {
      fn emit(self) {
          error!(
              message = "Error occurred while parsing dnstap data.",
              error = %self.error,
              stage = error_stage::PROCESSING,
              error_type = error_type::PARSER_FAILED,
          );
          counter!(
              "component_errors_total",
              "stage" => error_stage::PROCESSING,
              "error_type" => error_type::PARSER_FAILED,
          )
          .increment(1);
      }
  }
  