Bug 2180440 - odf-monitoring-tool. YAML file misjudged as corrupted
Summary: odf-monitoring-tool. YAML file misjudged as corrupted
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenShift Data Foundation
Classification: Red Hat Storage
Component: ceph-monitoring
Version: 4.13
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: ODF 4.13.0
Assignee: arun kumar mohan
QA Contact: Daniel Osypenko
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-03-21 13:21 UTC by Daniel Osypenko
Modified: 2023-08-09 16:37 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-06-21 15:24:39 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2023:3742 0 None None None 2023-06-21 15:24:52 UTC

Description Daniel Osypenko 2023-03-21 13:21:49 UTC
Description of problem (please be detailed as possible and provide log
snippests):

Passing the valid YAML file, the script produces an ERROR:

anielosypenko@dosypenk-mac comparealerts % ./comparealerts ../prometheus-ocs-rules.yaml ../prometheus_alerts.yml 
[ERROR] 2023/03/21 13:38:09 main.go:122: Alert file2: "../prometheus_alerts.yml" error: corrupted yaml or json file: ../prometheus_alerts.yml

same error appeared with valid JSON file
danielosypenko@dosypenk-mac comparealerts % ./comparealerts -of pp ../prometheus-ocs-rules.json ../prometheus_alerts.json
[ERROR] 2023/03/21 14:24:29 main.go:122: Alert file2: "../prometheus_alerts.json" error: corrupted yaml or json file: ../prometheus_alerts.json

Version of all relevant components (if applicable):

The monitoring-tool from the repo https://github.com/red-hat-storage/odf-monitoring-tools, last commit beef0905efc172c77f0446398b2eed24d5a3c3ab from Feb 22, 2023

go version go1.20.2 darwin/arm64

Does this issue impact your ability to continue to work with the product
(please explain in detail what is the user impact)?

yes

Is there any workaround available to the best of your knowledge?

--

Rate from 1 - 5 the complexity of the scenario you performed that caused this
bug (1 - very simple, 5 - very complex)?

2

Can this issue reproducible?

yes

Can this issue reproduce from the UI?

no

If this is a regression, please provide more details to justify this:

not a regression. Issue found within Happy Path validation

Steps to Reproduce:

1. git clone https://github.com/red-hat-storage/odf-monitoring-tools.git

2. cd into comparealerts directory of the project

3. go build

    3.a a binary executable, named: comparealerts ,  will be created

4. download upstream and downstream prometheus rules yaml files

https://github.com/red-hat-storage/ocs-operator/blob/main/metrics/deploy/prometheus-ocs-rules.yaml

and

https://github.com/ceph/ceph/blob/main/monitoring/ceph-mixin/prometheus_alerts.yml 

5. run cmd ./comparealerts -of pp <path_to_file>/prometheus-ocs-rules.yaml <path_to_file>/prometheus_alerts.yml

6. convert <path_to_file>/prometheus-ocs-rules.yaml and <path_to_file>/prometheus_alerts.yml to JSON files, insure that files contain valid JSONs and run step 5 with JSON files instead of YAML 

Actual results:
[ERROR] 2023/03/21 13:39:09 main.go:122: Alert file2: "../prometheus_alerts.yml" error: corrupted yaml or json file: ../prometheus_alerts.yml

Expected results:

differences between prometheus rules Pretty Printed to standard output

Additional info:
Feature ticket - https://issues.redhat.com/browse/RHSTOR-3803

Comment 3 arun kumar mohan 2023-03-28 13:57:50 UTC
This is fixed with this change PR: https://github.com/red-hat-storage/odf-monitoring-tools/pull/3/files and it is merged now.
Please check.

Comment 4 Daniel Osypenko 2023-03-30 09:36:57 UTC
https://github.com/red-hat-storage/odf-monitoring-tools with latest merged commit a65719edaff0ef038498d1bb13affd50f073fe25 passes the test

Comment 9 errata-xmlrpc 2023-06-21 15:24:39 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 (Red Hat OpenShift Data Foundation 4.13.0 enhancement and 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-2023:3742


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