On this page
Is this page helpful?
Platform.sh can notify you when various events happen on your project, in any environment. At this time the only notification provided is a low disk space warning, but others may be added in the future.
Remember that you must have
admin access to a project to add or modify an integration.
See User administration roles for more details.
All projects created prior to 6 April 2020 that did not have any health notifications enabled had an email notification added for admin users.
Platform.sh monitors disk space usage on all applications and services in your cluster.
- When available disk space drops below 20% or 4 GB, whichever is smaller, a warning notification is generated.
- When available disk space drops below 10% or 2 GB, whichever is smaller, a critical notification is generated.
- When available disk space returns above 20% or 4 GB, whichever is smaller, an all-clear notification is generated.
Notifications are generated every 5 minutes, so there may be a brief delay between when the threshold is crossed and when the notification is triggered.
Health notifications can be set up via the Platform.sh CLI, through a number of different channels.
A notification can trigger an email to be sent, from an address of your choosing to one or more addresses of your choosing.
You can view an email notification by running
platform integration:get +--------------+---------------+ | Property | Value | +--------------+---------------+ | id | abcdefghijklm | | type | health.email | | role | | | from_address | | | recipients | - '#admins' | +--------------+---------------+
To edit the
recipients that receive the default email notification, use the
platform integration:update abcdefghijklm --recipients firstname.lastname@example.org
recipients field may be any valid email address, or one of the following special values.
#adminsmaps to all project admins and up.
#viewersmaps to everyone with access to the project.
To add a new email notification, register a
health.email integration as follows:
platform integration:add --type health.email --recipients email@example.com --recipients firstname.lastname@example.org
You must specify one or more
recipients, each as its own switch.
from-address points to the “Platform.sh Bot”.
You can also configure a custom
--from-address is whatever address you want the email to appear to be from. It is completely fine to use the same email address for both
recipients. Note that depending on the configuration of the recipient mail server (including SPF and DKIM DNS entries) when using a custom
from-address, the email can be marked as spam or lost.
A notification can trigger a message to be sent to a Slack bot. First, create a new custom “bot user” for your Slack group and configure the channels you wish it to live in. Note the API token is the “Bot User OAuth Access Token” provided by Slack.
Then register that Slack bot with Platform.sh using a
platform integration:add --type health.slack --token YOUR_API_TOKEN --channel '#channelname'
That will trigger the corresponding bot to post a notification to the
#channelname channel in your Slack group.
A notification can trigger a message to be sent via PagerDuty, if you are using that service. First, create a new PagerDuty “integration” that uses the Events API v2. Copy the “Integration Key” as known as the “routing key” for the integration.
Now register a
health.pagerduty integration as follows:
platform integration:add --type health.pagerduty --routing-key YOUR_ROUTING_KEY
Any notification will now trigger an alert in PagerDuty.
You can then verify that your integration is functioning properly using the CLI command
$ platform integration:validate