History log of /openbmc/bmcweb/redfish-core/lib/metric_report_definition.hpp (Results 1 – 25 of 59)
Revision Date Author Comments
# 40e9b92e 10-Sep-2024 Ed Tanous <etanous@nvidia.com>

Use SPDX identifiers

SPDX identifiers are simpler, and reduce the amount of cruft we have in
code files. They are recommended by linux foundation, and therefore we
should do as they allow.

This pa

Use SPDX identifiers

SPDX identifiers are simpler, and reduce the amount of cruft we have in
code files. They are recommended by linux foundation, and therefore we
should do as they allow.

This patchset does not intend to modify any intent on any existing
copyrights or licenses, only to standardize their inclusion.

[1] https://www.linuxfoundation.org/blog/blog/copyright-notices-in-open-source-software-projects

Change-Id: I935c7c0156caa78fc368c929cebd0f068031e830
Signed-off-by: Ed Tanous <etanous@nvidia.com>

show more ...


# dac07cad 31-Dec-2024 Boleslaw Ogonczyk Makowski <boleslawx.ogonczyk-makowski@intel.com>

Fix MRD patch request with overwriting metrics

Follow-up for [1]
Patch request with body:

{"Metrics": [{"MetricProperties": ["<path_to_sensor>"]}]}

updates metric properly, without appending to ol

Fix MRD patch request with overwriting metrics

Follow-up for [1]
Patch request with body:

{"Metrics": [{"MetricProperties": ["<path_to_sensor>"]}]}

updates metric properly, without appending to old "MetricProperties"
values

[1]: https://gerrit.openbmc.org/c/openbmc/bmcweb/+/76532

Change-Id: I9e2bbea28f3b17adeb61c7f3e54eec87c103ef54
Signed-off-by: Boleslaw Ogonczyk Makowski <boleslawx.ogonczyk-makowski@intel.com>

show more ...


# a64919e8 12-Dec-2024 Boleslaw Ogonczyk Makowski <boleslawx.ogonczyk-makowski@intel.com>

Fix issues in MRD patch requests

After commit [1] 'null' value was being rejected with
[json_utils.hpp] Value for key Metrics was incorrect type: null
Using 'null' here seems to be one of the cases

Fix issues in MRD patch requests

After commit [1] 'null' value was being rejected with
[json_utils.hpp] Value for key Metrics was incorrect type: null
Using 'null' here seems to be one of the cases that [2] describes

Commit [3] fixed an issue where {} replaced "MetricProperties" of
a metric with an empty array but introduced a different one
- trying to replace a metric caused new values in "MetricProperties"
to get added to old ones.
if (metric.find("MetricProperties") == metric.end()) check was initially
present in [4] but got removed at some point,
re-adding it fixes the issue

Tested:
Patch request to [5] with body: {"Metrics": [null]} no longer fails
and deletes a metric
Patch request with {"Metrics": [{}]} leaves metric unchanged
Patch request with
{"Metrics": [{"MetricProperties": ["<path_to_sensor>"]}]}
updates metric properly,
without appending to old "MetricProperties" values
Patch requests containing mixed values also work correctly

[1]: b14f357f527eae05aa1bd7a115d3f6ed237a35bb
[2]: 8099c51796bf6f94ad5fbb1f6844d700f498d3bb
[3]: ba498310f761b3c0f475ecbdb293cf1386544a33
[4]: https://gerrit.openbmc.org/c/openbmc/bmcweb/+/72319
[5]: https://<bmcip>/redfish/v1/TelemetryService/MetricReportDefinitions/<existing_mrd_name>

Change-Id: Ia3d4699784f493bd63a2df4d6edf5053760221e1
Signed-off-by: Boleslaw Ogonczyk Makowski <boleslawx.ogonczyk-makowski@intel.com>

show more ...


# deae6a78 11-Nov-2024 Ed Tanous <etanous@nvidia.com>

Move getProperty calls to utility

Having all dbus calls run through the same utility reduces the amount of
generated code, and more importantly, gives us a place where we can log
the requests and re

Move getProperty calls to utility

Having all dbus calls run through the same utility reduces the amount of
generated code, and more importantly, gives us a place where we can log
the requests and responses to help with debugging.

Tested: Redfish service validator passes.

Change-Id: Ic1bf45130b5069cd57f7af26e12c8d3159c87c67
Signed-off-by: Ed Tanous <etanous@nvidia.com>

show more ...


# afc474ae 09-Oct-2024 Myung Bae <myungbae@us.ibm.com>

