Getting Started with Observability in Nais ΒΆ

This tutorial will guide you through the process of enabling observability for your application on Nais, using OpenTelemetry and the Grafana stack (Loki, Tempo, Prometheus, Grafana).

Prerequisites ΒΆ

  • A Nais application deployed to a cluster
  • Access to your team's Grafana instance

1. Enable Auto-Instrumentation ΒΆ

The easiest way to get started is to enable auto-instrumentation in your nais.yaml:

yaml

Deploy your application with this configuration. Nais will automatically inject OpenTelemetry agents for supported languages.

2. View Metrics in Grafana ΒΆ

Once your app is running, metrics will be available in Prometheus and visualized in Grafana.

  • Go to your Grafana dashboard
  • Use the Prometheus data source to query your application's metrics
  • Explore default dashboards or create your own

3. View Logs in Grafana Loki and Team Logs ΒΆ

  • Logs sent to stdout/stderr are automatically collected by Loki
  • For private logs, configure Team Logs
  • In Grafana, use the Loki or Team Logs data source to search and analyze logs

4. View Traces in Grafana Tempo ΒΆ

  • Traces are collected via OpenTelemetry and sent to Tempo
  • In Grafana, use the Tempo data source to view traces for your application
  • You can correlate traces with logs and metrics for full observability

Next Steps ΒΆ

Congratulations! You now have end-to-end observability for your Nais application.