Try it free

PostgreSQL extension

  • Latest Dynatrace
  • Extension

Observe, analyze, and optimize the usage, health, and performance of your PostgreSQL database.

Get started

Overview

The PostgreSQL monitoring solution is based on a remote monitoring approach implemented as a Dynatrace ActiveGate extension. The extension queries PostgreSQL databases for performance and health metrics. Dynatrace Intelligence analyzes these metrics for anomalies and problems.

Use cases

  • Monitor PostgreSQL health and performance.
  • Detect and alert on anomalies.
  • Prevent performance issues.
  • View query performance metrics, execution plans, blocking queries, operational alerts, current configuration, and recent changes.

Requirements

  • Designate one or more ActiveGate groups to remotely connect to your PostgreSQL database server and pull data. All ActiveGates in each group must be able to reach the server.

  • For self-hosted Postgres:

    • Postgres additional supplied modules must be installed.
  • For cloud-managed Postgres services:

    • Ensure that specific extensions and settings are enabled.
  • Create a dedicated database user in your database instance. Dynatrace uses this user to run monitoring queries against your PostgreSQL database.

    CREATE USER dynatrace WITH PASSWORD '<PASSWORD>' INHERIT;

Compatibility information

  • Compatible with all currently maintained Postgres versions.
  • Available on Dynatrace version 1.255+.

Activation and setup

Install Postgres database extension

  1. Go to Dynatrace Hub Hub.
  2. Select and install PostgreSQL extension.
  3. To monitor a new PostgreSQL database, either onboard it via Databases Databases (recommended for first-time users) or create a monitoring configuration in Extensions Extensions.

Create a monitoring configuration

Navigate to the PostgreSQL extension and select Add configuration.

Select an ActiveGate group

  1. Select the ActiveGate group to determine which ActiveGates run the extension.
  2. Select Next.

Create an endpoint

Set up an endpoint pointing to your database instance. Each configuration can have up to 20000 endpoints.

  1. Provide your database host name/IP address, port, and database name in the Database connection section. For each instance, configure only a single database (usually the main postgres database).
  2. Provide the Authentication credentials for the dynatrace monitoring user you created above:
    • Basic credentials: Authentication details passed to Dynatrace when activating monitoring configuration are masked to prevent them from being retrieved.
    • Credential vault: Use vault credentials to securely store and retrieve database credentials.
  3. Optional Use a connection string to connect to your database. With this setting enabled, the values provided in the Database connection section are ignored.
  4. Configure database auto-discovery if required.
  5. Define Additional configuration parameters if required.
  6. After creating all endpoints, select Next.

Define monitoring configuration variables

  1. Adjust the polling frequency and other variables for this monitoring configuration:

    • Endpoint metadata: Allows you to add a custom metadata field to all the entities created by this configuration.
    • Query interval: Defaults to 1 minute and controls the polling frequency for the majority of the metrics collected by the extension.
    • Long query interval: Controls the polling frequency of top query monitoring.
    • Table query interval: Controls the polling frequency of table and index monitoring queries. Available from major version 3 onwards.
    • Configuration query interval: Controls the polling frequency of database configuration parameters and schema.
  2. Select Next.

Define metadata

  1. Add a Description to your monitoring configuration.
  2. Optional Add security context, product, and cost center field values to enrich all collected data.
  3. Select your desired feature sets.
  4. Select Save.

Database configuration

To monitor your database instance, specific settings must be configured on the PostgreSQL database. If you're onboarding through Databases Databases, scripts are provided that create the necessary database objects. Download the script to your host and run it as an admin user with sufficient permissions. Otherwise, run the following actions manually.

