vector_common/internal_event/
metric_name.rs

1use strum::{AsRefStr, Display, EnumIter};
2
3/// Canonical list of all per-component internal metric names emitted by Vector.
4#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Display, AsRefStr, EnumIter)]
5#[strum(serialize_all = "snake_case")]
6pub enum CounterName {
7    ComponentReceivedEventsTotal,
8    ComponentReceivedEventBytesTotal,
9    ComponentReceivedBytesTotal,
10    ComponentSentEventsTotal,
11    ComponentSentEventBytesTotal,
12    ComponentSentBytesTotal,
13    ComponentDiscardedEventsTotal,
14    ComponentErrorsTotal,
15    ComponentTimedOutEventsTotal,
16    ComponentTimedOutRequestsTotal,
17    BufferReceivedEventsTotal,
18    BufferReceivedBytesTotal,
19    BufferSentEventsTotal,
20    BufferSentBytesTotal,
21    BufferDiscardedEventsTotal,
22    BufferDiscardedBytesTotal,
23    BufferErrorsTotal,
24    // Internal events from src/internal_events/
25    AggregateEventsRecordedTotal,
26    AggregateFailedUpdates,
27    AggregateFlushesTotal,
28    ApiStartedTotal,
29    CheckpointsTotal,
30    ChecksumErrorsTotal,
31    CollectCompletedTotal,
32    CommandExecutedTotal,
33    ConnectionEstablishedTotal,
34    ConnectionSendErrorsTotal,
35    ConnectionShutdownTotal,
36    ContainerProcessedEventsTotal,
37    ContainersUnwatchedTotal,
38    ContainersWatchedTotal,
39    DecoderBomRemovalsTotal,
40    DecoderMalformedReplacementWarningsTotal,
41    DorisBytesLoadedTotal,
42    DorisRowsFilteredTotal,
43    DorisRowsLoadedTotal,
44    EncoderUnmappableReplacementWarningsTotal,
45    EventsDiscardedTotal,
46    FilesAddedTotal,
47    FilesDeletedTotal,
48    FilesResumedTotal,
49    FilesUnwatchedTotal,
50    GrpcServerMessagesReceivedTotal,
51    GrpcServerMessagesSentTotal,
52    HttpClientErrorsTotal,
53    HttpClientRequestsSentTotal,
54    HttpClientResponsesTotal,
55    HttpServerRequestsReceivedTotal,
56    HttpServerResponsesSentTotal,
57    KafkaConsumedMessagesBytesTotal,
58    KafkaConsumedMessagesTotal,
59    KafkaProducedMessagesBytesTotal,
60    KafkaProducedMessagesTotal,
61    KafkaRequestsBytesTotal,
62    KafkaRequestsTotal,
63    KafkaResponsesBytesTotal,
64    KafkaResponsesTotal,
65    MetadataRefreshFailedTotal,
66    MetadataRefreshSuccessfulTotal,
67    ParseErrorsTotal,
68    QuitTotal,
69    ReloadedTotal,
70    RewrittenTimestampEventsTotal,
71    SqsMessageDeferSucceededTotal,
72    SqsMessageDeleteSucceededTotal,
73    SqsMessageProcessingSucceededTotal,
74    SqsMessageReceiveSucceededTotal,
75    SqsMessageReceivedMessagesTotal,
76    StaleEventsFlushedTotal,
77    StartedTotal,
78    StoppedTotal,
79    TagCardinalityUntrackedEventsTotal,
80    TagValueLimitExceededTotal,
81    ValueLimitReachedTotal,
82    WebsocketBytesSentTotal,
83    WebsocketMessagesSentTotal,
84    WindowsServiceInstallTotal,
85    WindowsServiceRestartTotal,
86    WindowsServiceStartTotal,
87    WindowsServiceStopTotal,
88    WindowsServiceUninstallTotal,
89    K8sEventNamespaceAnnotationFailuresTotal,
90    K8sEventNodeAnnotationFailuresTotal,
91    K8sFormatPickerEdgeCasesTotal,
92    K8sDockerFormatParseFailuresTotal,
93    SqsS3EventRecordIgnoredTotal,
94    ComponentAllocatedBytesTotal,
95    ComponentDeallocatedBytesTotal,
96    MemoryEnrichmentTableFailedInsertions,
97    MemoryEnrichmentTableFailedReads,
98    MemoryEnrichmentTableFlushesTotal,
99    MemoryEnrichmentTableInsertionsTotal,
100    MemoryEnrichmentTableReadsTotal,
101    MemoryEnrichmentTableTtlExpirations,
102}
103
104#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Display, AsRefStr, EnumIter)]
105#[strum(serialize_all = "snake_case")]
106pub enum HistogramName {
107    ComponentReceivedEventsCount,
108    ComponentReceivedBytes,
109    BufferSendDurationSeconds,
110    ComponentLatencySeconds,
111    SourceLagTimeSeconds,
112    SourceSendLatencySeconds,
113    SourceSendBatchLatencySeconds,
114    AdaptiveConcurrencyAveragedRtt,
115    AdaptiveConcurrencyBackPressure,
116    AdaptiveConcurrencyInFlight,
117    AdaptiveConcurrencyLimit,
118    AdaptiveConcurrencyObservedRtt,
119    AdaptiveConcurrencyPastRttMean,
120    AdaptiveConcurrencyReachedLimit,
121    S3ObjectProcessingSucceededDurationSeconds,
122    S3ObjectProcessingFailedDurationSeconds,
123    CollectDurationSeconds,
124    CommandExecutionDurationSeconds,
125    GrpcServerHandlerDurationSeconds,
126    HttpServerHandlerDurationSeconds,
127    HttpClientRttSeconds,
128    HttpClientResponseRttSeconds,
129    HttpClientErrorRttSeconds,
130}
131
132impl HistogramName {
133    #[must_use]
134    pub const fn as_str(self) -> &'static str {
135        match self {
136            Self::ComponentReceivedEventsCount => "component_received_events_count",
137            Self::ComponentReceivedBytes => "component_received_bytes",
138            Self::BufferSendDurationSeconds => "buffer_send_duration_seconds",
139            Self::ComponentLatencySeconds => "component_latency_seconds",
140            Self::SourceLagTimeSeconds => "source_lag_time_seconds",
141            Self::SourceSendLatencySeconds => "source_send_latency_seconds",
142            Self::SourceSendBatchLatencySeconds => "source_send_batch_latency_seconds",
143            Self::AdaptiveConcurrencyAveragedRtt => "adaptive_concurrency_averaged_rtt",
144            Self::AdaptiveConcurrencyBackPressure => "adaptive_concurrency_back_pressure",
145            Self::AdaptiveConcurrencyInFlight => "adaptive_concurrency_in_flight",
146            Self::AdaptiveConcurrencyLimit => "adaptive_concurrency_limit",
147            Self::AdaptiveConcurrencyObservedRtt => "adaptive_concurrency_observed_rtt",
148            Self::AdaptiveConcurrencyPastRttMean => "adaptive_concurrency_past_rtt_mean",
149            Self::AdaptiveConcurrencyReachedLimit => "adaptive_concurrency_reached_limit",
150            Self::S3ObjectProcessingSucceededDurationSeconds => {
151                "s3_object_processing_succeeded_duration_seconds"
152            }
153            Self::S3ObjectProcessingFailedDurationSeconds => {
154                "s3_object_processing_failed_duration_seconds"
155            }
156            Self::CollectDurationSeconds => "collect_duration_seconds",
157            Self::CommandExecutionDurationSeconds => "command_execution_duration_seconds",
158            Self::GrpcServerHandlerDurationSeconds => "grpc_server_handler_duration_seconds",
159            Self::HttpServerHandlerDurationSeconds => "http_server_handler_duration_seconds",
160            Self::HttpClientRttSeconds => "http_client_rtt_seconds",
161            Self::HttpClientResponseRttSeconds => "http_client_response_rtt_seconds",
162            Self::HttpClientErrorRttSeconds => "http_client_error_rtt_seconds",
163        }
164    }
165}
166
167#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Display, AsRefStr, EnumIter)]
168#[strum(serialize_all = "snake_case")]
169pub enum GaugeName {
170    ComponentLatencyMeanSeconds,
171    BufferMaxSizeEvents,
172    BufferMaxEventSize,
173    BufferMaxSizeBytes,
174    BufferMaxByteSize,
175    BufferEvents,
176    BufferSizeEvents,
177    BufferSizeBytes,
178    BufferByteSize,
179    Utilization,
180    ComponentAllocatedBytes,
181    OpenFiles,
182    UptimeSeconds,
183    BuildInfo,
184    KafkaQueueMessages,
185    KafkaQueueMessagesBytes,
186    KafkaConsumerLag,
187    LuaMemoryUsedBytes,
188    OpenConnections,
189    ActiveEndpoints,
190    SplunkPendingAcks,
191    ActiveClients,
192    MemoryEnrichmentTableObjectsCount,
193    MemoryEnrichmentTableByteSize,
194    TagCardinalityTrackedKeys,
195}
196
197impl GaugeName {
198    #[must_use]
199    pub const fn as_str(self) -> &'static str {
200        match self {
201            Self::ComponentLatencyMeanSeconds => "component_latency_mean_seconds",
202            Self::BufferMaxSizeEvents => "buffer_max_size_events",
203            Self::BufferMaxEventSize => "buffer_max_event_size",
204            Self::BufferMaxSizeBytes => "buffer_max_size_bytes",
205            Self::BufferMaxByteSize => "buffer_max_byte_size",
206            Self::BufferEvents => "buffer_events",
207            Self::BufferSizeEvents => "buffer_size_events",
208            Self::BufferSizeBytes => "buffer_size_bytes",
209            Self::BufferByteSize => "buffer_byte_size",
210            Self::Utilization => "utilization",
211            Self::ComponentAllocatedBytes => "component_allocated_bytes",
212            Self::OpenFiles => "open_files",
213            Self::UptimeSeconds => "uptime_seconds",
214            Self::BuildInfo => "build_info",
215            Self::KafkaQueueMessages => "kafka_queue_messages",
216            Self::KafkaQueueMessagesBytes => "kafka_queue_messages_bytes",
217            Self::KafkaConsumerLag => "kafka_consumer_lag",
218            Self::LuaMemoryUsedBytes => "lua_memory_used_bytes",
219            Self::OpenConnections => "open_connections",
220            Self::ActiveEndpoints => "active_endpoints",
221            Self::SplunkPendingAcks => "splunk_pending_acks",
222            Self::ActiveClients => "active_clients",
223            Self::MemoryEnrichmentTableObjectsCount => "memory_enrichment_table_objects_count",
224            Self::MemoryEnrichmentTableByteSize => "memory_enrichment_table_byte_size",
225            Self::TagCardinalityTrackedKeys => "tag_cardinality_tracked_keys",
226        }
227    }
228}
229
230impl CounterName {
231    #[allow(clippy::too_many_lines)]
232    #[must_use]
233    pub const fn as_str(self) -> &'static str {
234        match self {
235            Self::ComponentReceivedEventsTotal => "component_received_events_total",
236            Self::ComponentReceivedEventBytesTotal => "component_received_event_bytes_total",
237            Self::ComponentReceivedBytesTotal => "component_received_bytes_total",
238            Self::ComponentSentEventsTotal => "component_sent_events_total",
239            Self::ComponentSentEventBytesTotal => "component_sent_event_bytes_total",
240            Self::ComponentSentBytesTotal => "component_sent_bytes_total",
241            Self::ComponentDiscardedEventsTotal => "component_discarded_events_total",
242            Self::ComponentErrorsTotal => "component_errors_total",
243            Self::ComponentTimedOutEventsTotal => "component_timed_out_events_total",
244            Self::ComponentTimedOutRequestsTotal => "component_timed_out_requests_total",
245            Self::BufferReceivedEventsTotal => "buffer_received_events_total",
246            Self::BufferReceivedBytesTotal => "buffer_received_bytes_total",
247            Self::BufferSentEventsTotal => "buffer_sent_events_total",
248            Self::BufferSentBytesTotal => "buffer_sent_bytes_total",
249            Self::BufferDiscardedEventsTotal => "buffer_discarded_events_total",
250            Self::BufferDiscardedBytesTotal => "buffer_discarded_bytes_total",
251            Self::BufferErrorsTotal => "buffer_errors_total",
252            Self::AggregateEventsRecordedTotal => "aggregate_events_recorded_total",
253            Self::AggregateFailedUpdates => "aggregate_failed_updates",
254            Self::AggregateFlushesTotal => "aggregate_flushes_total",
255            Self::ApiStartedTotal => "api_started_total",
256            Self::CheckpointsTotal => "checkpoints_total",
257            Self::ChecksumErrorsTotal => "checksum_errors_total",
258            Self::CollectCompletedTotal => "collect_completed_total",
259            Self::CommandExecutedTotal => "command_executed_total",
260            Self::ConnectionEstablishedTotal => "connection_established_total",
261            Self::ConnectionSendErrorsTotal => "connection_send_errors_total",
262            Self::ConnectionShutdownTotal => "connection_shutdown_total",
263            Self::ContainerProcessedEventsTotal => "container_processed_events_total",
264            Self::ContainersUnwatchedTotal => "containers_unwatched_total",
265            Self::ContainersWatchedTotal => "containers_watched_total",
266            Self::DecoderBomRemovalsTotal => "decoder_bom_removals_total",
267            Self::DecoderMalformedReplacementWarningsTotal => {
268                "decoder_malformed_replacement_warnings_total"
269            }
270            Self::DorisBytesLoadedTotal => "doris_bytes_loaded_total",
271            Self::DorisRowsFilteredTotal => "doris_rows_filtered_total",
272            Self::DorisRowsLoadedTotal => "doris_rows_loaded_total",
273            Self::EncoderUnmappableReplacementWarningsTotal => {
274                "encoder_unmappable_replacement_warnings_total"
275            }
276            Self::EventsDiscardedTotal => "events_discarded_total",
277            Self::FilesAddedTotal => "files_added_total",
278            Self::FilesDeletedTotal => "files_deleted_total",
279            Self::FilesResumedTotal => "files_resumed_total",
280            Self::FilesUnwatchedTotal => "files_unwatched_total",
281            Self::GrpcServerMessagesReceivedTotal => "grpc_server_messages_received_total",
282            Self::GrpcServerMessagesSentTotal => "grpc_server_messages_sent_total",
283            Self::HttpClientErrorsTotal => "http_client_errors_total",
284            Self::HttpClientRequestsSentTotal => "http_client_requests_sent_total",
285            Self::HttpClientResponsesTotal => "http_client_responses_total",
286            Self::HttpServerRequestsReceivedTotal => "http_server_requests_received_total",
287            Self::HttpServerResponsesSentTotal => "http_server_responses_sent_total",
288            Self::KafkaConsumedMessagesBytesTotal => "kafka_consumed_messages_bytes_total",
289            Self::KafkaConsumedMessagesTotal => "kafka_consumed_messages_total",
290            Self::KafkaProducedMessagesBytesTotal => "kafka_produced_messages_bytes_total",
291            Self::KafkaProducedMessagesTotal => "kafka_produced_messages_total",
292            Self::KafkaRequestsBytesTotal => "kafka_requests_bytes_total",
293            Self::KafkaRequestsTotal => "kafka_requests_total",
294            Self::KafkaResponsesBytesTotal => "kafka_responses_bytes_total",
295            Self::KafkaResponsesTotal => "kafka_responses_total",
296            Self::MetadataRefreshFailedTotal => "metadata_refresh_failed_total",
297            Self::MetadataRefreshSuccessfulTotal => "metadata_refresh_successful_total",
298            Self::ParseErrorsTotal => "parse_errors_total",
299            Self::QuitTotal => "quit_total",
300            Self::ReloadedTotal => "reloaded_total",
301            Self::RewrittenTimestampEventsTotal => "rewritten_timestamp_events_total",
302            Self::SqsMessageDeferSucceededTotal => "sqs_message_defer_succeeded_total",
303            Self::SqsMessageDeleteSucceededTotal => "sqs_message_delete_succeeded_total",
304            Self::SqsMessageProcessingSucceededTotal => "sqs_message_processing_succeeded_total",
305            Self::SqsMessageReceiveSucceededTotal => "sqs_message_receive_succeeded_total",
306            Self::SqsMessageReceivedMessagesTotal => "sqs_message_received_messages_total",
307            Self::StaleEventsFlushedTotal => "stale_events_flushed_total",
308            Self::StartedTotal => "started_total",
309            Self::StoppedTotal => "stopped_total",
310            Self::TagCardinalityUntrackedEventsTotal => "tag_cardinality_untracked_events_total",
311            Self::TagValueLimitExceededTotal => "tag_value_limit_exceeded_total",
312            Self::ValueLimitReachedTotal => "value_limit_reached_total",
313            Self::WebsocketBytesSentTotal => "websocket_bytes_sent_total",
314            Self::WebsocketMessagesSentTotal => "websocket_messages_sent_total",
315            Self::WindowsServiceInstallTotal => "windows_service_install_total",
316            Self::WindowsServiceRestartTotal => "windows_service_restart_total",
317            Self::WindowsServiceStartTotal => "windows_service_start_total",
318            Self::WindowsServiceStopTotal => "windows_service_stop_total",
319            Self::WindowsServiceUninstallTotal => "windows_service_uninstall_total",
320            Self::K8sEventNamespaceAnnotationFailuresTotal => {
321                "k8s_event_namespace_annotation_failures_total"
322            }
323            Self::K8sEventNodeAnnotationFailuresTotal => "k8s_event_node_annotation_failures_total",
324            Self::K8sFormatPickerEdgeCasesTotal => "k8s_format_picker_edge_cases_total",
325            Self::K8sDockerFormatParseFailuresTotal => "k8s_docker_format_parse_failures_total",
326            Self::SqsS3EventRecordIgnoredTotal => "sqs_s3_event_record_ignored_total",
327            Self::ComponentAllocatedBytesTotal => "component_allocated_bytes_total",
328            Self::ComponentDeallocatedBytesTotal => "component_deallocated_bytes_total",
329            Self::MemoryEnrichmentTableFailedInsertions => {
330                "memory_enrichment_table_failed_insertions"
331            }
332            Self::MemoryEnrichmentTableFailedReads => "memory_enrichment_table_failed_reads",
333            Self::MemoryEnrichmentTableFlushesTotal => "memory_enrichment_table_flushes_total",
334            Self::MemoryEnrichmentTableInsertionsTotal => {
335                "memory_enrichment_table_insertions_total"
336            }
337            Self::MemoryEnrichmentTableReadsTotal => "memory_enrichment_table_reads_total",
338            Self::MemoryEnrichmentTableTtlExpirations => "memory_enrichment_table_ttl_expirations",
339        }
340    }
341}