Format readjson

clang-format may potentially reformat the readJson calls if they may
have more keys or key names are longer. This makes formatting in a way
that's readable by forcing to break a line

Format readjson

clang-format may potentially reformat the readJson calls if they may
have more keys or key names are longer. This makes formatting in a way
that's readable by forcing to break a line for each key using an
empty-comment (`//`) each line.

It also allows trivially alphabetizing the list such that new additions
are less likely to have merge conflicts.

Tested:
- Check whitespace only.
- Code compiles.
- Redfish Service Validator with the same results before this

Change-Id: I3824a8c4faa9fa7c820d5d2fab6b565404926e2c
Signed-off-by: Ed Tanous <etanous@nvidia.com>
Signed-off-by: Myung Bae <myungbae@us.ibm.com>

show more ...


# ba498310 10-Oct-2022 Krzysztof Grobelny <krzysztof.grobelny@intel.com>

Improved telemetry service error handling

By using data that is send in error massage it is possible to report
detailed information about error to user. Now instead of performing same
validation in

Improved telemetry service error handling

By using data that is send in error massage it is possible to report
detailed information about error to user. Now instead of performing same
validation in bmcweb and backend it can be performed only in backend and
send back detailed error information.

Tested:
- Tested with https://gerrit.openbmc.org/c/openbmc/telemetry/+/57177
- All telemetry features are working as before
- Error codes in bmcweb are more detailed, for example invalid argument
instead of internal error.

Change-Id: I424d91b9c8d70c8320f66b582e110c2e7b906107
Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com>
Signed-off-by: Eryk Siejk <erykx.siejk@intel.com>
Signed-off-by: Michal Orzel <michalx.orzel@intel.com>

show more ...


# b4361d63 22-Aug-2024 Ed Tanous <etanous@nvidia.com>

Refactor

Reduce the amount of code in handleReportPatch by moving to some of
the dependent callbacks.

Tested: Tested in last commit of series

Change-Id: Id4462ce6b29afcdd303db1790793cf68b23f04c3
S

Refactor

Reduce the amount of code in handleReportPatch by moving to some of
the dependent callbacks.

Tested: Tested in last commit of series

Change-Id: Id4462ce6b29afcdd303db1790793cf68b23f04c3
Signed-off-by: Ed Tanous <etanous@nvidia.com>

show more ...


# bd79bce8 16-Aug-2024 Patrick Williams <patrick@stwcx.xyz>

clang-format: re-format for clang-18

clang-format-18 isn't compatible with the clang-format-17 output, so we
need to reformat the code with the latest version. The way clang-18
handles lambda forma

clang-format: re-format for clang-18

clang-format-18 isn't compatible with the clang-format-17 output, so we
need to reformat the code with the latest version. The way clang-18
handles lambda formatting also changed, so we have made changes to the
organization default style format to better handle lambda formatting.

See I5e08687e696dd240402a2780158664b7113def0e for updated style.
See Iea0776aaa7edd483fa395e23de25ebf5a6288f71 for clang-18 enablement.

Change-Id: Iceec1dc95b6c908ec6c21fb40093de9dd18bf11a
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# 539d8c6b 19-Jun-2024 Ed Tanous <ed@tanous.net>

Consistently use generated enumerations

This commit causes all of Redfish to use generated enum values for enum
types. Using generated code prevents problems, and makes it more clear
what types are

Consistently use generated enumerations

This commit causes all of Redfish to use generated enum values for enum
types. Using generated code prevents problems, and makes it more clear
what types are allowed.

Doing this found two places where we had structs that didn't fulfill the
schema. They have been commented, but will be fixed with a breaking
change at some point in the future.

Tested: WIP

Change-Id: I5fdd2f2dfb6ec05606a522e1f4e331f982c8e476
Signed-off-by: Ed Tanous <ed@tanous.net>

show more ...


# 5b90429a 16-Apr-2024 Ed Tanous <ed@tanous.net>

Add missing headers

Most of these were found by breaking every redfish class handler into
its own compile unit:

When that's done, these missing headers become compile errors. We
should just fix the

Add missing headers

Most of these were found by breaking every redfish class handler into
its own compile unit:

When that's done, these missing headers become compile errors. We
should just fix them.

In addition, this allows us to enable automatic header checking in
clang-tidy using misc-header-cleaner. Because the compiler can now
"see" all the defines, it no longer tries to remove headers that it
thinks are unused.

