Bug 2060718 - prometheus: Add validations for relabel configs
Summary: prometheus: Add validations for relabel configs
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Monitoring
Version: 4.9
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.10.z
Assignee: Jayapriya Pai
QA Contact: Junqi Zhao
URL:
Whiteboard:
Depends On: 2051470
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-03-04 04:51 UTC by Jayapriya Pai
Modified: 2022-03-28 12:03 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 2051470
Environment:
Last Closed: 2022-03-28 12:03:18 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift prometheus-operator pull 161 0 None open Bug 2060718: Add relabel validations 2022-03-04 05:19:31 UTC
Red Hat Product Errata RHBA-2022:1026 0 None None None 2022-03-28 12:03:40 UTC

Comment 2 Junqi Zhao 2022-03-18 07:03:17 UTC
tested with PR, followed steps in Comment 7/8 of bug 2051470, removed the targetLabel, no error in the prometheus-k8s pod and the servicemonitor is skipped, so it would not loaded to prometheus configuration, and there's error "relabel configuration for replace action needs targetLabel value" in prometheus operator
prometheus-operator 0.53.1

# oc -n openshift-monitoring exec -c prometheus prometheus-k8s-0 -- cat /etc/prometheus/config_out/prometheus.env.yaml | grep "serviceMonitor/openshift-console/console-test/0"
no result

# oc -n openshift-monitoring logs -c prometheus prometheus-k8s-0 | grep "couldn't load configuration"
no result


# oc -n openshift-monitoring logs -c prometheus-operator $(oc -n openshift-monitoring get pod --no-headers | grep prometheus-operator | awk '{print $1}') | grep "relabel configuration for replace action needs targetLabel value"
level=warn ts=2022-03-18T06:44:33.852757829Z caller=operator.go:1832 component=prometheusoperator msg="skipping servicemonitor" error="relabel configuration for replace action needs targetLabel value" servicemonitor=openshift-console/console-test namespace=openshift-monitoring prometheus=k8s
level=warn ts=2022-03-18T06:44:34.326645292Z caller=operator.go:1832 component=prometheusoperator msg="skipping servicemonitor" error="relabel configuration for replace action needs targetLabel value" servicemonitor=openshift-console/console-test namespace=openshift-monitoring prometheus=k8s
level=warn ts=2022-03-18T06:46:50.096559124Z caller=operator.go:1832 component=prometheusoperator msg="skipping servicemonitor" error="relabel configuration for replace action needs targetLabel value" servicemonitor=openshift-console/console-test namespace=openshift-monitoring prometheus=k8s

Comment 8 errata-xmlrpc 2022-03-28 12:03:18 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (OpenShift Container Platform 4.10.6 bug fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:1026


Note You need to log in before you can comment on or make changes to this bug.