The script performs the following actions:

  1. Grants the monitoring user membership in the pg_monitor role for read-only monitoring access.

    GRANT pg_monitor TO dynatrace;
  2. Create a helper function that generates execution plans from SQL commands for deeper query insights.

    CREATE SCHEMA dynatrace;
    CREATE OR REPLACE FUNCTION dynatrace.dynatrace_execution_plan(
    query text,
    OUT explain JSON
    ) RETURNS SETOF JSON
    LANGUAGE plpgsql
    VOLATILE
    RETURNS NULL ON NULL INPUT
    SECURITY DEFINER
    ROWS 1
    SET plan_cache_mode = force_generic_plan
    AS
    $$DECLARE
    arg_count integer;
    open_paren text;
    close_paren text;
    explain_cmd text;
    json_result json;
    BEGIN
    /* reject statements containing a semicolon in the middle */
    IF pg_catalog.strpos(
    pg_catalog.rtrim(dynatrace_execution_plan.query, ';'),
    ';'
    ) OPERATOR(pg_catalog.>) 0 THEN
    RAISE EXCEPTION 'query string must not contain a semicolon';
    END IF;
    /* get the parameter count */
    SELECT count(*) INTO arg_count
    FROM pg_catalog.regexp_matches( /* extract the "$n" */
    pg_catalog.regexp_replace( /* remove single quoted strings */
    dynatrace_execution_plan.query,
    '''[^'']*''',
    '',
    'g'
    ),
    '\$\d{1,}',
    'g'
    );
    IF arg_count OPERATOR(pg_catalog.=) 0 THEN
    open_paren := '';
    close_paren := '';
    ELSE
    open_paren := '(';
    close_paren := ')';
    END IF;
    /* construct a prepared statement */
    EXECUTE
    pg_catalog.concat(
    'PREPARE _stmt_',
    open_paren,
    pg_catalog.rtrim(
    pg_catalog.repeat('unknown,', arg_count),
    ','
    ),
    close_paren,
    ' AS ',
    dynatrace_execution_plan.query
    );
    /* construct an EXPLAIN statement */
    explain_cmd :=
    pg_catalog.concat(
    'EXPLAIN (FORMAT JSON, ANALYZE FALSE) EXECUTE _stmt_',
    open_paren,
    pg_catalog.rtrim(
    pg_catalog.repeat('NULL,', arg_count),
    ','
    ),
    close_paren
    );
    /* get and return the plan */
    EXECUTE explain_cmd INTO json_result;
    RETURN QUERY SELECT json_result;
    /* delete the prepared statement */
    DEALLOCATE _stmt_;
    END;$$;
    • SECURITY DEFINER: Executes with the privileges of the user who defined the function, not the caller.
    • EXPLAIN: Requires the same permissions needed to run the query. The user running this function needs sufficient privileges to run PREPARE and EXPLAIN on the queries it explains.
    • The monitoring user needs to have a USAGE grant on the dynatrace schema.
    GRANT USAGE ON SCHEMA dynatrace to <username>
    • In some PostgreSQL configurations you might also need to set search_path for the monitoring user:
    ALTER USER dynatrace SET search_path to dynatrace, public;

    After running the creation script, run the validation script to confirm all required objects were created. This ensures the monitoring setup works as expected.

    After these steps, metrics for the monitored PostgreSQL instance appear in the DB app within 2–3 minutes. Then, you can select any instance to explore detailed metrics and performance insights.

Details

Hosting type to monitor Postgres

Dynatrace supports both self-hosted and cloud-managed monitoring for Postgres databases.

  • Choose self-hosted Postgres for complete observability, execution plan analysis, automated onboarding, and advanced diagnostics.

  • Choose cloud-managed Postgres for reduced operational overhead with some monitoring limitations and manual configuration.

Monitor self-hosted Postgres

With self-hosted Postgres, you manage the database instance and infrastructure. The extension collects data directly from the database using a read-only user. Complete the following setup to enable monitoring:

  1. Configure database parameters.

    Configure the following Postgres parameters in the postgresql.conf file and restart the server to apply the settings. For more details, see the Postgres documentation.

  2. Grant the Dynatrace proxy access to the database.

  3. Select and configure the ActiveGate group.

Monitor Postgres cloud databases

Cloud-managed PostgreSQL is provided as a service by cloud platforms. Services like AWS RDS, AWS Aurora, and Google Cloud SQL prevent direct database configuration. Enable the following features and settings to ensure full monitoring capability.

