Prometheus scrape fails with "metric name [..] does not support exemplars"

Solution Verified - Updated -

Environment

  • Red Hat OpenShift Container Platform (RHOCP) 4.11, 4.12

Issue

  • In the Console, a metrics targets in Openshift shows that their status is Down
  • Metrics are missing
  • The error seen in the logs is the following:

    Scrape failed
    metric name http_server_requests_seconds_count does not support exemplars`
    

Resolution

  • There are changes on how exemplars are handled included in Prometheus version 2.43 or later. Upgrade to Red Hat OpenShift Container Platform (OCP) 4.14 or later to resolve the issue.
  • Red Hat is planning to backport the change to OpenShift Container Platform 4.13 in the following issue: OCPBUGS-26423
  • As a workaround, change the metric type to that of a Counter or Histogram bucket.
  • Another workaround is to return Prometheus metrics in the text/plain format, which is not affected by this issue.

Root Cause

  • Prior to Prometheus version 2.43 exemplars are only supported on Counters and Histogram buckets.

Diagnostic Steps

  • check the Targetdown alert, The following error will be present:

    Scrape failed: Metrics name $METRIC_NAME_count does not support exemplars
    

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments