Overview
LogFleet uses Vector for log collection at the edge. The default configuration provides:
- HTTP JSON input on port 9880
- Syslog UDP input on port 514
- Automatic enrichment with edge metadata
- Metric extraction for counters and gauges
- Local Loki storage with configurable retention
Default Sources
HTTP JSON (Primary)
Send JSON logs via HTTP POST:
Optional Headers:
X-Device-ID: Device identifier
X-Source-Type: Device type (e.g., “pos”, “kiosk”)
X-Service: Service name
Syslog UDP
Send standard syslog messages:
Syslog severity is automatically mapped to log levels:
- 0-3: error
- 4: warn
- 5-6: info
- 7: debug
Automatic Enrichment
All logs are automatically enriched with:
Vector extracts metrics from logs automatically, reducing bandwidth by 100-1000x.
Automatic Metrics
Emit Business Events
Include an event field in your logs to create business metrics:
This creates three metrics:
edge.events{event="order_completed", location_id="..."} (counter)
edge.order_value{location_id="..."} (gauge: 24.99)
edge.latency_ms{location_id="..."} (gauge: 150)
Loki Labels
Logs are stored in Loki with these labels:
Keep label cardinality low. High cardinality labels (like user IDs) can overwhelm Loki.
Customizing Vector Config
Override with Volume Mount
Mount a custom config file:
Add File Tailing
To collect from log files:
Add Custom Metrics
Extract additional metrics from specific log patterns:
Datadog Integration
By default, metrics are sent to Datadog (if DATADOG_API_KEY is set):
Cost Optimization:
- Metrics are aggregated over 5-minute windows (99%+ reduction)
- Only business metrics are sent (no internal Vector metrics)
- Counters preferred over histograms (12x fewer data points)
Prometheus Metrics
A Prometheus exporter runs on port 9598 for local monitoring:
Debugging
Enable Console Output
Uncomment the console sink in your Vector config:
Validate Configuration
Check Vector API
Environment Variables
Full Default Configuration
The complete default Vector configuration is available at:
github.com/sadhiappan/logfleet/blob/main/agent/configs/vector/vector.toml