Steps to set up monitoring capabilities

  1. Add the pg_stat_statements extension.

    This extension collects query-level statistics.

  2. Configure the following settings:

    • track_activity_query_size = 4096 Required

      Enables the collection of larger queries by increasing the size of SQL text in pg_stat_activity. If left at the default value (1024), queries longer than 1024 characters aren't collected.

    • pg_stat_statements.max = 10000 Optional

      Increases the number of normalized queries tracked in pg_stat_statements.

    • pg_stat_statements.track_utility = off Optional

      Disables tracking of utility commands like PREPARE and EXPLAIN.

    • track_io_timing = on Optional

      Collects timing information for block read and write operations in queries.

Database discovery

Starting with version Dynatrace version 1.388 and extension major version 3, the following features require an individual connection to each database:

  • Database schema collection
  • Execution plan monitoring
  • Tables and indexes monitoring

When creating an endpoint, configure database discovery to automatically monitor databases running on an instance without configuring a separate endpoint for each one.

The following discovery modes are available:

  • Manual selection: Manually provide a list of databases to be monitored by the extension.
  • Automatic discovery: All databases running on the instance are discovered and monitored.

When database discovery is enabled, the following connection management settings control how connections to each discovered database are opened and maintained:

  • On-demand (default)

    Connections open only when a query needs to run and close afterwards. A global limit caps the total number of concurrent open connections across all discovered databases.

    ParameterDescriptionDefaultMinimumMaximum

    limit

    Maximum number of concurrent connections across all discovered databases

    200

    15

    500

  • Pooled

    Each discovered database has a dedicated connection pool. Connections are established eagerly and kept alive, which minimizes overhead during query execution. No additional configuration is required.

Use on-demand mode when the number of discovered databases is large and maintaining a permanent pool per database would exhaust available database connections. Use pooled mode when low query latency is a priority and the number of discovered databases is small.

Licensing and cost

The metrics collected through this extension are billed as Grail metrics.

Use the following formula to estimate the number of metric data points ingested:

( (68 * number of instances)
+ (40 * number of databases)
+ (1 * number of tablespaces)
)

For classic licensing, this extension consumes Dynatrace Davis Data Units (see DDUs for metrics).

For logs, Grail Log Analytics consumption applies. For classic licensing, refer either to DDU consumption for Log Management and Analytics or DDUs for Log Monitoring Classic.

Monitoring top queries

If Dynatrace log monitoring is enabled and the pg_stat_statements view is available, Dynatrace ingests the top 100 queries (sorted by total execution time) every 5 minutes and stores them as logs. These logs are available either from the database instance screen or on Databases Databases, under Top queries by total execution time.

To filter for these queries on a dashboard or notebook, filter by dt.extension.name = com.dynatrace.extension.postgres and event.group = top_queries. Example DQL query:

fetch logs
| filter dt.extension.name=="com.dynatrace.extension.postgres" and event.group=="top_queries"
| sort total_exec_time desc

Whether or not pg_stat_statements is available, Dynatrace collects queries from pg_stat_activity as part of the Queries feature set. These are ingested as logs with event.group = longest_queries.

Fetching execution plan details

If you have configured top query monitoring (see previous section), you can fetch execution plans for these queries in Databases Databases by selecting Statement performance > Request on the execution plan for a specific query.

For that query, the extension attempts to execute the following:

SELECT * from dynatrace.dynatrace_execution_plan({query})

and then ingest into Dynatrace the first row of the column named explain. These execution plans are ingested as logs with event.group = execution_plans.

Connection pools and load balancers

The ActiveGate must establish a direct connection to the host being monitored. It should avoid connecting through a load balancer, proxy, or connection pooler (such as pg-pool).

If the ActiveGate switches between different hosts while running (for example, during failover), it may compute differences in statistics across the DB instances. This can result in inaccurate metrics and misleading data.

Feature sets

When activating your extension using monitoring configuration, you can limit monitoring to one of the feature sets. To work properly, the extension has to collect at least one metric after the activation.

In highly segmented networks, feature sets can reflect the segments of your environment. Then, when you create a monitoring configuration, you can select a feature set and a corresponding ActiveGate group that can connect to this particular segment.

All metrics that aren't categorized into any feature set are considered to be the default and are always reported.

