Skip to main content
Environments let you deploy the same monitors against different API deployments — for example, staging and production. Each environment has its own variables, secrets, and independent run history.

How environments work

When you run griffin init, a default environment is created automatically. You can add more:
Each monitor is deployed to a specific environment. The same monitor file can be deployed to multiple environments with different configuration.

Variables

Variables are stored in griffin.variables.json at the project root and are scoped per environment. The file is intended to be checked in so teams can share variable keys and values. Use variables to change values like base URLs between environments:
In your monitor files, reference variables with the variable() function:
When you run griffin apply staging, the CLI resolves variable("API_HOST") to https://api.staging.example.com.

Secrets

Secrets are also scoped per environment. See Secrets for details.

Deploying to environments

Most CLI commands accept an environment argument:
When no environment is specified, commands use the default environment.

Managing environments

Removing an environment locally does not delete monitors already deployed to the hub for that environment. Use griffin apply <env> --prune to clean up remote monitors.