Enable Salesforce notifications

Enable Salesforce notifications

This section describes how to enable StackLight LMA to create Salesforce cases from Prometheus alerts on an existing cluster. StackLight LMA uses Alertmanager and the Salesforce notifier service to create the Salesforce cases.

Note

Skip this section if you have already defined the variables for Alertmanager Salesforce notifications during the deployment model creation as described in MCP Deployment Guide: General deployment parameters and MCP Deployment Guide: Infrastructure related parameters: Alertmanager Salesforce notifications.

If you configured Salesforce notifications through the Push Notification service, first proceed to Switch to Alertmanager-based notifications.

To enable StackLight LMA to send Salesforce notifications through Alertmanager:

  1. Open your Git project repository with the Reclass model on the cluster level.

  2. In classes/cluster/<cluster_name>/stacklight/client.yml, specify:

    classes:
    - system.docker.swarm.stack.monitoring.sf_notifier
    
    [...]
    
    parameters:
      _params:
        docker_image_sf_notifier: "${_param:mcp_docker_registry}/openstack-docker/sf_notifier:${_param:mcp_version}"
    
  3. In classes/cluster/<cluster_name>/stacklight/server.yml, specify:

    classes:
    - system.prometheus.alertmanager.notification.salesforce
    - system.prometheus.sf_notifier.container
    
    [...]
    
    parameters:
      _params:
        sf_notifier_sfdc_auth_url: "<salesforce_instance_http_endpoint>"
        sf_notifier_sfdc_username: "<customer_account_email>"
        sf_notifier_sfdc_password: "<customer_account_password>"
        sf_notifier_sfdc_organization_id: "<organization_id>"
        sf_notifier_sfdc_environment_id: "<cloud_id>"
        sf_notifier_sfdc_sandbox_enabled: "True/False"
    

    Warning

    If you have previously configured email notifications through Alertmanager, verify that the prometheus_server_alert_label_route parameter in server.yml includes not only the email but also salesforce values.

  4. Log in to the Salt Master node.

  5. Refresh Salt pillars:

    salt '*' saltutil.refresh_pillar
    
  6. Create the directory structure for the Salesforce notifier service:

    salt -C 'I@docker:swarm and I@prometheus:server' state.sls prometheus.sf_notifier
    
  7. Start the sf-notifier service in Docker container:

    salt -C 'I@docker:swarm:role:master' state.sls docker.client
    
  8. Update the Prometheus configuration to create metrics target and alerts:

    salt -C 'I@docker:swarm and I@prometheus:server' state.sls prometheus.server -b 1
    
  9. Update the Alertmanager configuration to create the webhook receiver:

    salt -C 'I@docker:swarm and I@prometheus:server' state.sls prometheus.alertmanager -b 1