Skip to main content

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