[1] https://github.com/openbmc/bmcweb/commit/4fdee9e39e9f03122ee16a6fb251a380681f56ac

Tested: Code compiles.

Change-Id: Ifa27ac4a512362b7ded7cc3068648dc4aea6ad7b
Signed-off-by: Ed Tanous <ed@tanous.net>

show more ...


# 891eaa7c 08-Apr-2024 Ed Tanous <ed@tanous.net>

Use rvalue reference

Change-Id: Ie1a03bac54183b206bf27e37f1fed804601c8643
Signed-off-by: Ed Tanous <ed@tanous.net>


# 47f2934c 19-Mar-2024 Ed Tanous <ed@tanous.net>

Fix redundant init issues

clang-tidy-18 must've fixed their checking for these in headers.
Resolve as the robot commands.

Tested: Noop changes made by tidy. Code compiles.

Change-Id: I1de7686c597

Fix redundant init issues

clang-tidy-18 must've fixed their checking for these in headers.
Resolve as the robot commands.

Tested: Noop changes made by tidy. Code compiles.

Change-Id: I1de7686c597deffb0df91c30dae1a29f9ba7900e
Signed-off-by: Ed Tanous <ed@tanous.net>

show more ...


# b14f357f 06-Mar-2024 Ed Tanous <ed@tanous.net>

Clean up metric report definition to use readJsonObject

Change-Id: I29a9ecbdc9011b6513dc6bfccd28e7e7158fed9b
Signed-off-by: Ed Tanous <ed@tanous.net>


# 367b3dce 17-Jan-2024 Ginu George <ginugeorge@ami.com>

Pass correct Argument Types to propertyValueIncorrect Error Message

Changed the code to pass the parameters according to their types.

Tested: Code Compiles properly and tested.

Change-Id: Ie0e13d3

Pass correct Argument Types to propertyValueIncorrect Error Message

Changed the code to pass the parameters according to their types.

Tested: Code Compiles properly and tested.

Change-Id: Ie0e13d39cd892afda36dfabec871f0fe8d8498e4
Signed-off-by: Ginu George <ginugeorge@ami.com>

show more ...


# 95bdb5f0 27-Oct-2023 Ed Tanous <edtanous@google.com>

Break out retrieveUriToDbusMap

Change-Id: I7c01c9e455b077348ceb67e524158f997fb0c6cf
Signed-off-by: Ed Tanous <edtanous@google.com>


# 5a39f77a 20-Oct-2023 Patrick Williams <patrick@stwcx.xyz>

clang-format: copy latest and re-format

clang-format-17 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest

clang-format: copy latest and re-format

clang-format-17 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest .clang-format from the docs repository and reformat the
repository.

Change-Id: I2f9540cf0d545a2da4d6289fc87b754f684bc9a7
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# 9e6c388a 17-Dec-2021 Lukasz Kazmierczak <lukasz.kazmierczak@intel.com>

Add PATCH for MetricReportDefinition

Support for PATCH method is added to Metric Report Definition,
now selected read/write Report properties can be modified by PATCH method

Tested:
- Added Report

Add PATCH for MetricReportDefinition

Support for PATCH method is added to Metric Report Definition,
now selected read/write Report properties can be modified by PATCH method

Tested:
- Added Report via POST, overwrite editable properties via PATCH and
fetched Report via GET checking if received data is properly modified

Signed-off-by: Lukasz Kazmierczak <lukasz.kazmierczak@intel.com>
Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com>
Change-Id: If75110a92c55c9e4f2415f0ed4471baa802643ff

show more ...


# 62598e31 17-Jul-2023 Ed Tanous <ed@tanous.net>

Replace logging with std::format

std::format is a much more modern logging solution, and gives us a lot
more flexibility, and better compile times when doing logging.

Unfortunately, given its level

Replace logging with std::format

std::format is a much more modern logging solution, and gives us a lot
more flexibility, and better compile times when doing logging.

Unfortunately, given its level of compile time checks, it needs to be a
method, instead of the stream style logging we had before. This
requires a pretty substantial change. Fortunately, this change can be
largely automated, via the script included in this commit under
scripts/replace_logs.py. This is to aid people in moving their
patchsets over to the new form in the short period where old patches
will be based on the old logging. The intention is that this script
eventually goes away.

The old style logging (stream based) looked like.

BMCWEB_LOG_DEBUG << "Foo " << foo;

The new equivalent of the above would be:
BMCWEB_LOG_DEBUG("Foo {}", foo);

