Promtail
Datable integrates with Promtail, Grafana's log collection agent, to aggregate logs from various sources and forward them for analysis. Promtail is particularly effective for Kubernetes environments and systemd journal collection.
How it works
Promtail discovers log sources, labels them with metadata, and streams log entries to Datable using the Loki push API protocol. It can tail files, receive syslog, collect from journald, and scrape logs from Kubernetes pods.
Prerequisites
- Promtail 2.x or later
- Network connectivity to Datable endpoints
- Access to log files or services
Setup Instructions
Step 1: Install Promtail
- Install Promtail on your system. Refer to the official installation guide for detailed instructions.
Step 2: Generate API Key in Datable
- Navigate to Sources in Datable
- Select Promtail
- Enter a source name
- Review the generated configuration snippet
Step 3: Configure Promtail
- Combined your existing
promtail.yml
with the snippet provided by Datable. - Restart Promtail to apply the new configuration.
Troubleshooting
No Logs Appearing
- Check Promtail is running:
systemctl status promtail
- Verify API key is correct
- Review Promtail logs:
journalctl -u promtail -f
- Check positions file for progress
Connection Errors
- Verify network connectivity
- Check TLS configuration
- Review firewall rules
- Validate URL format
High Memory Usage
- Reduce batch size
- Limit number of active streams
- Adjust readline rate limits
- Check for memory leaks in pipeline stages
Permission Denied
- Ensure Promtail has read access to log files
- Check SELinux/AppArmor policies
- Verify container volume mounts
- Review file ownership
Best Practices
- Use Service Discovery: Automate target discovery in dynamic environments
- Implement Pipeline Stages: Process logs at the edge to reduce transfer
- Set Resource Limits: Prevent resource exhaustion
- Use Positions File: Ensure log continuity across restarts
- Monitor Promtail Metrics: Track performance and errors
- Implement Retry Logic: Handle temporary failures gracefully
- Use Labels Wisely: Balance cardinality with usefulness
Support
For additional support with the Promtail integration, please contact the Datable support team or refer to the Promtail documentation.