new·Earn with mozg — 20% of every monthSend somebody here and take a fifth of every plan payment they make, for as long as they keep paying — not a bounty on the first invoice. Your handle is the link, the window is thirty days, and the commission lands on your balance the second they pay. Free to join: if you have signed in, you already have the link. mozg.sh/earnall news →
mozg.beta
Sign in

Grafana dashboards · all subjects

data-source/postgres

9 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

PostgreSQL data source key capabilities

The PostgreSQL data source supports time series queries with built-in time grouping macros, table queries for any valid SQL query, EXPLAIN queries to inspect query execution plans, template variables for dynamic dashboards, annotations to overlay events on dashboard panels, alerting based on PostgreSQL query results (time series format only), and macros to simplify queries with built-in time filtering and grouping.

PostgreSQL supported databases

The PostgreSQL data source supports PostgreSQL 9.0 and newer, Amazon RDS for PostgreSQL, Amazon Aurora PostgreSQL, Azure Database for PostgreSQL, and Google Cloud SQL for PostgreSQL. Grafana recommends using the latest available version for optimal compatibility.

PostgreSQL supported data types

The PostgreSQL plugin uses the PGX driver for database connectivity and supports the following data types: numeric types (int2, int4, int8, float4, float8, numeric), string types (text, varchar, char, bpchar), date/time types (timestamp, timestamptz, date, time, timetz, interval), boolean (bool), JSON types (json, jsonb), enumerated types (custom enum types are returned as string values), and other types not explicitly mapped (such as arrays, composites, or custom domains) are returned as string values.

PostgreSQL standalone plugin in Grafana 13.2

Starting with Grafana v13.2, the PostgreSQL data source is a standalone plugin preinstalled in both Grafana OSS and Enterprise. This enables more frequent updates independent of Grafana releases. Grafana automatically checks the plugin catalog and installs the latest version on each server restart. The standalone plugin requires Grafana 12.3.0 or later.

PostgreSQL plugin auto-update configuration

To opt out of auto-updates for the PostgreSQL plugin, set preinstall_auto_update to false in the configuration file. To update manually, update at any time from the Administration > Plugins page without restarting Grafana.

PostgreSQL standalone plugin installation for Grafana 12.3.x through 13.1.x

Users running Grafana 12.3.x through 13.1.x can install the standalone PostgreSQL plugin from the plugin catalog. Add the following to the configuration file: [plugin.grafana-postgresql-datasource] as_external = true [plugins] preinstall_sync = grafana-postgresql-datasource or preinstall_sync = grafana-postgresql-datasource@<version> to install a specific version.

PostgreSQL-compatible databases that may work with this data source

The following databases use the PostgreSQL wire protocol and may work with the PostgreSQL data source: TimescaleDB (enable the TimescaleDB toggle in data source settings for time_bucket support), CockroachDB, Amazon Redshift (Grafana also offers a dedicated Amazon Redshift data source with additional features), CrateDB, and YugabyteDB.

PostgreSQL data source query capabilities

The PostgreSQL data source supports time series queries to visualize metrics over time, table queries to display results in table format, and EXPLAIN queries to inspect query execution plans directly in the query editor.

PostgreSQL data source alerting limitation

Alerts can be created based on PostgreSQL query results, but only for time series format queries, not for table or other query formats.

Give your agent this brain