A metric inherits the feature set of a subgroup, which in turn inherits the feature set of a group. Also, the feature set defined on the metric level overrides the feature set defined on the subgroup level, which in turn overrides the feature set defined on the group level.

User Functions
Metric nameMetric keyDescription
User function callspostgres.user_functions.calls.countNumber of times this function has been called, as reported by pg_stat_user_functions.
User functions total timepostgres.user_functions.total_time.countTotal time spent in this function and all other functions called by it, as reported by pg_stat_user_functions.
User functions self timepostgres.user_functions.self_time.countTotal time spent in this function itself, not including other functions called by it, as reported by pg_stat_user_functions.
Background Writer
Metric nameMetric keyDescription
Scheduled checkpoints performedpostgres.checkpoints_timed.countNumber of scheduled checkpoints that have been performed
Requested checkpoints performedpostgres.checkpoints_req.countNumber of requested checkpoints that have been performed
Checkpoints write timepostgres.checkpoint_write_time.countTotal amount of time that has been spent in the portion of checkpoint processing where files are written to disk
Checkpoint sync timepostgres.checkpoint_sync_time.countTotal amount of time that has been spent in the portion of checkpoint processing where files are synchronized to disk
Buffers written during checkpointspostgres.buffers_checkpoint.countNumber of buffers written during checkpoints
Buffers written by background writerpostgres.buffers_clean.countNumber of buffers written by the background writer
Cleaning scan stopspostgres.maxwritten_clean.countNumber of times the background writer stopped a cleaning scan because it had written too many buffers
Buffers written by backendpostgres.buffers_backend.countNumber of buffers written directly by a backend
Backend fsync executionspostgres.buffers_backend_fsync.countNumber of times a backend had to execute its own fsync call
Buffers allocatedpostgres.buffers_alloc.countNumber of buffers allocated
WAL
Metric nameMetric keyDescription
WAL files sizepostgres.wal_files_sizeTotal size of all WAL files in the WAL directory
WAL files countpostgres.wal_filesTotal number of WAL files in the WAL directory
WAL files agepostgres.wal_files_ageTime elapsed since the oldest WAL file was modified
WAL writepostgres.wal_write.countNumber of times WAL buffers were written out to disk via XLogWrite request
WAL syncpostgres.wal_sync.countNumber of times WAL files were synced to disk via issue_xlog_fsync request
WAL write timepostgres.wal_write_time.countTotal amount of time spent writing WAL buffers to disk via XLogWrite request, in milliseconds
WAL sync timepostgres.wal_sync_time.countTotal amount of time spent syncing WAL files to disk via issue_xlog_fsync request, in milliseconds
WAL diff sizepostgres.wal_diff_sizeSize of difference between current WAL and last WAL replay
WAL records per minutepostgres.wal_records.countNumber of WAL records generated per minute
WAL fpi per minutepostgres.wal_fpi.countNumber of WAL full page images generated per minute
WAL bytespostgres.wal_bytes.countTotal amount of WAL generated in bytes
WAL buffers fullpostgres.wal_buffers_full.countNumber of times WAL data was written to disk because WAL buffers became full
Activity
Metric nameMetric keyDescription
Active backend processespostgres.activity.activeNumber of server processes executing a query
Active waiting backend processespostgres.activity.active_waitingNumber of server processes actively waiting
Idle backend processespostgres.activity.idleNumber of server processes waiting for a new client command
Idle in transaction backends processespostgres.activity.idle_in_transactionNumber of server processes in transaction not currently executing a query
Idle in transaction aborted backends processespostgres.activity.idle_in_transaction_abortedNumber of server processes in transaction not currently executing a query where one of the statements caused an error
Fast-path function backend processespostgres.activity.fastpath_function_callNumber of server processes executing a fast-path function call
Databases
Metric nameMetric keyDescription
Latest transaction XID agepostgres.xid_ageDifference between the current transaction's XID and datfrozenxid. If this value exceeds 2^31, this can cause a database crash due to transaction ID wraparound.
Number of backendspostgres.numbackendsNumber of backends currently connected to this database
Committed transactionspostgres.xact_commit.countNumber of transactions in this database that have been committed
Rolled back transactionspostgres.xact_rollback.countNumber of transactions in this database that have been rolled back
Block read from diskpostgres.blks_read.countNumber of disk blocks read in this database
Blocks found in buffer cachepostgres.blks_hit.countNumber of times disk blocks were found already in the buffer cache, so that a read was not necessary
Live rows returnedpostgres.tup_returned.countNumber of live rows fetched by sequential scans and index entries returned by index scans in this database
Live rows fetched by index scanspostgres.tup_fetched.countNumber of live rows fetched by index scans in this database
Rows insertedpostgres.tup_inserted.countNumber of rows inserted by queries in this database
Rows updatedpostgres.tup_updated.countNumber of rows updated by queries in this database
Rows deletedpostgres.tup_deleted.countNumber of rows deleted by queries in this database
Queries canceled due to conflictpostgres.conflicts.countNumber of queries canceled due to conflicts with recovery in this database
Temporary files createdpostgres.temp_files.countNumber of temporary files created by queries in this database
Data written to temporary filespostgres.temp_bytes.countTotal amount of data written to temporary files by queries in this database
Deadlockspostgres.deadlocks.countNumber of deadlocks detected in this database
Data file blocks reading timepostgres.blk_read_time.countTime spent reading data file blocks by backends in this database
Data file blocks writing timepostgres.blk_write_time.countTime spent writing data file blocks by backends in this database
Database Sizepostgres.db_sizeSize of the database in bytes
Data page checksum failurespostgres.checksum_failures.countNumber of data page checksum failures detected in this database. Only available if data checksums are enabled.
Time spent by sessionspostgres.session_time.countTime spent by database sessions in this database
Time spent executing SQL statementspostgres.active_time.countTime spent executing SQL statements in this database
Time spent idlingpostgres.idle_in_transaction_time.countTime spent idling while in a transaction in this database
Established sessionspostgres.sessions.countTotal number of sessions established
Abandoned sessionspostgres.sessions_abandoned.countNumber of database sessions to this database that were terminated because connection to the client was lost
Fatal error terminated sessionspostgres.sessions_fatal.countNumber of database sessions to this database that were terminated by fatal errors
Killed sessionspostgres.sessions_killed.countNumber of database sessions to this database that were terminated by operator intervention
default
Metric nameMetric keyDescription
Instance uptimepostgres.uptimeTime since the instance has been started
SLRU
Metric nameMetric keyDescription
SLRU blocks zeroedpostgres.slru.blks_zeroed.countNumber of blocks zeroed during initializations, as reported by pg_stat_slru.
SLRU blocks hitpostgres.slru.blks_hit.countNumber of times disk blocks were found already in the SLRU cache, so that a read was not necessary, as reported by pg_stat_slru.
SLRU blocks readpostgres.slru.blks_read.countNumber of disk blocks read, as reported by pg_stat_slru.
SLRU blocks writtenpostgres.slru.blks_written.countNumber of disk blocks written, as reported by pg_stat_slru.
SLRU blocks existspostgres.slru.blks_exists.countNumber of blocks checked for existence, as reported by pg_stat_slru.
SLRU flushespostgres.slru.flushes.countNumber of SLRU flushes of dirty data, as reported by pg_stat_slru.
SLRU truncatespostgres.slru.truncates.countNumber of SLRU truncates, as reported by pg_stat_slru.
I/O
Metric nameMetric keyDescription
I/O readspostgres.io.reads.countNumber of read operations as reported by pg_stat_io.
I/O read timepostgres.io.read_time.countTime spent waiting for read operations as reported by pg_stat_io.
I/O writespostgres.io.writes.countNumber of write operations as reported by pg_stat_io.
I/O write timepostgres.io.write_time.countTime spent waiting for write operations as reported by pg_stat_io.
I/O writebackspostgres.io.writebacks.countNumber of units of size BLCKSZ (typically 8kB) which the process requested the kernel write out to permanent storage as reported by pg_stat_io.
I/O writeback timepostgres.io.writeback_time.countTime spent waiting for writeback operations as reported by pg_stat_io.
I/O extendspostgres.io.extends.countNumber of relation extend operations as reported by pg_stat_io.
I/O extend timepostgres.io.extend_time.countTime spent waiting for extend operations as reported by pg_stat_io.
I/O hitspostgres.io.hits.countThe number of times a desired block was found in a shared buffer as reported by pg_stat_io.
I/O evictionspostgres.io.evictions.countNumber of times a block has been written out from a shared or local buffer in order to make it available for another use as reported by pg_stat_io.
I/O reusespostgres.io.reuses.countThe number of times an existing buffer in a size-limited ring buffer outside of shared buffers was reused as part of an I/O operation as reported by pg_stat_io.
I/O fsyncspostgres.io.fsyncs.countNumber of fsync calls as reported by pg_stat_io.
I/O fsync timepostgres.io.fsync_time.countTime spent waiting for fsync operations as reported by pg_stat_io.
I/O read bytespostgres.io.read_bytes.countThe total size of read operations as reported by pg_stat_io.
I/O write bytespostgres.io.write_bytes.countThe total size of write operations as reported by pg_stat_io.
I/O extend bytespostgres.io.extend_bytes.countThe total size of relation extend operations as reported by pg_stat_io.
Locks
Metric nameMetric keyDescription
Number of lockspostgres.locksNumber of locks as reported by pg_locks
Recovery
Metric nameMetric keyDescription
Instance recovery modepostgres.recovery.stateIndicate that the instance is in recovery mode. 1 if in recovery, 0 otherwise.
Replication
Metric nameMetric keyDescription
Replication WAL restart delaypostgres.replication.restart_delayDifference between current WAL LSN and the restart_lsn as reported by pg_replication_slots.
Replication WAL confirmed flush lagpostgres.replication.confirmed_flush_lagDifference between current WAL LSN and the confirmed_flush_lsn as reported by pg_replication_slots.
Replication WAL confirmed flush lagpostgres.replication.slot_xmin_ageAge of the oldest transaction that this logical replication slot needs the database to retain, as reported by pg_replication_slots.
Database conflicts tablespacepostgres.database_conflicts.tablespace.countNumber of queries in this database that have been canceled due to dropped tablespaces, as reported by pg_stat_database_conflicts. Standby only.
Database conflicts lockpostgres.database_conflicts.lock.countNumber of queries in this database that have been canceled due to lock timeouts, as reported by pg_stat_database_conflicts. Standby only.
Database conflicts snapshotpostgres.database_conflicts.snapshot.countNumber of queries in this database that have been canceled due to old snapshots, as reported by pg_stat_database_conflicts. Standby only.
Database conflicts buffer pinpostgres.database_conflicts.bufferpin.countNumber of queries in this database that have been canceled due to pinned buffers, as reported by pg_stat_database_conflicts. Standby only.
Database conflicts deadlockpostgres.database_conflicts.deadlock.countNumber of queries in this database that have been canceled due to deadlocks, as reported by pg_stat_database_conflicts. Standby only.
Replication WAL write lagpostgres.replication.write_lagTime elapsed between flushing recent WAL locally and receiving notification that this standby server has written it, as reported by pg_stat_replication.
Replication WAL flush lagpostgres.replication.flush_lagTime elapsed between flushing recent WAL locally and receiving notification that this standby server has written and flushed it, as reported by pg_stat_replication.
Replication WAL replay lagpostgres.replication.replay_lagTime elapsed between flushing recent WAL locally and receiving notification that this standby server has written, flushed and applied it, as reported by pg_stat_replication.
Replication backend transaction agepostgres.replication.backend_xmin_ageAge of the backend's xmin horizon, as reported by pg_stat_replication.
Replication replay delaypostgres.replication.replay_delayDifference in bytes between the current WAL position and the last WAL position replayed on the standby server, as reported by pg_stat_replication.
WAL receiver received timeline IDpostgres.wal_receiver.received_tliTimeline number of the last WAL received and flushed to disk, as reported by pg_stat_wal_receiver. Standby only.
WAL receiver last message send agepostgres.wal_receiver.last_msg_send_ageTime elapsed since last message sent to origin WAL sender, as reported by pg_stat_wal_receiver. Standby only.
WAL receiver last message receipt agepostgres.wal_receiver.last_msg_receipt_ageTime elapsed since last message received from origin WAL sender, as reported by pg_stat_wal_receiver. Standby only.
WAL receiver latest end agepostgres.wal_receiver.latest_end_ageTime elapsed since last write-ahead log location reported to origin WAL sender, as reported by pg_stat_wal_receiver. Standby only.
Subscription
Metric nameMetric keyDescription
Subscription stats - apply errorpostgres.subscription_stats.apply_error.countNumber of times an error occurred while applying changes, as reported by pg_stat_subscription_stats.
Subscription stats - sync errorpostgres.subscription_stats.sync_error.countNumber of times an error occurred during the initial table synchronization, as reported by pg_stat_subscription_stats.
Subscription stats conflict - insert existspostgres.subscription_stats.confl_insert_exists.countNumber of times a row insertion violated a NOT DEFERRABLE unique constraint during the application of changes, as reported by pg_stat_subscription_stats.
Subscription stats conflict - update origin differspostgres.subscription_stats.confl_update_origin_differs.countNumber of times an update operation was applied to a row that had been previously modified by another source during the application of changes, as reported by pg_stat_subscription_stats.
Subscription stats conflict - update existspostgres.subscription_stats.confl_update_exists.countNumber of times that an updated row value violated a NOT DEFERRABLE unique constraint during the application of changes, as reported by pg_stat_subscription_stats.
Subscription stats conflict - update missingpostgres.subscription_stats.confl_update_missing.countNumber of times the tuple to be updated was not found during the application of changes, as reported by pg_stat_subscription_stats.
Subscription stats conflict - delete origin differspostgres.subscription_stats.confl_delete_origin_differs.countNumber of times a delete operation was applied to row that had been previously modified by another source during the application of changes, as reported by pg_stat_subscription_stats.
Subscription stats conflict - missing deletepostgres.subscription_stats.confl_delete_missing.countNumber of times the tuple to be deleted was not found during the application of changes, as reported by pg_stat_subscription_stats.
Subscription stats conflict - multiple unique conflictspostgres.subscription_stats.confl_multiple_unique_conflicts.countNumber of times a row insertion or an updated row values violated multiple NOT DEFERRABLE unique constraints during the application of changes, as reported by pg_stat_subscription_stats.
Queries
Metric nameMetric keyDescription
Tablespaces
Metric nameMetric keyDescription
Tablespace sizepostgres.tablespace.sizeTablespace size in bytes

