Prometheus Integration

Overview

Prometheus serves as the primary metrics collection and storage system for Gluesync. This integration provides real-time monitoring capabilities with configurable retention and storage options.

For a complete list of available metrics and their descriptions, see the Metrics Reference.

Default Configuration

Gluesync provides a pre-configured Prometheus setup through Docker Compose:

services:
  prometheus:
    image: prom/prometheus
    restart: 'unless-stopped'
    volumes:
      - ./prometheus-gs2.yml:/etc/prometheus/prometheus.yml
      - ./data:/prometheus
    command:
      - '--config.file=/etc/prometheus/prometheus.yml'
      - '--storage.tsdb.retention.size=10GB'
      - '--storage.tsdb.retention.time=7d'
    ports:
      - 9090:9090

Configuration Options

Core Settings

Setting Default Description

retention.size

10GB

Maximum storage size for metrics data. Increase for larger deployments or longer history.

retention.time

7d

Duration to retain metrics. Adjust based on your compliance and analysis needs.

scrape_interval

15s

Frequency of metrics collection. This directly affects how often Core Hub updates its metrics.

ports

9090

Prometheus web interface and API port. Can be modified for security or port conflicts.

The scrape_interval setting directly affects Core Hub metrics sampling. When you modify this value, you’re changing how frequently Core Hub updates its metrics. For example:

  • A 15s scrape interval means Core Hub metrics are updated every 15 seconds

  • A 5s scrape interval provides more frequent updates but increases system load

  • A 30s scrape interval reduces system load but provides less granular data

Choose an interval that balances your monitoring needs with system performance.

Security Considerations

HTTPS Configuration

To enable HTTPS for secure metrics collection:

command:
  - '--web.config.file=/etc/prometheus/web-config.yml'

volumes:
  - ./web-config.yml:/etc/prometheus/web-config.yml
  - ./certificates:/etc/prometheus/certs

Example web-config.yml:

tls_server_config:
  cert_file: /etc/prometheus/certs/prometheus.crt
  key_file: /etc/prometheus/certs/prometheus.key

CoreHub Address Configuration

To modify the CoreHub scrape target:

  1. Edit prometheus-gs2.yml:

    scrape_configs:
      - job_name: 'gluesync'
        static_configs:
          - targets: ['corehub:8080']  # Default
          # - targets: ['custom-address:port']

Available Metrics

For a complete list of available metrics and their descriptions, see the Metrics Reference.

Performance Tuning

Storage Optimization

For high-throughput environments:

command:
  - '--storage.tsdb.retention.size=200GB'  # Increased storage
  - '--storage.tsdb.retention.time=30d'   # Extended retention
  - '--storage.tsdb.wal-compression'      # Compress write-ahead log
  - '--query.max-samples=100000000'       # Larger query limit

Scrape Configuration

Adjust scrape intervals based on your needs:

global:
  scrape_interval: 15s     # Default collection interval
  scrape_timeout: 10s      # Timeout for each scrape
  evaluation_interval: 15s  # Rule evaluation interval
For production environments, consider increasing scrape_interval to reduce system load, or decreasing it for more granular metrics.

Troubleshooting

Common Issues

  • Connection Refused: Verify CoreHub address and port configuration

  • Data Storage Full: Adjust retention settings or increase storage capacity

  • High Memory Usage: Consider reducing retention period or increasing query timeout

Monitoring Prometheus Itself

Enable self-monitoring:

scrape_configs:
  - job_name: 'prometheus'
    static_configs:
      - targets: ['localhost:9090']