Custom metrics and permissions
Published 07 August 2026
Custom metrics let you specify any valid SQL to collect a numeric value from a monitored server, and optionally text to show in alert details. Redgate Monitor runs the SQL you supply on a schedule, using the user account you have configured for Redgate Monitor to connect to that server.
What Monitor does and doesn't restrict
The queries in a custom metric are intended to be read-only. Redgate Monitor helps guard against mistakes: each query runs inside a transaction that is always rolled back, so many accidental changes are undone.
However, this is not a security boundary. Someone acting deliberately can still have lasting effects - for example by managing their own transactions, calling procedures that commit independently, or running operating system commands. Redgate Monitor does not inspect or restrict what the SQL in a custom metric does; it only checks that it runs successfully and returns a result of the expected shape for that platform.
This means these queries can do anything the user account used for monitoring is permitted to do.
Why the scope of permissions matters
With a minimal-permission user account, the queries in a custom metric are limited to reading the data Redgate Monitor already reads. With a privileged account, they can change or delete anything on the server and, with some configuration options, can run commands on the host operating system.
Anyone who gains access to a Redgate Monitor administrator account, by whatever means, can create a custom metric, and it will run with the same rights. This is worth reviewing even if you trust everyone who administers Redgate Monitor.
Redgate recommends giving Redgate Monitor a user account with only the permissions it needs, rather than a privileged one. See:
- Permissions required to monitor SQL Server,
- Preparing PostgreSQL for monitoring,
- Preparing Oracle for monitoring.
What to do
1. Where possible, replace privileged logins with ones that have only the permissions Redgate Monitor needs. You can change a server's login on the Monitored servers page by editing the credentials.
This documentation contains proprietary information and is protected by copyright law.
Copyright © 2026 Red Gate Software Limited. All rights reserved