Skip to content

Variables

On this page
  1. Create a variable
  2. Use a variable in a sensor
  3. When a variable is missing
  4. Variables or secrets?

A variable is a plain value stored in an environment and reused in sensor fields as ${NAME}: a host, a port, a base URL. Change the value once, and every sensor that uses it picks the new value at its next check. Give the same variable a different value per environment, and the same sensor configuration works everywhere.

Variables require a paid plan and are managed by Managers and Admins.

Create a variable#

  1. Open Configuration → Environments and select the environment.
  2. In the Variables card, click New variable.
  3. Enter a Key — capital letters, digits and underscores only, for example API_HOST — and a Value — api.corvane.example.
  4. Save.

A key is unique within an environment; the same key in another environment is a separate variable.

Variables of the Production environment: API_HOST set to api.corvane.example, PG_PRIMARY to 10.20.1.21 and WEB_HOST to www.corvane.example, with a New variable button.
Variables are plain values, used in sensor fields as ${KEY}.

Use a variable in a sensor#

Write ${KEY} in a supported field:

Sensor Fields
HTTP, Keyword, JSON, XML URL, Basic username and password, Bearer token, header names and values
Ping, Port, Domain, Certificate Host
SQL database Query
Key-value store Key name, field
Dead-letter queue Queue name
File checksum File path

Several variables can be combined: https://${API_HOST}:${API_PORT}/health. The request payload of HTTP sensors does not accept variables.

Variables are replaced when the check is prepared, just before it is sent to the agent; the agent receives the final value. Saving a sensor that uses a variable requires the Manager role.

When a variable is missing#

If a sensor uses a variable that does not exist in its environment, the check is skipped: no result, no incident. The sensor then shows as Not checked. Check the key and the sensor's environment.

Variables or secrets?#

Variables Secrets
For Hosts, ports, URLs, names Connection strings and credentials
Stored In plain text Encrypted
Displayed Always Never, after saving
Used ${KEY} in text fields Secret selector of SQL, Key-value and Dead-letter queue sensors

Do not store passwords or tokens in variables: they are visible to anyone who can open the environment.