Bug 2229267 - Labeled Perf Counters "counter dump" asok command emits invalid JSON
Summary: Labeled Perf Counters "counter dump" asok command emits invalid JSON
Keywords:
Status: ON_QA
Alias: None
Product: Red Hat Ceph Storage
Classification: Red Hat Storage
Component: Ceph-Dashboard
Version: 6.1
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: ---
: 6.1z2
Assignee: avan
QA Contact: Sayalee
Anjana Suparna Sriram
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-08-04 16:42 UTC by Ali Maredia
Modified: 2023-08-09 05:11 UTC (History)
6 users (show)

Fixed In Version: ceph-17.2.6-105.el9cp
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Ceph Project Bug Tracker 61587 0 None None None 2023-08-04 16:42:23 UTC
Github ceph ceph pull 52469 0 None Merged reef: common: `counter dump` command revision 2023-08-07 16:24:32 UTC
Red Hat Issue Tracker RHCEPH-7163 0 None None None 2023-08-04 16:43:02 UTC
Red Hat Issue Tracker RHCSDASH-1044 0 None None None 2023-08-04 16:43:04 UTC

Description Ali Maredia 2023-08-04 16:42:23 UTC
Description of problem:

Copied from: https://tracker.ceph.com/issues/61587

{
...
    "rbd_mirror_snapshot_image": {
        "labels": {
            "image": "b1",
            "namespace": "",
            "pool": "data" 
        },
        "counters": {
            "snapshots": 1,
            "sync_time": {
                "avgcount": 1,
                "sum": 0.394751259,
                "avgtime": 0.394751259
            },
            "sync_bytes": 3203072,
            "remote_timestamp": 1685658580.065694857,
            "local_timestamp": 1685658580.065694857,
            "last_sync_time": 0.394751259,
            "last_sync_bytes": 3203072
        }
    },
    "rbd_mirror_snapshot_image": {
        "labels": {
            "image": "b2",
            "namespace": "",
            "pool": "data" 
        },
        "counters": {
            "snapshots": 1,
            "sync_time": {
                "avgcount": 1,
                "sum": 0.383831520,
                "avgtime": 0.383831520
            },
            "sync_bytes": 4182016,
            "remote_timestamp": 1685659196.821769027,
            "local_timestamp": 1685659196.821769027,
            "last_sync_time": 0.383831520,
            "last_sync_bytes": 4182016
        }
    },
...
}

needs to become

{
...
    "rbd_mirror_snapshot_image": [
        {
            "labels": {
                "image": "b1",
                "namespace": "",
                "pool": "data" 
            },
            "counters": {
                "snapshots": 1,
                "sync_time": {
                    "avgcount": 1,
                    "sum": 0.394751259,
                    "avgtime": 0.394751259
                },
                "sync_bytes": 3203072,
                "remote_timestamp": 1685658580.065694857,
                "local_timestamp": 1685658580.065694857,
                "last_sync_time": 0.394751259,
                "last_sync_bytes": 3203072
            }
        },
        {
            "labels": {
                "image": "b2",
                "namespace": "",
                "pool": "data" 
            },
            "counters": {
                "snapshots": 1,
                "sync_time": {
                    "avgcount": 1,
                    "sum": 0.383831520,
                    "avgtime": 0.383831520
                },
                "sync_bytes": 4182016,
                "remote_timestamp": 1685659196.821769027,
                "local_timestamp": 1685659196.821769027,
                "last_sync_time": 0.383831520,
                "last_sync_bytes": 4182016
            }
        },
    ],
...
}

Otherwise a compliant JSON parser is free to pick up only one of the mirrored images, at random, since they are dumped in the same dictionary under the same "rbd_mirror_snapshot_image" key.

This was missed in https://github.com/ceph/ceph/pull/48657 (mentioned but lost in backwards compatibility discussions). The exporter daemon would need be adjusted accordingly.



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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

This issue has already been resolved upstream but was not backported to Quincy. This BZ is to track the backport to RHCS 6.


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