In the course of doing this, this also cleans up several ignored linter
errors, including macro usage, and array to pointer deconstruction.

Note, This patchset does remove the timestamp from the log message. In
practice, this was duplicated between journald and bmcweb, and there's
no need for both to exist.

One design decision of note is the addition of logPtr. Because the
compiler can't disambiguate between const char* and const MyThing*, it's
necessary to add an explicit cast to void*. This is identical to how
fmt handled it.

Tested: compiled with logging meson_option enabled, and launched bmcweb

Saw the usual logging, similar to what was present before:
```
[Error include/webassets.hpp:60] Unable to find or open /usr/share/www/ static file hosting disabled
[Debug include/persistent_data.hpp:133] Restored Session Timeout: 1800
[Debug redfish-core/include/event_service_manager.hpp:671] Old eventService config not exist
[Info src/webserver_main.cpp:59] Starting webserver on port 18080
[Error redfish-core/include/event_service_manager.hpp:1301] inotify_add_watch failed for redfish log file.
[Info src/webserver_main.cpp:137] Start Hostname Monitor Service...
```
Signed-off-by: Ed Tanous <ed@tanous.net>

Change-Id: I86a46aa2454be7fe80df608cb7e5573ca4029ec8

show more ...


# 14fbced6 27-Jun-2022 Ed Tanous <edtanous@google.com>

Make propertyValueIncorrect typesafe

Similar to the previous patches, make propertyValueIncorrect accept a
nlohmann::json object as input. This removes the need for the dump()
call, which oddly eno

Make propertyValueIncorrect typesafe

Similar to the previous patches, make propertyValueIncorrect accept a
nlohmann::json object as input. This removes the need for the dump()
call, which oddly enough, in our one usage, was actually incorrect, and
could cause bmcweb to throw an exception in parsing in theory.

Tested: Only used in one error condition. Code compiles.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ie35d61101c2db88b16d42d71e66bceef540e8429

show more ...


# 4220be3b 23-May-2023 Ed Tanous <edtanous@google.com>

Implement HEAD for metrics

These got missed in the initial patchset. Add them

Tested: At the end of the series.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I120986fb0afc34d5e0572d2c

Implement HEAD for metrics

These got missed in the initial patchset. Add them

Tested: At the end of the series.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I120986fb0afc34d5e0572d2cc2e1d8ff6994ee3c

show more ...


# fc0edbe3 25-May-2023 Ed Tanous <edtanous@google.com>

Break out metric report definition get

In the same way we're doing other places.

Tested: THe last commit of the series will be tested.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I17

Break out metric report definition get

In the same way we're doing other places.

Tested: THe last commit of the series will be tested.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I177e61dd3741f3885516a2f645a7039d274786cb

show more ...


# 86a5ac98 23-May-2023 Ed Tanous <edtanous@google.com>

Break out methods

"Like we do other places.. blah"

Tested: Top commit was tested.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I8a254067f97569a4d07817796b89a95cd768ff18


# dd1c4a9c 04-Mar-2022 Szymon Dompke <szymon.dompke@intel.com>

Add support for POST on TriggersCollection

Added POST method on /redfish/v1/TelemetryService/Triggers uri, which
creates new trigger in telemetry service, by using dbus call AddTrigger.

By DMTF, mo

Add support for POST on TriggersCollection

Added POST method on /redfish/v1/TelemetryService/Triggers uri, which
creates new trigger in telemetry service, by using dbus call AddTrigger.

By DMTF, most of the properties are not required, and as such are
treated as optional. Some values can be deduced from others (like
'MetricType', depending on 'DiscreteTriggers' or 'NumericThresholds').
All properties provided in POST body by user will be verified against
each other, and errors will be raised. Few examples of such situations:
- 'MetricType' is set to 'Discrete' but 'NumericThresholds' was passed.
- 'MetricType' is set to 'Numeric' but "DiscreteTriggers' or
'DiscreteTriggerCondition' were passed
- 'DiscreteTriggerCondition' is set to 'Specified' but
'DiscreteTriggers' is an empty array or was not passed.
- 'DiscreteTriggerCondition' is set to 'Changed' but 'DiscreteTriggers'
is passed and is not an empty array.

