Skip to main content
APA
Sponsored byCAST AI — Kubernetes cost optimizationBetter Stack — Uptime monitoring and log managementVictoriaMetrics — Fast, open-source time series database and drop-in Prometheus replacement.

Freeswitch logoFreeswitch Prometheus Alert Rules

4 Prometheus alerting rules for Freeswitch.Exported via znerol/prometheus-freeswitch-exporter.These rules cover critical and warning conditions — copy and paste the YAML into your Prometheus configuration.

⚠️

Alert thresholds depend on the nature of your applications. Some queries may have arbitrary tolerance thresholds. Building an efficient monitoring platform takes time. 😉

wget https://raw.githubusercontent.com/samber/awesome-prometheus-alerts/refs/heads/master/dist/rules/freeswitch/znerol-freeswitch-exporter.yml
critical

9.6.1.Freeswitch down

Freeswitch {{ $labels.instance }} is unresponsive.

- alert: FreeswitchDown
  expr: 'freeswitch_up == 0'
  for: 1m
  labels:
    severity: critical
  annotations:
    summary: Freeswitch down (instance {{ $labels.instance }})
    description: "Freeswitch {{ $labels.instance }} is unresponsive.\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
critical

9.6.2.Freeswitch flapping

Freeswitch on {{ $labels.instance }} changed state {{ $value | printf "%.0f" }} times in the last 10 minutes.

  # Catches a crash-looping service, which the down rule misses because each successful scrape resets its for: timer.
  # 4 changes means at least 2 down/up cycles in 10m; one outage followed by a recovery counts only 2.
- alert: FreeswitchFlapping
  expr: 'changes(freeswitch_up[10m]) >= 4'
  for: 0m
  labels:
    severity: critical
  annotations:
    summary: Freeswitch flapping (instance {{ $labels.instance }})
    description: "Freeswitch on {{ $labels.instance }} changed state {{ $value | printf \"%.0f\" }} times in the last 10 minutes.\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
critical

9.6.3.Freeswitch Sessions Critical

High sessions usage on {{ $labels.instance }}: {{ $value | printf "%.2f"}}%

- alert: FreeswitchSessionsCritical
  expr: '(freeswitch_session_active * 100 / freeswitch_session_limit) > 90 and freeswitch_session_limit > 0'
  for: 5m
  labels:
    severity: critical
  annotations:
    summary: Freeswitch Sessions Critical (instance {{ $labels.instance }})
    description: "High sessions usage on {{ $labels.instance }}: {{ $value | printf \"%.2f\"}}%\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
warning

9.6.4.Freeswitch Sessions Warning

High sessions usage on {{ $labels.instance }}: {{ $value | printf "%.2f"}}%

- alert: FreeswitchSessionsWarning
  expr: '(freeswitch_session_active * 100 / freeswitch_session_limit) > 80 and freeswitch_session_limit > 0'
  for: 10m
  labels:
    severity: warning
  annotations:
    summary: Freeswitch Sessions Warning (instance {{ $labels.instance }})
    description: "High sessions usage on {{ $labels.instance }}: {{ $value | printf \"%.2f\"}}%\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"

Share your alerting rules

Your production alerts can make this collection better. Share your rule files in one command: only Prometheus rule files and PrometheusRule resources are uploaded, while prometheus.yml, alertmanager.yml and other configurations are skipped, as they often contain credentials.

npx awesome-prometheus-alerts share /etc/prometheus/rules

Add --dry-run to preview what would be sent.