How It Works
Instead of shipping every log line to the cloud:Creating a Metric Config
Via API
Metric Types
Counter
Counts occurrences of a pattern. Useful for counting events.- HTTP request counts
- Error counts by type
- Event occurrences
Gauge
Captures the current value. Useful for point-in-time measurements.- Queue depths
- Connection counts
- Temperature readings
- Memory usage
Histogram
Tracks value distributions. Useful for latencies and sizes.- Response times
- Payload sizes
- Processing durations
Pattern Syntax
Patterns use regular expressions with capture groups:Common Patterns
HTTP Logs (Apache/Nginx Combined Format)
HTTP Logs (Apache/Nginx Combined Format)
Application Logs (JSON Format)
Application Logs (JSON Format)
Syslog Messages
Syslog Messages
Labels
Labels add dimensions to your metrics, enabling powerful queries:Static Labels
Fixed values that apply to all matches:Dynamic Labels
Captured from the log line:Cardinality Warning
Value Transforms
Transform captured values before recording:Testing Patterns
Test your patterns before deploying:Deployment
Metric configs are automatically synced to agents:- Create/update config via API
- Agents sync every 60 seconds
- New metrics start appearing immediately
Version Control
Configs use optimistic locking. When updating:409 Conflict.
Viewing Metrics
Query metrics from the LogFleet dashboard or via API:Best Practices
Start Simple
Begin with a few key metrics and expand based on needs.
Use Histograms for Latency
Histograms provide percentiles; counters only give averages.
Limit Label Cardinality
Avoid high-cardinality labels that create millions of time series.
Test Patterns
Validate regex patterns against sample logs before deployment.