Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 2060714

Summary: [DOCS] Change source_labels to sourceLabels in "Configuring remote write storage" section
Product: OpenShift Container Platform Reporter: Swetha Sankar <ssankar>
Component: MonitoringAssignee: Jan Fajerski <jfajersk>
Status: CLOSED ERRATA QA Contact: Junqi Zhao <juzhao>
Severity: medium Docs Contact:
Priority: high    
Version: 4.9CC: amuller, anpicker, aos-bugs, spasquie
Target Milestone: ---   
Target Release: 4.11.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-08-10 10:52:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Swetha Sankar 2022-03-04 04:07:28 UTC
Document URL: 
https://docs.openshift.com/container-platform/4.9/monitoring/configuring-the-monitoring-stack.html#configuring_remote_write_storage_configuring-the-monitoring-stack

Section Number and Name: 
Point 4 under "Configuring remote write storage"

Describe the issue: 

The sample configuration in the above-mentioned section for adding write relabel configuration values in cluster-monitoring-config is as below:
 
      remoteWrite:
      - url: "https://remote-write.endpoint"
        writeRelabelConfigs:
        - source_labels: [__name__]
          regex: 'my_metric'
          action: keep

Here "source_labels" is wrong (It should be "sourceLabels").
Configuring remote write in this way would result in regex not being able to match as the prometheus config resulting from this cm would be:


$ oc exec  -n openshift-monitoring pod/prometheus-k8s-1 cat /etc/prometheus/config_out/prometheus.env.yaml

remote_write:
- url: https://remote-write.endpoint
  remote_timeout: 30s
  write_relabel_configs:
  - regex: my_metric           <----- no source label to match
    action: keep
	
when it should be: 

remote_write:
- url: https://remote-write.endpoint
  remote_timeout: 30s
  write_relabel_configs:
  - source_labels:
    - __name__
    regex: my_metric
    action: keep

Suggestions for improvement: 

 Change "source_labels" to "sourceLabels" in the document.


Version-Release number of selected component (if applicable):

4.9 

How reproducible:

100% 

Steps to Reproduce:
1. Configure remoteWrite as in doc with writeRelabelConfigs

Actual results:
Regex does not match.

$ oc exec  -n openshift-monitoring pod/prometheus-k8s-1 cat /etc/prometheus/config_out/prometheus.env.yaml

remote_write:
- url: https://remote-write.endpoint
  remote_timeout: 30s
  write_relabel_configs:
  - regex: my_metric           <----- no source label to match
    action: keep

Expected results:
Regex should match.

$ oc exec  -n openshift-monitoring pod/prometheus-k8s-1 cat /etc/prometheus/config_out/prometheus.env.yaml


remote_write:
- url: https://remote-write.endpoint
  remote_timeout: 30s
  write_relabel_configs:
  - source_labels:
    - __name__
    regex: my_metric

Comment 2 Jan Fajerski 2022-03-04 09:10:48 UTC
Removing blocker as doc error has been release already.

Comment 3 Jan Fajerski 2022-03-09 08:38:29 UTC
PR and backports are merged, the 4.9 version already reflects this fix, closing.

https://docs.openshift.com/container-platform/4.9/monitoring/configuring-the-monitoring-stack.html#configuring_remote_write_storage_configuring-the-monitoring-stack

Comment 8 errata-xmlrpc 2022-08-10 10:52:11 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 (Important: OpenShift Container Platform 4.11.0 bug fix and security 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/RHSA-2022:5069