| commit | 56909b737b443e00e535d7d87441e9577893642e | [log] [tgz] |
|---|---|---|
| author | Jayanth Othayoth <ojayanth@gmail.com> | Thu Dec 25 04:07:49 2025 -0600 |
| committer | Jayanth Othayoth <ojayanth@gmail.com> | Mon Dec 29 07:43:16 2025 -0600 |
| tree | 8ca3f0bee6a3422d090dbacd5cea53f9d349cc4f | |
| parent | 66db900fa95b28f8e5f4a313196026cc4d04cfed [diff] |
clang-tidy: guard optional JSON access
Add explicit control flow before dereferencing
std::optional<nlohmann::json> in src/report_manager.cpp. Read fields
only on the engaged path to satisfy bugprone-unchecked-optional-access
and keep builds passing with -Werror. No functional changes.
Fixed below type errors
'''
../src/report_manager.cpp:186:30: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]
186 | size_t version = data->at("Version").get<size_t>();
| ^~~~
../src/report_manager.cpp:191:28: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]
191 | bool enabled = data->at("Enabled").get<bool>();
| ^~~~
../src/report_manager.cpp:192:31: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]
192 | std::string& id = data->at("Id").get_ref<std::string&>();
| ^~~~
../src/report_manager.cpp:193:33: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]
193 | std::string& name = data->at("Name").get_ref<std::string&>();
| ^~~~
'''
Change-Id: I76faad387fa3786b8770653c745c7ea05d525911
Signed-off-by: Jayanth Othayoth <ojayanth@gmail.com>
This component implements middleware for sensors and metrics aggregation.
This application is implementation of Telemetry proposed in OpenBMC design docs [1].
It's responsible for:
[2],[3] updates.[4]There are two way to build telemetry service:
To build it using bitbake follow the guide from OpenBMC docs[5]. To build it using meson follow the quick guide to install meson[6] and then run below commands
meson build
cd build
ninja
After successful build you should be able to run telemetry binary or start unit tests
./tests/telemetry-ut ./telemetry
In case if system is missing boost dependency, it is possible to build it locally and set BOOST_ROOT environment variable to location of built files for meson. After this change meson should be able to detect boost dependency. See [7] for more details.
More information can be found in OpenBMC docs repository [8].