]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mgr: add new API to fetch labeled perf schema
authorNaveen Naidu <naveennaidu479@gmail.com>
Wed, 19 Mar 2025 13:45:00 +0000 (19:15 +0530)
committerNaveen Naidu <naveennaidu479@gmail.com>
Tue, 8 Apr 2025 02:26:46 +0000 (07:56 +0530)
commita4aebd83907a7d4f1ed5275b0adccf6d491bc296
tree5ad787d560f4e3f3e586c2151e8bf1bed97a8b8a
parentf941025561ecd6e42b032980d77555ef2540aa70
mgr: add new API to fetch labeled perf schema

The manager clients such as telemetry fetches the performance counter
schema using the 'get_unlabled_perf_schema' API. The information from
these schemas are then used to fetch the latest values of these perf
counters. The schema from the current API does not expose the
information about labeled performance counters.

The representation format of the schema using the current API is not
capable of supporting labeled counters as it is. This is because of the
presence of NULL delimiters which are used to segregate the key name and
labels in the counter path. Because of these NULL delimiters, the
labeled counters would only have the key name in the emitted perf
schema.

Hence a new API 'get_perf_schema' has been introduced to support
labeled counters.

The new schema format from this API looks like:
```json
{
 "osd_scrub_sh_repl": [
  {
    "labels": {
      "level": "shallow",
      "pooltype": "replicated"
    },
    "counters": {
      "successful_scrubs_elapsed": {
        "description": "",
        "nick": "",
        ...
      }
    }
  }
 ]
}
```

Two new subfields 'labels' and 'counters' have been added to each
counter. This format is similar to what one would expect when they run
the command `ceph tell osd.0 counter dump`

Signed-off-by: Naveen Naidu <naveen.naidu@ibm.com>
doc/mgr/modules.rst
src/mgr/ActivePyModules.cc
src/mgr/ActivePyModules.h
src/mgr/BaseMgrModule.cc
src/pybind/mgr/ceph_module.pyi
src/pybind/mgr/mgr_module.py