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    SourceBufferUtilization,
131    TransformBufferUtilization,
132}
133
134impl HistogramName {
135    #[must_use]
136    pub const fn as_str(self) -> &'static str {
137        match self {
138            Self::ComponentReceivedEventsCount => "component_received_events_count",
139            Self::ComponentReceivedBytes => "component_received_bytes",
140            Self::BufferSendDurationSeconds => "buffer_send_duration_seconds",
141            Self::ComponentLatencySeconds => "component_latency_seconds",
142            Self::SourceLagTimeSeconds => "source_lag_time_seconds",
143            Self::SourceSendLatencySeconds => "source_send_latency_seconds",
144            Self::SourceSendBatchLatencySeconds => "source_send_batch_latency_seconds",
145            Self::AdaptiveConcurrencyAveragedRtt => "adaptive_concurrency_averaged_rtt",
146            Self::AdaptiveConcurrencyBackPressure => "adaptive_concurrency_back_pressure",
147            Self::AdaptiveConcurrencyInFlight => "adaptive_concurrency_in_flight",
148            Self::AdaptiveConcurrencyLimit => "adaptive_concurrency_limit",
149            Self::AdaptiveConcurrencyObservedRtt => "adaptive_concurrency_observed_rtt",
150            Self::AdaptiveConcurrencyPastRttMean => "adaptive_concurrency_past_rtt_mean",
151            Self::AdaptiveConcurrencyReachedLimit => "adaptive_concurrency_reached_limit",
152            Self::S3ObjectProcessingSucceededDurationSeconds => {
153                "s3_object_processing_succeeded_duration_seconds"
154            }
155            Self::S3ObjectProcessingFailedDurationSeconds => {
156                "s3_object_processing_failed_duration_seconds"
157            }
158            Self::CollectDurationSeconds => "collect_duration_seconds",
159            Self::CommandExecutionDurationSeconds => "command_execution_duration_seconds",
160            Self::GrpcServerHandlerDurationSeconds => "grpc_server_handler_duration_seconds",
161            Self::HttpServerHandlerDurationSeconds => "http_server_handler_duration_seconds",
162            Self::HttpClientRttSeconds => "http_client_rtt_seconds",
163            Self::HttpClientResponseRttSeconds => "http_client_response_rtt_seconds",
164            Self::HttpClientErrorRttSeconds => "http_client_error_rtt_seconds",
165            Self::SourceBufferUtilization => "source_buffer_utilization",
166            Self::TransformBufferUtilization => "transform_buffer_utilization",
167        }
168    }
169}
170
171#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Display, AsRefStr, EnumIter)]
172#[strum(serialize_all = "snake_case")]
173pub enum GaugeName {
174    ComponentLatencyMeanSeconds,
175    SourceBufferMaxSizeEvents,
176    SourceBufferMaxSizeBytes,
177    SourceBufferMaxEventSize,
178    SourceBufferMaxByteSize,
179    SourceBufferUtilizationLevel,
180    SourceBufferUtilizationMean,
181    TransformBufferMaxSizeEvents,
182    TransformBufferMaxSizeBytes,
183    TransformBufferMaxEventSize,
184    TransformBufferMaxByteSize,
185    TransformBufferUtilizationLevel,
186    TransformBufferUtilizationMean,
187    BufferMaxSizeEvents,
188    BufferMaxEventSize,
189    BufferMaxSizeBytes,
190    BufferMaxByteSize,
191    BufferEvents,
192    BufferSizeEvents,
193    BufferSizeBytes,
194    BufferByteSize,
195    Utilization,
196    ComponentAllocatedBytes,
197    OpenFiles,
198    UptimeSeconds,
199    BuildInfo,
200    KafkaQueueMessages,
201    KafkaQueueMessagesBytes,
202    KafkaConsumerLag,
203    LuaMemoryUsedBytes,
204    OpenConnections,
205    ActiveEndpoints,
206    SplunkPendingAcks,
207    ActiveClients,
208    MemoryEnrichmentTableObjectsCount,
209    MemoryEnrichmentTableByteSize,
210    TagCardinalityTrackedKeys,
211}
212
213impl GaugeName {
214    #[must_use]
215    pub const fn as_str(self) -> &'static str {
216        match self {
217            Self::ComponentLatencyMeanSeconds => "component_latency_mean_seconds",
218            Self::SourceBufferMaxSizeEvents => "source_buffer_max_size_events",
219            Self::SourceBufferMaxSizeBytes => "source_buffer_max_size_bytes",
220            Self::SourceBufferMaxEventSize => "source_buffer_max_event_size",
221            Self::SourceBufferMaxByteSize => "source_buffer_max_byte_size",
222            Self::SourceBufferUtilizationLevel => "source_buffer_utilization_level",
223            Self::SourceBufferUtilizationMean => "source_buffer_utilization_mean",
224            Self::TransformBufferMaxSizeEvents => "transform_buffer_max_size_events",
225            Self::TransformBufferMaxSizeBytes => "transform_buffer_max_size_bytes",
226            Self::TransformBufferMaxEventSize => "transform_buffer_max_event_size",
227            Self::TransformBufferMaxByteSize => "transform_buffer_max_byte_size",
228            Self::TransformBufferUtilizationLevel => "transform_buffer_utilization_level",
229            Self::TransformBufferUtilizationMean => "transform_buffer_utilization_mean",
230            Self::BufferMaxSizeEvents => "buffer_max_size_events",
231            Self::BufferMaxEventSize => "buffer_max_event_size",
232            Self::BufferMaxSizeBytes => "buffer_max_size_bytes",
233            Self::BufferMaxByteSize => "buffer_max_byte_size",
234            Self::BufferEvents => "buffer_events",
235            Self::BufferSizeEvents => "buffer_size_events",
236            Self::BufferSizeBytes => "buffer_size_bytes",
237            Self::BufferByteSize => "buffer_byte_size",
238            Self::Utilization => "utilization",
239            Self::ComponentAllocatedBytes => "component_allocated_bytes",
240            Self::OpenFiles => "open_files",
241            Self::UptimeSeconds => "uptime_seconds",
242            Self::BuildInfo => "build_info",
243            Self::KafkaQueueMessages => "kafka_queue_messages",
244            Self::KafkaQueueMessagesBytes => "kafka_queue_messages_bytes",
245            Self::KafkaConsumerLag => "kafka_consumer_lag",
246            Self::LuaMemoryUsedBytes => "lua_memory_used_bytes",
247            Self::OpenConnections => "open_connections",
248            Self::ActiveEndpoints => "active_endpoints",
249            Self::SplunkPendingAcks => "splunk_pending_acks",
250            Self::ActiveClients => "active_clients",
251            Self::MemoryEnrichmentTableObjectsCount => "memory_enrichment_table_objects_count",
252            Self::MemoryEnrichmentTableByteSize => "memory_enrichment_table_byte_size",
253            Self::TagCardinalityTrackedKeys => "tag_cardinality_tracked_keys",
254        }
255    }
256}
257
258impl CounterName {
259    #[allow(clippy::too_many_lines)]
260    #[must_use]
261    pub const fn as_str(self) -> &'static str {
262        match self {
263            Self::ComponentReceivedEventsTotal => "component_received_events_total",
264            Self::ComponentReceivedEventBytesTotal => "component_received_event_bytes_total",
265            Self::ComponentReceivedBytesTotal => "component_received_bytes_total",
266            Self::ComponentSentEventsTotal => "component_sent_events_total",
267            Self::ComponentSentEventBytesTotal => "component_sent_event_bytes_total",
268            Self::ComponentSentBytesTotal => "component_sent_bytes_total",
269            Self::ComponentDiscardedEventsTotal => "component_discarded_events_total",
270            Self::ComponentErrorsTotal => "component_errors_total",
271            Self::ComponentTimedOutEventsTotal => "component_timed_out_events_total",
272            Self::ComponentTimedOutRequestsTotal => "component_timed_out_requests_total",
273            Self::BufferReceivedEventsTotal => "buffer_received_events_total",
274            Self::BufferReceivedBytesTotal => "buffer_received_bytes_total",
275            Self::BufferSentEventsTotal => "buffer_sent_events_total",
276            Self::BufferSentBytesTotal => "buffer_sent_bytes_total",
277            Self::BufferDiscardedEventsTotal => "buffer_discarded_events_total",
278            Self::BufferDiscardedBytesTotal => "buffer_discarded_bytes_total",
279            Self::BufferErrorsTotal => "buffer_errors_total",
280            Self::AggregateEventsRecordedTotal => "aggregate_events_recorded_total",
281            Self::AggregateFailedUpdates => "aggregate_failed_updates",
282            Self::AggregateFlushesTotal => "aggregate_flushes_total",
283            Self::ApiStartedTotal => "api_started_total",
284            Self::CheckpointsTotal => "checkpoints_total",
285            Self::ChecksumErrorsTotal => "checksum_errors_total",
286            Self::CollectCompletedTotal => "collect_completed_total",
287            Self::CommandExecutedTotal => "command_executed_total",
288            Self::ConnectionEstablishedTotal => "connection_established_total",
289            Self::ConnectionSendErrorsTotal => "connection_send_errors_total",
290            Self::ConnectionShutdownTotal => "connection_shutdown_total",
291            Self::ContainerProcessedEventsTotal => "container_processed_events_total",
292            Self::ContainersUnwatchedTotal => "containers_unwatched_total",
293            Self::ContainersWatchedTotal => "containers_watched_total",
294            Self::DecoderBomRemovalsTotal => "decoder_bom_removals_total",
295            Self::DecoderMalformedReplacementWarningsTotal => {
296                "decoder_malformed_replacement_warnings_total"
297            }
298            Self::DorisBytesLoadedTotal => "doris_bytes_loaded_total",
299            Self::DorisRowsFilteredTotal => "doris_rows_filtered_total",
300            Self::DorisRowsLoadedTotal => "doris_rows_loaded_total",
301            Self::EncoderUnmappableReplacementWarningsTotal => {
302                "encoder_unmappable_replacement_warnings_total"
303            }
304            Self::EventsDiscardedTotal => "events_discarded_total",
305            Self::FilesAddedTotal => "files_added_total",
306            Self::FilesDeletedTotal => "files_deleted_total",
307            Self::FilesResumedTotal => "files_resumed_total",
308            Self::FilesUnwatchedTotal => "files_unwatched_total",
309            Self::GrpcServerMessagesReceivedTotal => "grpc_server_messages_received_total",
310            Self::GrpcServerMessagesSentTotal => "grpc_server_messages_sent_total",
311            Self::HttpClientErrorsTotal => "http_client_errors_total",
312            Self::HttpClientRequestsSentTotal => "http_client_requests_sent_total",
313            Self::HttpClientResponsesTotal => "http_client_responses_total",
314            Self::HttpServerRequestsReceivedTotal => "http_server_requests_received_total",
315            Self::HttpServerResponsesSentTotal => "http_server_responses_sent_total",
316            Self::KafkaConsumedMessagesBytesTotal => "kafka_consumed_messages_bytes_total",
317            Self::KafkaConsumedMessagesTotal => "kafka_consumed_messages_total",
318            Self::KafkaProducedMessagesBytesTotal => "kafka_produced_messages_bytes_total",
319            Self::KafkaProducedMessagesTotal => "kafka_produced_messages_total",
320            Self::KafkaRequestsBytesTotal => "kafka_requests_bytes_total",
321            Self::KafkaRequestsTotal => "kafka_requests_total",
322            Self::KafkaResponsesBytesTotal => "kafka_responses_bytes_total",
323            Self::KafkaResponsesTotal => "kafka_responses_total",
324            Self::MetadataRefreshFailedTotal => "metadata_refresh_failed_total",
325            Self::MetadataRefreshSuccessfulTotal => "metadata_refresh_successful_total",
326            Self::ParseErrorsTotal => "parse_errors_total",
327            Self::QuitTotal => "quit_total",
328            Self::ReloadedTotal => "reloaded_total",
329            Self::RewrittenTimestampEventsTotal => "rewritten_timestamp_events_total",
330            Self::SqsMessageDeferSucceededTotal => "sqs_message_defer_succeeded_total",
331            Self::SqsMessageDeleteSucceededTotal => "sqs_message_delete_succeeded_total",
332            Self::SqsMessageProcessingSucceededTotal => "sqs_message_processing_succeeded_total",
333            Self::SqsMessageReceiveSucceededTotal => "sqs_message_receive_succeeded_total",
334            Self::SqsMessageReceivedMessagesTotal => "sqs_message_received_messages_total",
335            Self::StaleEventsFlushedTotal => "stale_events_flushed_total",
336            Self::StartedTotal => "started_total",
337            Self::StoppedTotal => "stopped_total",
338            Self::TagCardinalityUntrackedEventsTotal => "tag_cardinality_untracked_events_total",
339            Self::TagValueLimitExceededTotal => "tag_value_limit_exceeded_total",
340            Self::ValueLimitReachedTotal => "value_limit_reached_total",
341            Self::WebsocketBytesSentTotal => "websocket_bytes_sent_total",
342            Self::WebsocketMessagesSentTotal => "websocket_messages_sent_total",
343            Self::WindowsServiceInstallTotal => "windows_service_install_total",
344            Self::WindowsServiceRestartTotal => "windows_service_restart_total",
345            Self::WindowsServiceStartTotal => "windows_service_start_total",
346            Self::WindowsServiceStopTotal => "windows_service_stop_total",
347            Self::WindowsServiceUninstallTotal => "windows_service_uninstall_total",
348            Self::K8sEventNamespaceAnnotationFailuresTotal => {
349                "k8s_event_namespace_annotation_failures_total"
350            }
351            Self::K8sEventNodeAnnotationFailuresTotal => "k8s_event_node_annotation_failures_total",
352            Self::K8sFormatPickerEdgeCasesTotal => "k8s_format_picker_edge_cases_total",
353            Self::K8sDockerFormatParseFailuresTotal => "k8s_docker_format_parse_failures_total",
354            Self::SqsS3EventRecordIgnoredTotal => "sqs_s3_event_record_ignored_total",
355            Self::ComponentAllocatedBytesTotal => "component_allocated_bytes_total",
356            Self::ComponentDeallocatedBytesTotal => "component_deallocated_bytes_total",
357            Self::MemoryEnrichmentTableFailedInsertions => {
358                "memory_enrichment_table_failed_insertions"
359            }
360            Self::MemoryEnrichmentTableFailedReads => "memory_enrichment_table_failed_reads",
361            Self::MemoryEnrichmentTableFlushesTotal => "memory_enrichment_table_flushes_total",
362            Self::MemoryEnrichmentTableInsertionsTotal => {
363                "memory_enrichment_table_insertions_total"
364            }
365            Self::MemoryEnrichmentTableReadsTotal => "memory_enrichment_table_reads_total",
366            Self::MemoryEnrichmentTableTtlExpirations => "memory_enrichment_table_ttl_expirations",
367        }
368    }
369}