Getting Started with Observability in Nais¶
This tutorial walks you through enabling observability for your Nais application and finding your data in the Grafana stack.
Prerequisites¶
- A Nais application deployed to a cluster
- Access to your team's Grafana instance
1. Enable auto-instrumentation¶
Add auto-instrumentation to your nais.yaml and deploy:
Nais injects the OpenTelemetry agent at startup. No code changes needed.
Full auto-instrumentation guide
2. Find your app in APM¶
Open the Nais APM service inventory. Your application should appear within a few minutes of receiving traffic. The APM shows:
- RED dashboards — request rate, error rate, and latency
- Operations breakdown — which endpoints are slowest
- Dependencies — downstream services, databases, and message brokers
- Runtime metrics — JVM heap, Go goroutines, Node.js event loop
3. Explore metrics¶
Metrics are scraped automatically from your application's /metrics endpoint and stored in Mimir.
- Open Grafana Explore and select a Mimir/Prometheus data source
- Query your metrics with PromQL, e.g.
http_server_request_duration_seconds_bucket{service_name="my-app"} - Create dashboards or use the default Nais app dashboard
4. Explore logs¶
Logs sent to stdout/stderr are collected automatically by Loki.
- In Grafana Explore, select a Loki data source
- Query:
{app="my-app"} | logfmt - For private logs, configure Team Logs
5. Explore traces¶
Traces collected by the OpenTelemetry agent are stored in Tempo.
- In the APM, click any operation to jump to matching traces
- Or use Grafana Explore with a Tempo data source to run TraceQL queries
- Correlate traces with logs for full request context
Next steps¶
- Add custom spans and metrics for business-specific tracing
- Create custom metrics
- Set up alerting