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    SecurityConfinementDisabled,
214}
215
216impl GaugeName {
217    #[must_use]
218    pub const fn as_str(self) -> &'static str {
219        match self {
220            Self::ComponentLatencyMeanSeconds => "component_latency_mean_seconds",
221            Self::SourceBufferMaxSizeEvents => "source_buffer_max_size_events",
222            Self::SourceBufferMaxSizeBytes => "source_buffer_max_size_bytes",
223            Self::SourceBufferMaxEventSize => "source_buffer_max_event_size",
224            Self::SourceBufferMaxByteSize => "source_buffer_max_byte_size",
225            Self::SourceBufferUtilizationLevel => "source_buffer_utilization_level",
226            Self::SourceBufferUtilizationMean => "source_buffer_utilization_mean",
227            Self::TransformBufferMaxSizeEvents => "transform_buffer_max_size_events",
228            Self::TransformBufferMaxSizeBytes => "transform_buffer_max_size_bytes",
229            Self::TransformBufferMaxEventSize => "transform_buffer_max_event_size",
230            Self::TransformBufferMaxByteSize => "transform_buffer_max_byte_size",
231            Self::TransformBufferUtilizationLevel => "transform_buffer_utilization_level",
232            Self::TransformBufferUtilizationMean => "transform_buffer_utilization_mean",
233            Self::BufferMaxSizeEvents => "buffer_max_size_events",
234            Self::BufferMaxEventSize => "buffer_max_event_size",
235            Self::BufferMaxSizeBytes => "buffer_max_size_bytes",
236            Self::BufferMaxByteSize => "buffer_max_byte_size",
237            Self::BufferEvents => "buffer_events",
238            Self::BufferSizeEvents => "buffer_size_events",
239            Self::BufferSizeBytes => "buffer_size_bytes",
240            Self::BufferByteSize => "buffer_byte_size",
241            Self::Utilization => "utilization",
242            Self::ComponentAllocatedBytes => "component_allocated_bytes",
243            Self::OpenFiles => "open_files",
244            Self::UptimeSeconds => "uptime_seconds",
245            Self::BuildInfo => "build_info",
246            Self::KafkaQueueMessages => "kafka_queue_messages",
247            Self::KafkaQueueMessagesBytes => "kafka_queue_messages_bytes",
248            Self::KafkaConsumerLag => "kafka_consumer_lag",
249            Self::LuaMemoryUsedBytes => "lua_memory_used_bytes",
250            Self::OpenConnections => "open_connections",
251            Self::ActiveEndpoints => "active_endpoints",
252            Self::SplunkPendingAcks => "splunk_pending_acks",
253            Self::ActiveClients => "active_clients",
254            Self::MemoryEnrichmentTableObjectsCount => "memory_enrichment_table_objects_count",
255            Self::MemoryEnrichmentTableByteSize => "memory_enrichment_table_byte_size",
256            Self::TagCardinalityTrackedKeys => "tag_cardinality_tracked_keys",
257            Self::SecurityConfinementDisabled => "security_confinement_disabled",
258        }
259    }
260}
261
262impl CounterName {
263    #[allow(clippy::too_many_lines)]
264    #[must_use]
265    pub const fn as_str(self) -> &'static str {
266        match self {
267            Self::ComponentReceivedEventsTotal => "component_received_events_total",
268            Self::ComponentReceivedEventBytesTotal => "component_received_event_bytes_total",
269            Self::ComponentReceivedBytesTotal => "component_received_bytes_total",
270            Self::ComponentSentEventsTotal => "component_sent_events_total",
271            Self::ComponentSentEventBytesTotal => "component_sent_event_bytes_total",
272            Self::ComponentSentBytesTotal => "component_sent_bytes_total",
273            Self::ComponentDiscardedEventsTotal => "component_discarded_events_total",
274            Self::ComponentErrorsTotal => "component_errors_total",
275            Self::ComponentTimedOutEventsTotal => "component_timed_out_events_total",
276            Self::ComponentTimedOutRequestsTotal => "component_timed_out_requests_total",
277            Self::BufferReceivedEventsTotal => "buffer_received_events_total",
278            Self::BufferReceivedBytesTotal => "buffer_received_bytes_total",
279            Self::BufferSentEventsTotal => "buffer_sent_events_total",
280            Self::BufferSentBytesTotal => "buffer_sent_bytes_total",
281            Self::BufferDiscardedEventsTotal => "buffer_discarded_events_total",
282            Self::BufferDiscardedBytesTotal => "buffer_discarded_bytes_total",
283            Self::BufferErrorsTotal => "buffer_errors_total",
284            Self::AggregateEventsRecordedTotal => "aggregate_events_recorded_total",
285            Self::AggregateFailedUpdates => "aggregate_failed_updates",
286            Self::AggregateFlushesTotal => "aggregate_flushes_total",
287            Self::ApiStartedTotal => "api_started_total",
288            Self::CheckpointsTotal => "checkpoints_total",
289            Self::ChecksumErrorsTotal => "checksum_errors_total",
290            Self::CollectCompletedTotal => "collect_completed_total",
291            Self::CommandExecutedTotal => "command_executed_total",
292            Self::ConnectionEstablishedTotal => "connection_established_total",
293            Self::ConnectionSendErrorsTotal => "connection_send_errors_total",
294            Self::ConnectionShutdownTotal => "connection_shutdown_total",
295            Self::ContainerProcessedEventsTotal => "container_processed_events_total",
296            Self::ContainersUnwatchedTotal => "containers_unwatched_total",
297            Self::ContainersWatchedTotal => "containers_watched_total",
298            Self::DecoderBomRemovalsTotal => "decoder_bom_removals_total",
299            Self::DecoderMalformedReplacementWarningsTotal => {
300                "decoder_malformed_replacement_warnings_total"
301            }
302            Self::DorisBytesLoadedTotal => "doris_bytes_loaded_total",
303            Self::DorisRowsFilteredTotal => "doris_rows_filtered_total",
304            Self::DorisRowsLoadedTotal => "doris_rows_loaded_total",
305            Self::EncoderUnmappableReplacementWarningsTotal => {
306                "encoder_unmappable_replacement_warnings_total"
307            }
308            Self::EventsDiscardedTotal => "events_discarded_total",
309            Self::FilesAddedTotal => "files_added_total",
310            Self::FilesDeletedTotal => "files_deleted_total",
311            Self::FilesResumedTotal => "files_resumed_total",
312            Self::FilesUnwatchedTotal => "files_unwatched_total",
313            Self::GrpcServerMessagesReceivedTotal => "grpc_server_messages_received_total",
314            Self::GrpcServerMessagesSentTotal => "grpc_server_messages_sent_total",
315            Self::HttpClientErrorsTotal => "http_client_errors_total",
316            Self::HttpClientRequestsSentTotal => "http_client_requests_sent_total",
317            Self::HttpClientResponsesTotal => "http_client_responses_total",
318            Self::HttpServerRequestsReceivedTotal => "http_server_requests_received_total",
319            Self::HttpServerResponsesSentTotal => "http_server_responses_sent_total",
320            Self::KafkaConsumedMessagesBytesTotal => "kafka_consumed_messages_bytes_total",
321            Self::KafkaConsumedMessagesTotal => "kafka_consumed_messages_total",
322            Self::KafkaProducedMessagesBytesTotal => "kafka_produced_messages_bytes_total",
323            Self::KafkaProducedMessagesTotal => "kafka_produced_messages_total",
324            Self::KafkaRequestsBytesTotal => "kafka_requests_bytes_total",
325            Self::KafkaRequestsTotal => "kafka_requests_total",
326            Self::KafkaResponsesBytesTotal => "kafka_responses_bytes_total",
327            Self::KafkaResponsesTotal => "kafka_responses_total",
328            Self::MetadataRefreshFailedTotal => "metadata_refresh_failed_total",
329            Self::MetadataRefreshSuccessfulTotal => "metadata_refresh_successful_total",
330            Self::ParseErrorsTotal => "parse_errors_total",
331            Self::QuitTotal => "quit_total",
332            Self::ReloadedTotal => "reloaded_total",
333            Self::RewrittenTimestampEventsTotal => "rewritten_timestamp_events_total",
334            Self::SqsMessageDeferSucceededTotal => "sqs_message_defer_succeeded_total",
335            Self::SqsMessageDeleteSucceededTotal => "sqs_message_delete_succeeded_total",
336            Self::SqsMessageProcessingSucceededTotal => "sqs_message_processing_succeeded_total",
337            Self::SqsMessageReceiveSucceededTotal => "sqs_message_receive_succeeded_total",
338            Self::SqsMessageReceivedMessagesTotal => "sqs_message_received_messages_total",
339            Self::StaleEventsFlushedTotal => "stale_events_flushed_total",
340            Self::StartedTotal => "started_total",
341            Self::StoppedTotal => "stopped_total",
342            Self::TagCardinalityUntrackedEventsTotal => "tag_cardinality_untracked_events_total",
343            Self::TagValueLimitExceededTotal => "tag_value_limit_exceeded_total",
344            Self::ValueLimitReachedTotal => "value_limit_reached_total",
345            Self::WebsocketBytesSentTotal => "websocket_bytes_sent_total",
346            Self::WebsocketMessagesSentTotal => "websocket_messages_sent_total",
347            Self::WindowsServiceInstallTotal => "windows_service_install_total",
348            Self::WindowsServiceRestartTotal => "windows_service_restart_total",
349            Self::WindowsServiceStartTotal => "windows_service_start_total",
350            Self::WindowsServiceStopTotal => "windows_service_stop_total",
351            Self::WindowsServiceUninstallTotal => "windows_service_uninstall_total",
352            Self::K8sEventNamespaceAnnotationFailuresTotal => {
353                "k8s_event_namespace_annotation_failures_total"
354            }
355            Self::K8sEventNodeAnnotationFailuresTotal => "k8s_event_node_annotation_failures_total",
356            Self::K8sFormatPickerEdgeCasesTotal => "k8s_format_picker_edge_cases_total",
357            Self::K8sDockerFormatParseFailuresTotal => "k8s_docker_format_parse_failures_total",
358            Self::SqsS3EventRecordIgnoredTotal => "sqs_s3_event_record_ignored_total",
359            Self::ComponentAllocatedBytesTotal => "component_allocated_bytes_total",
360            Self::ComponentDeallocatedBytesTotal => "component_deallocated_bytes_total",
361            Self::MemoryEnrichmentTableFailedInsertions => {
362                "memory_enrichment_table_failed_insertions"
363            }
364            Self::MemoryEnrichmentTableFailedReads => "memory_enrichment_table_failed_reads",
365            Self::MemoryEnrichmentTableFlushesTotal => "memory_enrichment_table_flushes_total",
366            Self::MemoryEnrichmentTableInsertionsTotal => {
367                "memory_enrichment_table_insertions_total"
368            }
369            Self::MemoryEnrichmentTableReadsTotal => "memory_enrichment_table_reads_total",
370            Self::MemoryEnrichmentTableTtlExpirations => "memory_enrichment_table_ttl_expirations",
371            Self::ComponentCpuUsageNsTotal => "component_cpu_usage_ns_total",
372            Self::DatadogLogsReservedAttributeConflictsTotal => {
373                "datadog_logs_reserved_attribute_conflicts_total"
374            }
375        }
376    }
377}