Skip to content

Feature/docker compose setup #1101

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

benjisho
Copy link

@benjisho benjisho commented Jul 16, 2025

Proposed changes

This PR adds a comprehensive Docker Compose setup for the NGINX Prometheus Exporter to make it easier for users to get started with monitoring their NGINX instances.

Use case: Users often want to quickly test the NGINX Prometheus Exporter or set up a complete monitoring stack without manually configuring each component. This Docker Compose setup provides both options:

  1. nginx-exporter only (docker-compose up -d nginx-exporter) - For users with existing NGINX infrastructure who just want to add the exporter
  2. Complete monitoring stack (docker-compose up -d) - For demonstration, testing, and learning purposes

Changes include:

  • Complete Docker Compose configuration with nginx-exporter, nginx, prometheus, grafana, and sample app
  • Comprehensive documentation in examples/docker-compose/README.md with architecture overview, quick start guide, and troubleshooting
  • Updated main README.md with Docker Compose setup section
  • CI workflow to test Docker Compose functionality and ensure containers start correctly
  • Pre-configured Grafana dashboards and Prometheus scraping configuration
  • Sample NGINX configuration with stub_status enabled for testing

The setup is organized in the examples/docker-compose/ directory following the project's structure conventions and provides a complete monitoring pipeline from NGINX → nginx-exporter → Prometheus → Grafana.

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING guide
  • I have proven my fix is effective or that my feature works
  • I have checked that all unit tests pass after adding my changes
  • I have ensured the README is up to date
  • I have rebased my branch onto main
  • I will ensure my PR is targeting the main branch and pulling from my branch on my own fork

benjisho added 3 commits July 16, 2025 03:21
- Add docker-compose.yml with nginx-exporter, nginx, app, prometheus, and grafana services
- Add docker-compose.test.yml for minimal testing setup
- Configure NGINX with stub_status endpoint on port 8081
- Add sample web application with custom HTML content
- Configure Prometheus to scrape nginx-exporter metrics
- Add Grafana with pre-configured datasources and dashboards
- Set up proper networking and service dependencies
- Use examples/docker-compose/ directory structure for all configuration files
- Add comprehensive Docker Compose documentation in examples/docker-compose/README.md
- Include architecture overview, quick start guide, and service descriptions
- Add testing instructions and troubleshooting section
- Update main README.md to reference Docker Compose example
- Focus quick start on nginx-exporter only for existing NGINX setups
- Provide separate instructions for complete monitoring stack
- Add configuration file references and usage examples
- Add test-docker-compose-ci.yml workflow to test Docker Compose setup
- Test 'docker-compose up -d nginx-exporter' command functionality
- Verify nginx-exporter container starts correctly and serves metrics
- Test full monitoring stack integration (nginx, prometheus, grafana)
- Validate service connectivity and metrics collection
- Include proper error handling and cleanup procedures
- Add detailed logging for troubleshooting failures
- Follow project CI conventions and use consistent action versions
@benjisho benjisho requested a review from a team as a code owner July 16, 2025 06:00
Copy link

nginx-bot bot commented Jul 16, 2025

Hi @benjisho! Welcome to the project! 🎉

Thanks for opening this pull request!
Be sure to check out our Contributing Guidelines while you wait for someone on the team to review this.

@nginx-bot nginx-bot bot added the community Issues or PRs opened by an external contributor label Jul 16, 2025
@github-actions github-actions bot added enhancement Pull requests for new features/feature enhancements documentation Pull requests/issues for documentation labels Jul 16, 2025
Copy link

github-actions bot commented Jul 16, 2025

✅ All required contributors have signed the F5 CLA for this PR. Thank you!
Posted by the CLA Assistant Lite bot.

@benjisho benjisho force-pushed the feature/docker-compose-setup branch from 839269d to e745269 Compare July 17, 2025 12:27
- Fix comment indentation in prometheus.yml
- Fix empty values in docker-compose volumes sections
- All pre-commit hooks now pass
@benjisho
Copy link
Author

I have hereby read the F5 CLA and agree to its terms

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Issues or PRs opened by an external contributor documentation Pull requests/issues for documentation enhancement Pull requests for new features/feature enhancements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant