View your NGINX data in New Relic
Once your setup is complete and data is flowing, you can view your NGINX metrics and logs in New Relic and create custom alerts.
Query your data with NRQL
You can create custom queries to analyze your NGINX data:
Example queries:
-- View request rate over timeFROM Metric SELECT rate(sum(nginx.requests), 1 minute)WHERE nginx.deployment.name = 'production-web-01'TIMESERIES
-- Check connection statesFROM Metric SELECT latest(nginx.connections_current)WHERE nginx.deployment.name = 'production-web-01'FACET state
-- Analyze log patterns (if log forwarding enabled)FROM Log SELECT count(*)WHERE nginx.deployment.name = 'production-web-01'FACET status SINCE 1 hour agoQuery trace data with NRQL
If you've enabled distributed tracing with ngx_otel_module, you can also query trace and span data:
-- NGINX spans by nameFROM Span SELECT count(*)WHERE nginx.deployment.name = 'production-web-01'FACET nameSINCE 1 hour ago
-- Distributed traces flowing through NGINX-- Shows all services participating in traces that include NGINXFROM Span SELECT uniques(service.name)WHERE trace.id IN ( SELECT uniques(trace.id) FROM Span WHERE nginx.deployment.name = 'production-web-01' SINCE 30 minutes ago LIMIT 10)SINCE 30 minutes ago
-- Service relationships involving NGINXFROM Relationship SELECT *WHERE source.entityName = 'server:production-web-01' OR target.entityName = 'server:production-web-01'SINCE 1 day agoReplace production-web-01 with your nginx.deployment.name. The NGINX entity name defaults to server:<nginx.deployment.name> (set by the nginx.display.name transform in your collector config).
Troubleshoot data visibility
Next steps
Learn more about your data:
- NGINX distributed tracing - Enable
ngx_otel_modulefor distributed tracing and service relationships - NGINX OpenTelemetry metrics and attributes reference - Complete metrics reference with descriptions and examples
- Introduction to NRQL - Learn New Relic's query language for advanced data analysis
- Create NRQL alert conditions - Set up custom alerts based on your NGINX metrics
Setup guides:
- Monitor self-hosted NGINX with OpenTelemetry - Complete setup for on-host deployments
- Monitor NGINX on Kubernetes with OpenTelemetry - Complete setup for Kubernetes deployments