Skip to content

feat: add Prometheus alerting rules example#6

Merged
abtreece merged 1 commit into
mainfrom
feature/prometheus-alerts
Jan 16, 2026
Merged

feat: add Prometheus alerting rules example#6
abtreece merged 1 commit into
mainfrom
feature/prometheus-alerts

Conversation

@abtreece

Copy link
Copy Markdown
Owner

Summary

  • Add pre-built Prometheus alerting rules (examples/prometheus-alerts.yml)
  • Update examples/prometheus.yml to include rule_files configuration
  • Update README with alerting configuration section
  • Update CHANGELOG

Alert Groups

Group Alerts Description
nginx_availability NginxDown, NginxNoRequests Instance health
nginx_errors NginxHighErrorRate, NginxElevatedErrorRate, NginxHigh4xxRate Error rate thresholds
nginx_latency NginxHighLatencyP99, NginxElevatedLatencyP99, NginxHighAverageLatency Latency percentiles
nginx_upstream NginxUpstreamFailures, NginxUpstreamHighErrorRate, NginxUpstreamHighLatency, NginxUpstreamNoRequests Backend health
nginx_connections NginxHighConnections, NginxConnectionsNotHandled Connection limits
nginx_cache NginxLowCacheHitRate, NginxHighCacheBypass Cache efficiency
nginx_rate_limiting NginxHighRateLimitRejections, NginxRateLimitingActive Rate limit status
nginx_ssl NginxLowSSLSessionReuse, NginxDeprecatedTLSProtocol SSL/TLS health
nginx_traffic NginxTrafficSpike, NginxTrafficDrop, NginxHighBandwidth Traffic anomalies

Severity Levels

  • critical - Immediate action required (NGINX down, high 5xx rate, upstream failures)
  • warning - Investigation needed (elevated latency, low cache hit rate)
  • info - Informational (rate limiting active)

Test plan

  • Validate YAML syntax with promtool check rules prometheus-alerts.yml
  • Import rules into Prometheus
  • Verify alerts fire correctly with test traffic

🤖 Generated with Claude Code

Add pre-built alerting rules (examples/prometheus-alerts.yml) with:
- Availability: NGINX down, no requests received
- Errors: High 5xx/4xx error rates with warning/critical thresholds
- Latency: High p99 latency, elevated average latency
- Upstream: Failures, high error rate, high latency, no requests
- Connections: High active connections, unhandled connections
- Cache: Low hit rate, high bypass rate
- Rate limiting: High rejection rate, active rate limiting
- SSL/TLS: Low session reuse, deprecated protocol usage
- Traffic: Spikes, drops, high bandwidth

Update prometheus.yml to include rule_files configuration.
Copilot AI review requested due to automatic review settings January 16, 2026 01:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds comprehensive Prometheus alerting rules for NGINX monitoring with production-ready thresholds. The changes enable operators to receive notifications for critical issues like service downtime, error spikes, latency problems, and upstream failures.

Changes:

  • Adds examples/prometheus-alerts.yml with 26 alerting rules organized into 9 groups covering availability, errors, latency, upstream health, connections, caching, rate limiting, SSL/TLS, and traffic anomalies
  • Updates examples/prometheus.yml to reference the new alert rules file and includes commented alertmanager configuration
  • Documents the alerting configuration in README with a summary of alert groups

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
examples/prometheus.yml Adds rule_files configuration pointing to prometheus-alerts.yml and commented alertmanager setup
examples/prometheus-alerts.yml New file containing 26 alerting rules across 9 groups with critical, warning, and info severity levels
README.md Adds "Configure Alerting" section documenting the alert groups
CHANGELOG.md Documents the new alerting rules feature in the Unreleased section

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@abtreece abtreece merged commit b567582 into main Jan 16, 2026
8 checks passed
@abtreece abtreece deleted the feature/prometheus-alerts branch January 16, 2026 01:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants