Monitoring Nginx with ClickStack
This guide shows you how to capture distributed traces from Nginx and visualize them in ClickStack using copy/paste shell snippets.
In this simple example you'll see:
- Real-time Nginx request traces with timing breakdowns
- HTTP status codes, response times, and error rates
- Interactive dashboards showing performance metrics
Approx Time: 5-10 minutes
Quick start
Create the project directory and configuration files
Copy/Paste these commands to create the necessary files for your nginx backend service.
Create Project Directory
Create docker-compose.yml
Create nginx.conf
Create generate_traffic.sh
This will create a shell script to generate realistic traffic at intervals of time to a fake store api. This will be the traffic we're monitoring.
Start ClickStack and create your account
Wait 30-60 seconds for ClickStack to fully initialize, then:
- Open http://localhost:8080 in your browser
- Create an account with a username and strong password
- Go to Settings → API Keys
- Copy your Ingestion API Key
Generate realistic traffic
Run the traffic generator to create traces.
You'll see colorful output showing requests hitting various endpoints:
- Green = successful (200)
- Yellow = not found (404)
- Red = errors (5xx)
Let it run for 1-2 minutes, then press Ctrl+C if you want to stop the traffic.
Explore your traces
Open ClickStack at http://localhost:8080 and explore:
- Go to Search and set your source to Traces
- Set time range to "Last 15 minutes"
- You'll see traces from the nginx-proxy service
- Click on any trace to see:
- Total request duration
- HTTP status code and method
- Client IP and user agent
- Span attributes

- http.status_code:404 - See all 404 errors
- nginx.request.time:>200 - Slow requests (>200ms)
- http.route:/products/1 - Specific endpoint
Creating Your First Dashboard
Let's create a dashboard to monitor nginx performance:

In HyperDX, go to Dashboards -> Create New Saved Dashboard
Add these charts:
Chart 1: Request Rate
- Type: Line/Bar
- Where: ServiceName:"nginx-proxy"
- Aggregation: Count of Events
- Group by: Events.Timestamp

Chart 2: Response Times (95th and 90th percentile)
- Type: Line/Bar
- Where: ServiceName:"nginx-proxy"
- Aggregation: 99th Percentile (You can click add series to add more aggregations, such as 95th percentile, and 90th percentile)
- Group by: None
- Granularity: Adjust this to see different trend lines in your data

Chart 3: Errors Over Time
- Type: Line/Bar
- Where: ServiceName:"nginx-proxy" SpanAttributes.http.status_code:"404"
- Aggregation: Count of Events
- Group by: None

Chart 4: Status Code Breakdown
- Type: Table
- Where: ServiceName:"nginx-proxy"
- Aggregation: Count of Events
- Group by: SpanAttributes['http.status_code']

Next steps
Now that you have traces going, try:
- Setting up alerts
- Adding your own service
- Replace Fake Store API with your own backend
- Add OpenTelemetry to your backend for full distributed tracing
- See requests flow to your instance