Bug 2060714 - [DOCS] Change source_labels to sourceLabels in "Configuring remote write storage" section
Summary: [DOCS] Change source_labels to sourceLabels in "Configuring remote write stor...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Monitoring
Version: 4.9
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: ---
: 4.11.0
Assignee: Jan Fajerski
QA Contact: Junqi Zhao
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-03-04 04:07 UTC by Swetha Sankar
Modified: 2022-08-10 10:52 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-08-10 10:52:11 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift openshift-docs pull 42796 0 None open BZ2060714: monitoring: Fix example writeRelabelConfig field name in remoteWrite … 2022-03-04 09:10:47 UTC
Red Hat Product Errata RHSA-2022:5069 0 None None None 2022-08-10 10:52:30 UTC

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


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