Blackbox exporter, trigger different alert for the same module

Hello

This is what I have now:

modules:
  http_test:
    prober: http
    http:
      fail_if_body_not_matches_regexp: ['^{"status":{"code":"UP","description":""}']

And for this I get notification via Teams.

modules:
  http_test:
    prober: http
    http:
      fail_if_body_not_matches_regexp: ['^{"status":{"code":"DEGRADED","description":""}']

If I get this notification I would like different kind of notification.

Is it possible to do that?

You could have a second module (e.g. http_test_degraded) and scrape that module too. Then you’d have two metrics that can be alerted on in different ways.

Thank you @stuart.

My question is quit to trigger different alert based on different module? And does this means that service will be pinged two times?

My prometheus.yml part:

 job_name: 'blackbox'
    metrics_path: /probe  #&debug=true
    params:
      module: [http_2xx]  # Look for a HTTP 200 response.
    static_configs:
      - targets: ["https://domain.com/resthealth"]
        labels:
          env: 'test'
          module: http_probe
      - targets: ["https://domain.com/set/health","https://domain.com/fhir/health","https://domain.com/tasks/health","https://domain.com/ehr/health"]

blackbox:

modules:
  http_probe:
    prober: http
    http:
      fail_if_body_not_matches_regexp: ['^{"status":{"code":"UP","description":""}']
  http_fhir:
    prober: http
    http:
      fail_if_body_not_matches_regexp: ['^{"status":"UP","components"']

I need to have another fail_if_body_not_matches_regexp: [‘^{“status”:{“code”:“DEPRICATED”,“description”:“”}’] with different alert “severity”