PCA (Prometheus Certified Associate) sample exam question with answer 476

Question:
You maintain an HTTP API that you wish to monitor using Blackbox Exporter. You want to ensure that the API is served using HTTPS and that the returned status code is in the range 200-299.

Which of the following probe module configurations meets your requirements?

  1. prober: https
    https:
      valid_status_codes: 200-299
  2. prober: https
    https:
      valid_status_codes: 2xx
  3. prober: http
    http:
      valid_status_codes: 2xx
      fail_if_ssl: false
  4. prober: http
    http:
      valid_status_codes: 2xx
      fail_if_not_ssl: true
Answer:
D - is correct answer
A - is incorrect as there is no Blackbox prober called https. Additionally, the valid_status_codes attribute should be specified with a value of 2xx which stands for all status codes from 200 to 299. Note however that this syntax is specific to Blackbox Exporter. A value of 2xx can be used in a PromQL regular expression to target all 200-series status codes
B - is incorrect as there is no Blackbox prober called https
C - s incorrect as the proper attribute to fail the probe if SSL (HTTPS) is not used is fail_if_not_ssl: true