Internal Metrics
Vector automatically emits internal metrics about its operation, providing visibility into data flow, performance, and errors.Core Metrics
Vector tracks these key metrics for all components:| Metric Name | Type | Description |
|---|---|---|
component_received_events_total | Counter | Total events received by a component |
component_received_bytes_total | Counter | Total bytes received by a component |
component_sent_events_total | Counter | Total events sent by a component |
component_sent_bytes_total | Counter | Total bytes sent by a component |
component_errors_total | Counter | Total errors encountered by a component |
component_allocated_bytes | Gauge | Memory allocated by a component |
uptime_seconds | Gauge | How long Vector has been running |
Exposing Metrics
Vector can expose its internal metrics through various sinks. The most common approach is using a Prometheus sink:Metric Tags
All component metrics include these tags:component_id- The ID of the componentcomponent_type- The type (source, transform, sink)component_kind- The specific component (e.g., “file”, “http”)host- The hostname where Vector is running
Health Checks
Vector supports health checks for all sinks to ensure they can successfully send data before starting.Global Health Check Configuration
Configure health checks globally in your Vector configuration:enabled(default:true) - Enable health checks for all sinksrequire_healthy(default:false) - Exit on startup if any sink fails its health check
Per-Sink Health Checks
Override health check behavior for individual sinks:Command-Line Health Check Control
You can also control health checks via command-line flags:Health Check Endpoint
When the API is enabled, Vector exposes a health endpoint:GraphQL API
Vector’s GraphQL API provides real-time monitoring and introspection capabilities.Enabling the API
Enable the GraphQL API in your configuration:enabled- Enable the GraphQL API (default:false)address- Network address to bind to (default:127.0.0.1:8686)playground- Enable GraphQL Playground UI (default:true)graphql- Enable GraphQL endpoint (default:true)
GraphQL Playground
Access the interactive GraphQL Playground athttp://localhost:8686/playground to explore the API and run queries.
Common GraphQL Queries
Query Component Status
Query Metrics
Monitor Event Throughput
Track Errors
Monitor Uptime
Using the API with Vector Top
Thevector top command uses the GraphQL API to display real-time metrics:
Monitoring Best Practices
1. Always Export Internal Metrics
Configure Vector to send its internal metrics to your monitoring system:2. Set Up Alerting
Create alerts for critical conditions:- Error Rate: Alert when
component_errors_totalincreases rapidly - Throughput Drop: Alert when
component_sent_events_totaldrops significantly - Memory Usage: Alert when
component_allocated_bytesgrows too large - Component Health: Alert when components stop processing data
3. Monitor End-to-End Latency
Track how long it takes for data to flow through your pipeline:4. Use Health Checks in Production
Always enable health checks for production deployments:5. Enable the API for Troubleshooting
Keep the GraphQL API enabled on a secure network to aid troubleshooting:Monitoring in Kubernetes
When running Vector in Kubernetes, expose metrics for Prometheus scraping:Next Steps
- Learn about Troubleshooting Vector issues
- Understand how to Validate configurations
- Review Upgrading procedures