cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to get notified by email when Application Autoscaler scales down to 1 instance?

tarikkoc
Discoverer
0 Kudos
247

Hi everyone,

I’m using Application Autoscaler on SAP BTP Cloud Foundry to reduce the number of instances of my application when the load drops. This works as expected — I can see that the instance count scales down to 1 based on the defined policy.

What I want to achieve is:
Receive an email notification automatically whenever the application scales down, especially when it reaches 1 instance.

My Questions:

  • Is it possible to configure this directly within the policy.json file used by the autoscaler?

  • If not, is there any built-in mechanism in BTP (without writing custom code or external integrations) that can notify us when such a scaling event happens?

  • Is there a way to connect autoscaler events to an email notification flow, fully within BTP services?

Thanks in advance for any suggestions or examples.

Accepted Solutions (1)

Accepted Solutions (1)

Willem_Pardaens
Product and Topic Expert
Product and Topic Expert
0 Kudos

The SAP Alert Notification service for BTP has some standard events about changes/actions in the Cloud Foundry environment. There is a 'process scale' event which is (I think) what you need: https://help.sap.com/docs/alert-notification/sap-alert-notification-for-sap-btp/audit-application-pr.... Give it a go and let us know if this does the trick?

To set this up, follow the steps here: https://help.sap.com/docs/alert-notification/sap-alert-notification-for-sap-btp/initial-setup and don't forget to activate the 'enableCloudControllerAuditEvents' flag.

tarikkoc
Discoverer

Hi, Thanks a lot for the helpful suggestion! Following your guidance, I was able to successfully receive notifications when my app scaled down. Here's what I did step by step:
1) I updated the Alert Notification service instance using: cf update-service SERVICE_NAME -c "{\"enableCloudControllerAuditEvents\": true}"
2) In the Alert Notification cockpit, I created a subscription with the following conditions: eventType is equal to audit.app.process.scale resource.resourceName is equal to APP_NAME
3) I then triggered the event manually using: cf scale APP_NAME -i 1
After this setup, I was able to receive the email notification successfully. Thanks again for pointing me in the right direction.

Answers (0)