Example 1 – Trigger with discrete values:
```
{
"Id": "TestTrigger",
"MetricType": "Discrete",
"TriggerActions": [
"RedfishEvent"
],
"DiscreteTriggerCondition": "Specified",
"DiscreteTriggers": [
{
"Value": "55.88",
"DwellTime": "PT0.001S",
"Severity": "Warning"
},
{
"Name": "My discrete trigger",
"Value": "55.88",
"DwellTime": "PT0.001S",
"Severity": "OK"
},
{
"Value": "55.88",
"DwellTime": "PT0.001S",
"Severity": "Critical"
}
],
"MetricProperties": [
"/redfish/v1/Chassis/AC_Baseboard/Thermal#/Fans/0/Reading"
],
"Links": {
"MetricReportDefinitions": []
}
}

Example 2 – trigger with numeric threshold:
{
"Id": "TestTrigger2",
"Name": "My Numeric Trigger",
"MetricType": "Numeric",
"TriggerActions": [
"RedfishEvent",
"RedfishMetricReport"
],
"NumericThresholds": {
"UpperCritical": {
"Reading": 50,
"Activation": "Increasing",
"DwellTime": "PT0.001S"
},
"UpperWarning": {
"Reading": 48.1,
"Activation": "Increasing",
"DwellTime": "PT0.004S"
}
},
"MetricProperties": [
"/redfish/v1/Chassis/AC_Baseboard/Thermal#/Fans/0/Reading",
"/redfish/v1/Chassis/AC_Baseboard/Thermal#/Fans/17/Reading"
],
"Links": {
"MetricReportDefinitions": [
"/redfish/v1/TelemetryService/MetricReportDefinitions/PowerMetrics",
"/redfish/v1/TelemetryService/MetricReportDefinitions/PowerMetricStats",
"/redfish/v1/TelemetryService/MetricReportDefinitions/PlatformPowerUsage"
]
}
}
```

Tested:
- Triggers were successfully created with above example message bodies.
This can be checked by calling:
'busctl tree xyz.openbmc_project.Telemetry'.
- Expected errors were returned for messages with incorrect or mutually
exclusive properties and incorrect values.
- Redfish service validator is passing.

Signed-off-by: Szymon Dompke <szymon.dompke@intel.com>
Change-Id: Ief8c76de8aa660ae0d2dbe4610c26a28186a290a

show more ...


# f19ab44a 07-Mar-2022 Szymon Dompke <szymon.dompke@intel.com>

Add Links/Triggers to MetricReportDefinition

This change is adding Triggers property to Links when GET is called on
MetricReportDefinition. It contains array of @odata.id pointing to
Trigger resourc

Add Links/Triggers to MetricReportDefinition

This change is adding Triggers property to Links when GET is called on
MetricReportDefinition. It contains array of @odata.id pointing to
Trigger resource if it is also linking to given MRD.

Testing done:
- Links/Trigger property is returned by GET request on
/redfish/v1/TelemetryService/MetricReportDefinitions/<str>/

Signed-off-by: Szymon Dompke <szymon.dompke@intel.com>
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I5accf4b50324437b0b185003200078ad2c7020b0

show more ...


# 479e899d 17-Jun-2021 Krzysztof Grobelny <krzysztof.grobelny@intel.com>

Switched bmcweb to use new telemetry service API

Added support for multiple MetricProperties. Added support for new
parameters: CollectionTimeScope, CollectionDuration. ReadingParameters
was not yet

Switched bmcweb to use new telemetry service API

Added support for multiple MetricProperties. Added support for new
parameters: CollectionTimeScope, CollectionDuration. ReadingParameters
was not yet changed in telemetry backend, instead temporary property
ReadingParametersFutureVersion was introduced. Once bmcweb is adapted to
use ReadingParametersFutureVersion this property will be renamed in
backend to ReadingParameters. Then bmcweb will change to use
ReadingParameters. Then ReadingParametersFutureVersion will be removed
from backend and everything will be exactly like described in
phosphor-dbus-interfaces without introducing breaking changes.

Related change in phosphor-dbus-interfaces [1], [2]. This change needs
to be bumped together with [3].

Tested:
- It is possible to create MetricReportDefinitions with multiple
MetricProperties.
- Stub values for new parameters are correctly passed to telemetry
service.
- All existing telemetry service functionalities remain unchanged.

[1]: https://github.com/openbmc/phosphor-dbus-interfaces/commit/4f9c09144b60edc015291d2c120fc5b33aa0bec2
[2]: https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/60750
[3]: https://gerrit.openbmc.org/c/openbmc/telemetry/+/58229

Change-Id: I2cd17069e3ea015c8f5571c29278f1d50536272a
Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com>
Signed-off-by: Lukasz Kazmierczak <lukasz.kazmierczak@intel.com>

show more ...


123