Skip to content

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

Step 2: Generate API Key in Datable

  1. Navigate to Sources in Datable
  2. Select Promtail
  3. Enter a source name
  4. Review the generated configuration snippet

Step 3: Configure Promtail

  1. Combined your existing promtail.yml with the snippet provided by Datable.
  2. 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

  1. Use Service Discovery: Automate target discovery in dynamic environments
  2. Implement Pipeline Stages: Process logs at the edge to reduce transfer
  3. Set Resource Limits: Prevent resource exhaustion
  4. Use Positions File: Ensure log continuity across restarts
  5. Monitor Promtail Metrics: Track performance and errors
  6. Implement Retry Logic: Handle temporary failures gracefully
  7. 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.