Prometheus is used to scrape metrics from the pod. You have to add Prometheus in your NAIS manifest to enable scrape.
Each app that have scraping enabled can use the default Grafana dashboard nais-app-dashboard, or create theire own.
NAIS manifest config¶
If you are building an app on the JVM you can use Prometheus' own Java client library. Make sure to enable scraping in the NAIS manifest.
We also recommend to export the default metrics.
When using Prometheus the retention is 16 weeks for prod, and 4 weeks for dev. If you need data stored longer then what Prometheus support, we recommend using your own Aiven Influxdb. Then you have full control of the database and retention.
Data via push metrics/sensu is stored for one year.
If you don't want to just rely on pull metrics, you can push data directly to InfluxDB via Sensu.
This is easily done by writing to the Sensu socket.
The format of the data (The
output field in the message) should be formatted as Influxdb Line Protocol.
Note that each variation of tag values will create a new time series, so avoid using tags for data that varies a lot. Read more about best practices here: InfluxDB schema design and data layout