Skip to content

feat: add Datadog integration with dashboard and agent configuration#8

Merged
abtreece merged 2 commits into
mainfrom
feature/datadog-integration
Jan 16, 2026
Merged

feat: add Datadog integration with dashboard and agent configuration#8
abtreece merged 2 commits into
mainfrom
feature/datadog-integration

Conversation

@abtreece

Copy link
Copy Markdown
Owner

Summary

  • Add pre-built Datadog dashboard (examples/datadog-dashboard.json) with widgets for overview, request metrics, latency, upstream, connections, and SSL/rate limiting
  • Add OpenMetrics agent configuration (examples/datadog-openmetrics.yaml) for scraping ngxstats Prometheus-format metrics
  • Update README with Datadog setup documentation including agent configuration and dashboard import instructions

Test plan

  • Verify datadog-openmetrics.yaml syntax is valid YAML
  • Verify datadog-dashboard.json syntax is valid JSON
  • Test agent configuration with Datadog Agent in a development environment
  • Import dashboard via Datadog API or UI and verify widgets render correctly

Add support for Datadog as an alternative to Prometheus/Grafana:
- Add pre-built Datadog dashboard with overview, request, latency,
  upstream, connection, and SSL/rate limiting widgets
- Add OpenMetrics agent configuration for scraping ngxstats metrics
- Update README with Datadog setup documentation
Copilot AI review requested due to automatic review settings January 16, 2026 02:17

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 Datadog integration support to the lua-resty-ngxstats project by providing a pre-configured OpenMetrics agent configuration and a comprehensive dashboard for visualizing NGINX metrics in Datadog.

Changes:

  • Added OpenMetrics configuration file for the Datadog Agent to scrape Prometheus-format metrics from ngxstats
  • Added pre-built Datadog dashboard JSON with widgets for monitoring overview, requests, latency, upstream, connections, and SSL/rate limiting
  • Updated README with Datadog setup instructions including agent configuration and dashboard import steps

Reviewed changes

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

File Description
examples/datadog-openmetrics.yaml New Datadog Agent configuration for scraping ngxstats metrics with namespace, metric filters, and optional settings
examples/datadog-dashboard.json New dashboard JSON with organized widget groups for comprehensive NGINX monitoring
README.md Added Datadog integration section with setup instructions for agent configuration and dashboard import

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

@@ -0,0 +1,110 @@
# Datadog Agent OpenMetrics configuration for lua-resty-ngxstats

Copilot AI Jan 16, 2026

Copy link

Choose a reason for hiding this comment

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

The project name appears as 'lua-resty-ngxstats' in the header comment, but should be confirmed against the actual repository name for consistency.

Suggested change
# Datadog Agent OpenMetrics configuration for lua-resty-ngxstats
# Datadog Agent OpenMetrics configuration for NGINX stats (ngxstats /status endpoint)

Copilot uses AI. Check for mistakes.
Comment on lines +361 to +365
"type": "check_status",
"check": "nginx.nginx_upstream_health",
"grouping": "cluster",
"group_by": ["upstream"],
"tags": ["$host", "$upstream"]

Copilot AI Jan 16, 2026

Copy link

Choose a reason for hiding this comment

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

The check status widget references 'nginx.nginx_upstream_health' but the OpenMetrics configuration collects 'nginx_upstream_health' as a metric, not a service check. Datadog check status widgets require actual service checks, not metrics. This widget will not function as intended and should either be removed or replaced with a query_value widget using the metric.

Suggested change
"type": "check_status",
"check": "nginx.nginx_upstream_health",
"grouping": "cluster",
"group_by": ["upstream"],
"tags": ["$host", "$upstream"]
"type": "query_value",
"requests": [
{
"q": "avg:nginx_upstream_health{$host,$upstream} by {upstream}",
"aggregator": "avg"
}
]

Copilot uses AI. Check for mistakes.
Comment thread README.md
- **SSL/TLS** - Low session reuse, deprecated protocol usage
- **Traffic** - Spikes, drops, high bandwidth

### 6. Datadog Integration (Alternative to Prometheus)

Copilot AI Jan 16, 2026

Copy link

Choose a reason for hiding this comment

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

The section is numbered '6' but the numbering context from previous sections is not visible in the diff. Verify that this section number is correct and follows the existing documentation structure.

Suggested change
### 6. Datadog Integration (Alternative to Prometheus)
### Datadog Integration (Alternative to Prometheus)

Copilot uses AI. Check for mistakes.
Add pre-built Datadog monitors equivalent to Prometheus alerting rules:
- Availability monitors (instance down, no requests)
- Error rate monitors (5xx, 4xx thresholds)
- Latency monitors (average latency, slow requests)
- Upstream monitors (failures, error rate, latency, health)
- Connection monitors (high connections, unhandled)
- Cache monitors (low hit rate, high bypass)
- Rate limiting monitors (rejections, active limiting)
- SSL/TLS monitors (session reuse, deprecated protocols)
- Traffic monitors (spikes, drops, bandwidth)

Update README with monitor import instructions.
@abtreece abtreece merged commit 15ab0a6 into main Jan 16, 2026
7 of 8 checks passed
@abtreece abtreece deleted the feature/datadog-integration branch January 16, 2026 02:24
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