Limitations

Top queries:

  • For security reasons ALTER statements are excluded from top query collection.

Execution plan details:

  • The extensions:configuration.actions:write permission is required to trigger the execution plan fetching.
  • An execution plan can only be fetched from the database where the dynatrace.dynatrace_execution_plan function has been created.

FAQ

How does this Dynatrace extension collect data from my databases?

This extension runs from your Dynatrace ActiveGates and connects to the configured databases. Once the connection is established, the extension regularly runs queries on the database to gather performance and health metrics, reporting the results back to Dynatrace.

Only SELECT queries are executed to collect data. To see exactly which queries run, download the extension yaml artifact: open the Release notes, select a release, and select Download version.

How often are these monitoring queries executed?

From version 2.3.0 onwards, query execution frequency is controlled by the configuration variables query-interval and heavy-query-interval. Most of the queries executed by the extension run every query-interval minutes (with a default of 1 minute), while the queries under the Queries feature set run every heavy-query-interval minutes (with a default of 5 minutes).

For older versions, most queries run every minute. The heavy queries mentioned above run every 5 minutes.

Why are some of the extension's queries failing?

Supporting a wide range of Postgres versions requires running several versions of the same queries in parallel, since Postgres has changed column names for several tables over time. Some queries failing is expected. As long as no data is missing, there is no cause for concern.

Hub

Explore in Dynatrace Hub

Monitor your Postgres performance via our new EF2.0 extension framework.

Related tags
DatabaseSQLSQLPostgresApplication Observability