diff --git a/src/discrete_threshold.cpp b/src/discrete_threshold.cpp
index efec549..89a1b7c 100644
--- a/src/discrete_threshold.cpp
+++ b/src/discrete_threshold.cpp
@@ -94,8 +94,3 @@
         action->commit(sensorName, timestamp, value);
     }
 }
-
-const char* DiscreteThreshold::getName() const
-{
-    return name.c_str();
-}
diff --git a/src/discrete_threshold.hpp b/src/discrete_threshold.hpp
index 70b2a6a..8dc2eeb 100644
--- a/src/discrete_threshold.hpp
+++ b/src/discrete_threshold.hpp
@@ -32,7 +32,6 @@
     void initialize() override;
     void sensorUpdated(interfaces::Sensor&, uint64_t) override;
     void sensorUpdated(interfaces::Sensor&, uint64_t, double) override;
-    const char* getName() const;
 
   private:
     boost::asio::io_context& ioc;
diff --git a/src/interfaces/report.hpp b/src/interfaces/report.hpp
index a299dac..4b3bd9e 100644
--- a/src/interfaces/report.hpp
+++ b/src/interfaces/report.hpp
@@ -10,7 +10,7 @@
   public:
     virtual ~Report() = default;
 
-    virtual std::string getName() const = 0;
+    virtual std::string getId() const = 0;
     virtual std::string getPath() const = 0;
     virtual void updateReadings() = 0;
 };
diff --git a/src/interfaces/report_factory.hpp b/src/interfaces/report_factory.hpp
index 613c1d5..6a255a4 100644
--- a/src/interfaces/report_factory.hpp
+++ b/src/interfaces/report_factory.hpp
@@ -27,7 +27,8 @@
                             const ReadingParameters& metricParams) const = 0;
 
     virtual std::unique_ptr<interfaces::Report>
-        make(const std::string& name, const ReportingType reportingType,
+        make(const std::string& id, const std::string& name,
+             const ReportingType reportingType,
              const std::vector<ReportAction>& reportActions,
              Milliseconds period, uint64_t appendLimit,
              const ReportUpdates reportUpdates, ReportManager& reportManager,
diff --git a/src/interfaces/report_manager.hpp b/src/interfaces/report_manager.hpp
index 910e439..901c446 100644
--- a/src/interfaces/report_manager.hpp
+++ b/src/interfaces/report_manager.hpp
@@ -11,7 +11,7 @@
     virtual ~ReportManager() = default;
 
     virtual void removeReport(const interfaces::Report* report) = 0;
-    virtual void updateReport(const std::string& name) = 0;
+    virtual void updateReport(const std::string& id) = 0;
 };
 
 } // namespace interfaces
diff --git a/src/interfaces/sensor.hpp b/src/interfaces/sensor.hpp
index 65d3c21..6a6bcf7 100644
--- a/src/interfaces/sensor.hpp
+++ b/src/interfaces/sensor.hpp
@@ -43,6 +43,7 @@
     virtual ~Sensor() = default;
 
     virtual Id id() const = 0;
+    virtual std::string metadata() const = 0;
     virtual void registerForUpdates(const std::weak_ptr<SensorListener>&) = 0;
     virtual void
         unregisterFromUpdates(const std::weak_ptr<SensorListener>&) = 0;
diff --git a/src/interfaces/trigger_factory.hpp b/src/interfaces/trigger_factory.hpp
index f39d555..ee85063 100644
--- a/src/interfaces/trigger_factory.hpp
+++ b/src/interfaces/trigger_factory.hpp
@@ -22,7 +22,7 @@
     virtual std::unique_ptr<interfaces::Trigger> make(
         const std::string& id, const std::string& name,
         const std::vector<std::string>& triggerActions,
-        const std::vector<std::string>& reportNames,
+        const std::vector<std::string>& reportIds,
         interfaces::TriggerManager& triggerManager,
         interfaces::JsonStorage& triggerStorage,
         const LabeledTriggerThresholdParams& labeledThresholdParams,
diff --git a/src/metric.cpp b/src/metric.cpp
index d76f220..ee12c74 100644
--- a/src/metric.cpp
+++ b/src/metric.cpp
@@ -5,6 +5,8 @@
 #include "utils/labeled_tuple.hpp"
 #include "utils/transform.hpp"
 
+#include <sdbusplus/exception.hpp>
+
 #include <algorithm>
 
 class Metric::CollectionData
@@ -45,7 +47,14 @@
                  CollectionDuration duration) :
         function(std::move(function)),
         duration(duration)
-    {}
+    {
+        if (duration.t.count() == 0)
+        {
+            throw sdbusplus::exception::SdBusError(
+                static_cast<int>(std::errc::invalid_argument),
+                "Invalid CollectionDuration");
+        }
+    }
 
     ReadingItem update(uint64_t timestamp) override
     {
@@ -113,14 +122,10 @@
 };
 
 Metric::Metric(Sensors sensorsIn, OperationType operationTypeIn,
-               std::string idIn, std::string metadataIn,
-               CollectionTimeScope timeScopeIn,
+               std::string idIn, CollectionTimeScope timeScopeIn,
                CollectionDuration collectionDurationIn,
                std::unique_ptr<interfaces::Clock> clockIn) :
-    id(idIn),
-    metadata(metadataIn),
-    readings(sensorsIn.size(),
-             MetricValue{std::move(idIn), std::move(metadataIn), 0.0, 0u}),
+    id(std::move(idIn)),
     sensors(std::move(sensorsIn)), operationType(operationTypeIn),
     collectionTimeScope(timeScopeIn), collectionDuration(collectionDurationIn),
     collectionAlgorithms(makeCollectionData(sensors.size(), operationType,
@@ -128,7 +133,9 @@
                                             collectionDuration)),
     clock(std::move(clockIn))
 {
-    attemptUnpackJsonMetadata();
+    readings = utils::transform(sensors, [this](const auto& sensor) {
+        return MetricValue{id, sensor->metadata(), 0.0, 0u};
+    });
 }
 
 Metric::~Metric() = default;
@@ -187,12 +194,12 @@
 LabeledMetricParameters Metric::dumpConfiguration() const
 {
     auto sensorPath = utils::transform(sensors, [this](const auto& sensor) {
-        return LabeledSensorParameters(sensor->id().service, sensor->id().path);
+        return LabeledSensorParameters(sensor->id().service, sensor->id().path,
+                                       sensor->metadata());
     });
 
     return LabeledMetricParameters(std::move(sensorPath), operationType, id,
-                                   metadata, collectionTimeScope,
-                                   collectionDuration);
+                                   collectionTimeScope, collectionDuration);
 }
 
 std::vector<std::unique_ptr<Metric::CollectionData>>
@@ -238,32 +245,3 @@
 {
     return sensors.size();
 }
-
-void Metric::attemptUnpackJsonMetadata()
-{
-    using MetricMetadata =
-        utils::LabeledTuple<std::tuple<std::vector<std::string>>,
-                            utils::tstring::MetricProperties>;
-
-    using ReadingMetadata =
-        utils::LabeledTuple<std::tuple<std::string, std::string>,
-                            utils::tstring::SensorDbusPath,
-                            utils::tstring::SensorRedfishUri>;
-    try
-    {
-        const MetricMetadata parsedMetadata =
-            nlohmann::json::parse(metadata).get<MetricMetadata>();
-
-        if (readings.size() == parsedMetadata.at_index<0>().size())
-        {
-            for (size_t i = 0; i < readings.size(); ++i)
-            {
-                ReadingMetadata readingMetadata{
-                    sensors[i]->id().path, parsedMetadata.at_index<0>()[i]};
-                readings[i].metadata = readingMetadata.dump();
-            }
-        }
-    }
-    catch (const nlohmann::json::exception&)
-    {}
-}
diff --git a/src/metric.hpp b/src/metric.hpp
index 7929aac..1ff5bc2 100644
--- a/src/metric.hpp
+++ b/src/metric.hpp
@@ -12,7 +12,7 @@
 {
   public:
     Metric(Sensors sensors, OperationType operationType, std::string id,
-           std::string metadata, CollectionTimeScope, CollectionDuration,
+           CollectionTimeScope, CollectionDuration,
            std::unique_ptr<interfaces::Clock>);
     ~Metric();
 
@@ -34,11 +34,9 @@
         makeCollectionData(size_t size, OperationType, CollectionTimeScope,
                            CollectionDuration);
 
-    void attemptUnpackJsonMetadata();
     CollectionData& findAssociatedData(const interfaces::Sensor& notifier);
 
     std::string id;
-    std::string metadata;
     std::vector<MetricValue> readings;
     Sensors sensors;
     OperationType operationType;
diff --git a/src/report.cpp b/src/report.cpp
index cc981f1..c2813c0 100644
--- a/src/report.cpp
+++ b/src/report.cpp
@@ -1,6 +1,7 @@
 #include "report.hpp"
 
 #include "report_manager.hpp"
+#include "utils/clock.hpp"
 #include "utils/contains.hpp"
 #include "utils/transform.hpp"
 
@@ -12,7 +13,7 @@
 
 Report::Report(boost::asio::io_context& ioc,
                const std::shared_ptr<sdbusplus::asio::object_server>& objServer,
-               const std::string& reportName,
+               const std::string& reportId, const std::string& reportName,
                const ReportingType reportingTypeIn,
                std::vector<ReportAction> reportActionsIn,
                const Milliseconds intervalIn, const uint64_t appendLimitIn,
@@ -21,15 +22,14 @@
                interfaces::JsonStorage& reportStorageIn,
                std::vector<std::shared_ptr<interfaces::Metric>> metricsIn,
                const bool enabledIn) :
-    name(reportName),
-    path(reportDir + name), reportingType(reportingTypeIn),
-    interval(intervalIn), reportActions(std::move(reportActionsIn)),
+    id(reportId),
+    name(reportName), reportingType(reportingTypeIn), interval(intervalIn),
+    reportActions(std::move(reportActionsIn)),
     sensorCount(getSensorCount(metricsIn)),
     appendLimit(deduceAppendLimit(appendLimitIn)),
     reportUpdates(reportUpdatesIn),
     readingsBuffer(deduceBufferSize(reportUpdates, reportingType)),
     objServer(objServer), metrics(std::move(metricsIn)), timer(ioc),
-    fileName(std::to_string(std::hash<std::string>{}(name))),
     reportStorage(reportStorageIn), enabled(enabledIn)
 {
     readingParameters =
@@ -39,17 +39,21 @@
 
     readingParametersPastVersion =
         utils::transform(readingParameters, [](const auto& item) {
+            const auto& [sensorData, operationType, id, collectionTimeScope,
+                         collectionDuration] = item;
+
             return ReadingParametersPastVersion::value_type(
-                std::get<0>(item).front(), std::get<1>(item), std::get<2>(item),
-                std::get<3>(item));
+                std::get<0>(sensorData.front()), operationType, id,
+                std::get<1>(sensorData.front()));
         });
 
     deleteIface = objServer->add_unique_interface(
-        path, deleteIfaceName, [this, &ioc, &reportManager](auto& dbusIface) {
+        getPath(), deleteIfaceName,
+        [this, &ioc, &reportManager](auto& dbusIface) {
             dbusIface.register_method("Delete", [this, &ioc, &reportManager] {
                 if (persistency)
                 {
-                    reportStorage.remove(fileName);
+                    reportStorage.remove(fileName());
                 }
                 boost::asio::post(ioc, [this, &reportManager] {
                     reportManager.removeReport(this);
@@ -128,7 +132,8 @@
 
 std::unique_ptr<sdbusplus::asio::dbus_interface> Report::makeReportInterface()
 {
-    auto dbusIface = objServer->add_unique_interface(path, reportIfaceName);
+    auto dbusIface =
+        objServer->add_unique_interface(getPath(), reportIfaceName);
     dbusIface->register_property_rw(
         "Enabled", enabled, sdbusplus::vtable::property_::emits_change,
         [this](bool newVal, const auto&) {
@@ -189,7 +194,7 @@
             }
             else
             {
-                reportStorage.remove(fileName);
+                reportStorage.remove(fileName());
                 persistency = false;
             }
             return true;
@@ -220,6 +225,9 @@
             return utils::contains(reportActions,
                                    ReportAction::emitsReadingsUpdate);
         });
+    dbusIface->register_property_r("Name", std::string{},
+                                   sdbusplus::vtable::property_::const_,
+                                   [this](const auto&) { return name; });
     dbusIface->register_property_r(
         "LogToMetricReportsCollection", bool{},
         sdbusplus::vtable::property_::const_, [this](const auto&) {
@@ -307,8 +315,9 @@
         }
     }
 
-    readings = {std::time(0), std::vector<ReadingData>(readingsBuffer.begin(),
-                                                       readingsBuffer.end())};
+    readings = {
+        Clock().timestamp(),
+        std::vector<ReadingData>(readingsBuffer.begin(), readingsBuffer.end())};
 
     reportIface->signal_property("Readings");
 }
@@ -321,6 +330,7 @@
 
         data["Enabled"] = enabled;
         data["Version"] = reportVersion;
+        data["Id"] = id;
         data["Name"] = name;
         data["ReportingType"] = utils::toUnderlying(reportingType);
         data["ReportActions"] =
@@ -335,7 +345,7 @@
                 return metric->dumpConfiguration();
             });
 
-        reportStorage.store(fileName, data);
+        reportStorage.store(fileName(), data);
     }
     catch (const std::exception& e)
     {
@@ -347,3 +357,8 @@
 
     return true;
 }
+interfaces::JsonStorage::FilePath Report::fileName() const
+{
+    return interfaces::JsonStorage::FilePath{
+        std::to_string(std::hash<std::string>{}(id))};
+}
diff --git a/src/report.hpp b/src/report.hpp
index 5d675bf..72563f5 100644
--- a/src/report.hpp
+++ b/src/report.hpp
@@ -22,7 +22,8 @@
   public:
     Report(boost::asio::io_context& ioc,
            const std::shared_ptr<sdbusplus::asio::object_server>& objServer,
-           const std::string& reportName, const ReportingType reportingType,
+           const std::string& reportId, const std::string& reportName,
+           const ReportingType reportingType,
            std::vector<ReportAction> reportActions, const Milliseconds period,
            const uint64_t appendLimitIn, const ReportUpdates reportUpdatesIn,
            interfaces::ReportManager& reportManager,
@@ -36,14 +37,14 @@
     Report& operator=(const Report&) = delete;
     Report& operator=(Report&&) = delete;
 
-    std::string getName() const override
+    std::string getId() const override
     {
-        return name;
+        return id;
     }
 
     std::string getPath() const override
     {
-        return path;
+        return reportDir + id;
     }
 
     void updateReadings() override;
@@ -59,9 +60,10 @@
     void setReportUpdates(const ReportUpdates newReportUpdates);
     static uint64_t getSensorCount(
         std::vector<std::shared_ptr<interfaces::Metric>>& metrics);
+    interfaces::JsonStorage::FilePath fileName() const;
 
+    std::string id;
     std::string name;
-    std::string path;
     ReportingType reportingType;
     Milliseconds interval;
     std::vector<ReportAction> reportActions;
@@ -79,7 +81,6 @@
     std::vector<std::shared_ptr<interfaces::Metric>> metrics;
     boost::asio::steady_timer timer;
 
-    interfaces::JsonStorage::FilePath fileName;
     interfaces::JsonStorage& reportStorage;
     bool enabled;
 
diff --git a/src/report_factory.cpp b/src/report_factory.cpp
index 57126b7..f72a3f7 100644
--- a/src/report_factory.cpp
+++ b/src/report_factory.cpp
@@ -17,7 +17,8 @@
 {}
 
 std::unique_ptr<interfaces::Report> ReportFactory::make(
-    const std::string& name, const ReportingType reportingType,
+    const std::string& id, const std::string& name,
+    const ReportingType reportingType,
     const std::vector<ReportAction>& reportActions, Milliseconds period,
     uint64_t appendLimit, const ReportUpdates reportUpdates,
     interfaces::ReportManager& reportManager,
@@ -34,13 +35,12 @@
             return std::make_shared<Metric>(
                 getSensors(param.at_label<ts::SensorPath>()),
                 param.at_label<ts::OperationType>(), param.at_label<ts::Id>(),
-                param.at_label<ts::MetricMetadata>(),
                 param.at_label<ts::CollectionTimeScope>(),
                 param.at_label<ts::CollectionDuration>(),
                 std::make_unique<Clock>());
         });
 
-    return std::make_unique<Report>(bus->get_io_context(), objServer, name,
+    return std::make_unique<Report>(bus->get_io_context(), objServer, id, name,
                                     reportingType, reportActions, period,
                                     appendLimit, reportUpdates, reportManager,
                                     reportStorage, std::move(metrics), enabled);
@@ -51,14 +51,14 @@
 {
     using namespace utils::tstring;
 
-    return utils::transform(sensorPaths,
-                            [this](const LabeledSensorParameters& sensorPath)
-                                -> std::shared_ptr<interfaces::Sensor> {
-                                return sensorCache.makeSensor<Sensor>(
-                                    sensorPath.at_label<Service>(),
-                                    sensorPath.at_label<Path>(),
-                                    bus->get_io_context(), bus);
-                            });
+    return utils::transform(
+        sensorPaths,
+        [this](const LabeledSensorParameters& sensorPath)
+            -> std::shared_ptr<interfaces::Sensor> {
+            return sensorCache.makeSensor<Sensor>(
+                sensorPath.at_label<Service>(), sensorPath.at_label<Path>(),
+                sensorPath.at_label<Metadata>(), bus->get_io_context(), bus);
+        });
 }
 
 std::vector<LabeledMetricParameters> ReportFactory::convertMetricParams(
@@ -68,12 +68,12 @@
     auto tree = utils::getSubTreeSensors(yield, bus);
 
     return utils::transform(metricParams, [&tree](const auto& item) {
-        const auto& [sensorPaths, operationType, id, metadata,
-                     collectionTimeScope, collectionDuration] = item;
+        auto [sensorPaths, operationType, id, collectionTimeScope,
+              collectionDuration] = item;
 
         std::vector<LabeledSensorParameters> sensorParameters;
 
-        for (const auto& sensorPath : sensorPaths)
+        for (const auto& [sensorPath, metadata] : sensorPaths)
         {
             auto it = std::find_if(
                 tree.begin(), tree.end(),
@@ -82,7 +82,7 @@
             if (it != tree.end() && it->second.size() == 1)
             {
                 const auto& [service, ifaces] = it->second.front();
-                sensorParameters.emplace_back(service, sensorPath);
+                sensorParameters.emplace_back(service, sensorPath, metadata);
             }
         }
 
@@ -93,9 +93,20 @@
                 "Could not find service for provided sensors");
         }
 
+        if (operationType.empty())
+        {
+            operationType = utils::enumToString(OperationType::avg);
+        }
+
+        if (collectionTimeScope.empty())
+        {
+            collectionTimeScope =
+                utils::enumToString(CollectionTimeScope::point);
+        }
+
         return LabeledMetricParameters(
             std::move(sensorParameters), utils::toOperationType(operationType),
-            id, metadata, utils::toCollectionTimeScope(collectionTimeScope),
+            id, utils::toCollectionTimeScope(collectionTimeScope),
             CollectionDuration(Milliseconds(collectionDuration)));
     });
 }
diff --git a/src/report_factory.hpp b/src/report_factory.hpp
index 15f5898..c9209ef 100644
--- a/src/report_factory.hpp
+++ b/src/report_factory.hpp
@@ -20,7 +20,8 @@
         const ReadingParameters& metricParams) const override;
 
     std::unique_ptr<interfaces::Report>
-        make(const std::string& name, const ReportingType reportingType,
+        make(const std::string& reportId, const std::string& name,
+             const ReportingType reportingType,
              const std::vector<ReportAction>& reportActions,
              Milliseconds period, uint64_t appendLimitIn,
              const ReportUpdates reportUpdatesIn,
diff --git a/src/report_manager.cpp b/src/report_manager.cpp
index ab76a31..18636f8 100644
--- a/src/report_manager.cpp
+++ b/src/report_manager.cpp
@@ -3,6 +3,7 @@
 #include "report.hpp"
 #include "types/report_types.hpp"
 #include "utils/conversion.hpp"
+#include "utils/generate_id.hpp"
 #include "utils/transform.hpp"
 
 #include <phosphor-logging/log.hpp>
@@ -17,10 +18,14 @@
     return utils::transform(params, [](const auto& param) {
         using namespace std::chrono_literals;
 
+        const auto& [sensorPath, operationType, id, metadata] = param;
+
         return ReadingParameters::value_type(
-            std::vector{{std::get<0>(param)}}, std::get<1>(param),
-            std::get<2>(param), std::get<3>(param),
-            utils::enumToString(CollectionTimeScope::point), 0u);
+            std::vector<
+                std::tuple<sdbusplus::message::object_path, std::string>>{
+                {sensorPath, metadata}},
+            operationType, id, utils::enumToString(CollectionTimeScope::point),
+            0u);
     });
 }
 
@@ -41,16 +46,16 @@
                 "MaxReports", size_t{}, sdbusplus::vtable::property_::const_,
                 [](const auto&) { return maxReports; });
             dbusIface.register_property_r(
-                "MaxReportNameLength", size_t{},
+                "MaxReportIdLength", size_t{},
                 sdbusplus::vtable::property_::const_,
-                [](const auto&) { return maxReportNameLength; });
+                [](const auto&) { return maxReportIdLength; });
             dbusIface.register_property_r(
                 "MinInterval", uint64_t{}, sdbusplus::vtable::property_::const_,
                 [](const auto&) -> uint64_t { return minInterval.count(); });
 
             dbusIface.register_method(
                 "AddReport", [this](boost::asio::yield_context& yield,
-                                    const std::string& reportName,
+                                    const std::string& reportId,
                                     const std::string& reportingType,
                                     const bool emitsReadingsUpdate,
                                     const bool logToMetricReportsCollection,
@@ -74,7 +79,7 @@
                             ReportAction::logToMetricReportsCollection);
                     }
 
-                    return addReport(yield, reportName,
+                    return addReport(yield, reportId, reportId,
                                      utils::toReportingType(reportingType),
                                      reportActions, Milliseconds(interval),
                                      appendLimitDefault, reportUpdatesDefault,
@@ -86,16 +91,16 @@
 
             dbusIface.register_method(
                 "AddReportFutureVersion",
-                [this](boost::asio::yield_context& yield,
-                       const std::string& reportName,
-                       const std::string& reportingType,
-                       const std::string& reportUpdates,
-                       const uint64_t appendLimit,
-                       const std::vector<std::string>& reportActions,
-                       const uint64_t interval,
-                       ReadingParameters metricParams) {
+                [this](
+                    boost::asio::yield_context& yield,
+                    const std::string& reportId, const std::string& reportName,
+                    const std::string& reportingType,
+                    const std::string& reportUpdates,
+                    const uint64_t appendLimit,
+                    const std::vector<std::string>& reportActions,
+                    const uint64_t interval, ReadingParameters metricParams) {
                     constexpr auto enabledDefault = true;
-                    return addReport(yield, reportName,
+                    return addReport(yield, reportId, reportName,
                                      utils::toReportingType(reportingType),
                                      utils::transform(
                                          reportActions,
@@ -119,19 +124,20 @@
         reports.end());
 }
 
-void ReportManager::verifyReportNameLength(const std::string& reportName)
+void ReportManager::verifyReportIdLength(const std::string& reportId)
 {
-    if (reportName.length() > maxReportNameLength)
+    if (reportId.length() > maxReportIdLength)
     {
         throw sdbusplus::exception::SdBusError(
             static_cast<int>(std::errc::invalid_argument),
-            "Report name exceeds maximum length");
+            "Report id exceeds maximum length");
     }
 }
 
 void ReportManager::verifyAddReport(
-    const std::string& reportName, const ReportingType reportingType,
-    Milliseconds interval, const ReportUpdates reportUpdates,
+    const std::string& reportId, const std::string& reportName,
+    const ReportingType reportingType, Milliseconds interval,
+    const ReportUpdates reportUpdates,
     const std::vector<LabeledMetricParameters>& readingParams)
 {
     if (reportingType == ReportingType::onChange)
@@ -148,11 +154,12 @@
             "Reached maximal report count");
     }
 
-    verifyReportNameLength(reportName);
+    verifyReportIdLength(reportId);
+    utils::verifyIdCharacters(reportId);
 
     for (const auto& report : reports)
     {
-        if (report->getName() == reportName)
+        if (report->getId() == reportId)
         {
             throw sdbusplus::exception::SdBusError(
                 static_cast<int>(std::errc::file_exists), "Duplicate report");
@@ -193,8 +200,8 @@
 }
 
 interfaces::Report& ReportManager::addReport(
-    boost::asio::yield_context& yield, const std::string& reportName,
-    const ReportingType reportingType,
+    boost::asio::yield_context& yield, const std::string& reportId,
+    const std::string& reportName, const ReportingType reportingType,
     const std::vector<ReportAction>& reportActions, Milliseconds interval,
     const uint64_t appendLimit, const ReportUpdates reportUpdates,
     ReadingParameters metricParams, const bool enabled)
@@ -202,23 +209,36 @@
     auto labeledMetricParams =
         reportFactory->convertMetricParams(yield, metricParams);
 
-    return addReport(reportName, reportingType, reportActions, interval,
-                     appendLimit, reportUpdates, std::move(labeledMetricParams),
-                     enabled);
+    return addReport(reportId, reportName, reportingType, reportActions,
+                     interval, appendLimit, reportUpdates,
+                     std::move(labeledMetricParams), enabled);
 }
 
 interfaces::Report& ReportManager::addReport(
-    const std::string& reportName, const ReportingType reportingType,
+    const std::string& reportId, const std::string& reportName,
+    const ReportingType reportingType,
     const std::vector<ReportAction>& reportActions, Milliseconds interval,
     const uint64_t appendLimit, const ReportUpdates reportUpdates,
     std::vector<LabeledMetricParameters> labeledMetricParams,
     const bool enabled)
 {
-    verifyAddReport(reportName, reportingType, interval, reportUpdates,
+    std::string name = reportName;
+    if (name.empty())
+    {
+        name = "Report";
+    }
+
+    const auto existingReportIds = utils::transform(
+        reports, [](const auto& report) { return report->getId(); });
+
+    std::string id =
+        utils::generateId(reportId, name, existingReportIds, maxReportIdLength);
+
+    verifyAddReport(id, name, reportingType, interval, reportUpdates,
                     labeledMetricParams);
 
     reports.emplace_back(reportFactory->make(
-        reportName, reportingType, reportActions, interval, appendLimit,
+        id, name, reportingType, reportActions, interval, appendLimit,
         reportUpdates, *this, *reportStorage, labeledMetricParams, enabled));
     return *reports.back();
 }
@@ -233,12 +253,13 @@
         std::optional<nlohmann::json> data = reportStorage->load(path);
         try
         {
-            bool enabled = data->at("Enabled").get<bool>();
             size_t version = data->at("Version").get<size_t>();
             if (version != Report::reportVersion)
             {
                 throw std::logic_error("Invalid version");
             }
+            bool enabled = data->at("Enabled").get<bool>();
+            std::string& id = data->at("Id").get_ref<std::string&>();
             std::string& name = data->at("Name").get_ref<std::string&>();
 
             uint32_t reportingType = data->at("ReportingType").get<uint32_t>();
@@ -254,7 +275,7 @@
                 data->at("ReadingParameters")
                     .get<std::vector<LabeledMetricParameters>>();
 
-            addReport(name, utils::toReportingType(reportingType),
+            addReport(id, name, utils::toReportingType(reportingType),
                       reportActions, Milliseconds(interval), appendLimit,
                       utils::toReportUpdates(reportUpdates),
                       std::move(readingParameters), enabled);
@@ -272,11 +293,11 @@
     }
 }
 
-void ReportManager::updateReport(const std::string& name)
+void ReportManager::updateReport(const std::string& id)
 {
     for (auto& report : reports)
     {
-        if (report->getName() == name)
+        if (report->getId() == id)
         {
             report->updateReadings();
             return;
diff --git a/src/report_manager.hpp b/src/report_manager.hpp
index cc613e8..b12d335 100644
--- a/src/report_manager.hpp
+++ b/src/report_manager.hpp
@@ -30,7 +30,7 @@
     ReportManager& operator=(ReportManager&&) = delete;
 
     void removeReport(const interfaces::Report* report) override;
-    void updateReport(const std::string& name) override;
+    void updateReport(const std::string& id) override;
 
   private:
     std::unique_ptr<interfaces::ReportFactory> reportFactory;
@@ -39,19 +39,21 @@
     std::unique_ptr<sdbusplus::asio::dbus_interface> reportManagerIface;
     std::vector<std::unique_ptr<interfaces::Report>> reports;
 
-    void verifyReportNameLength(const std::string& reportName);
+    void verifyReportIdLength(const std::string& reportName);
     void verifyAddReport(
-        const std::string& reportName, const ReportingType reportingType,
-        Milliseconds interval, const ReportUpdates reportUpdates,
+        const std::string& reportId, const std::string& reportName,
+        const ReportingType reportingType, Milliseconds interval,
+        const ReportUpdates reportUpdates,
         const std::vector<LabeledMetricParameters>& readingParams);
     interfaces::Report& addReport(
-        boost::asio::yield_context& yield, const std::string& reportName,
-        const ReportingType reportingType,
+        boost::asio::yield_context& yield, const std::string& reportId,
+        const std::string& reportName, const ReportingType reportingType,
         const std::vector<ReportAction>& reportActions, Milliseconds interval,
         const uint64_t appendLimit, const ReportUpdates reportUpdates,
         ReadingParameters metricParams, const bool enabled);
     interfaces::Report& addReport(
-        const std::string& reportName, const ReportingType reportingType,
+        const std::string& reportId, const std::string& reportName,
+        const ReportingType reportingType,
         const std::vector<ReportAction>& reportActions, Milliseconds interval,
         const uint64_t appendLimit, const ReportUpdates reportUpdates,
         std::vector<LabeledMetricParameters> metricParams, const bool enabled);
@@ -60,7 +62,7 @@
   public:
     static constexpr size_t maxReports{TELEMETRY_MAX_REPORTS};
     static constexpr size_t maxReadingParams{TELEMETRY_MAX_READING_PARAMS};
-    static constexpr size_t maxReportNameLength{
+    static constexpr size_t maxReportIdLength{
         TELEMETRY_MAX_DBUS_PATH_LENGTH -
         std::string_view(Report::reportDir).length()};
     static constexpr Milliseconds minInterval{TELEMETRY_MIN_INTERVAL};
diff --git a/src/sensor.cpp b/src/sensor.cpp
index 644de2f..5c71910 100644
--- a/src/sensor.cpp
+++ b/src/sensor.cpp
@@ -1,15 +1,18 @@
 #include "sensor.hpp"
 
+#include "utils/clock.hpp"
+
 #include <boost/container/flat_map.hpp>
 #include <phosphor-logging/log.hpp>
 #include <sdbusplus/asio/property.hpp>
 
 #include <functional>
 
-Sensor::Sensor(interfaces::Sensor::Id sensorId, boost::asio::io_context& ioc,
+Sensor::Sensor(interfaces::Sensor::Id sensorId,
+               const std::string& sensorMetadata, boost::asio::io_context& ioc,
                const std::shared_ptr<sdbusplus::asio::connection>& bus) :
     sensorId(std::move(sensorId)),
-    ioc(ioc), bus(bus)
+    sensorMetadata(sensorMetadata), ioc(ioc), bus(bus)
 {}
 
 Sensor::Id Sensor::makeId(std::string_view service, std::string_view path)
@@ -22,6 +25,11 @@
     return sensorId;
 }
 
+std::string Sensor::metadata() const
+{
+    return sensorMetadata;
+}
+
 void Sensor::async_read()
 {
     uniqueCall([this](auto lock) { async_read(std::move(lock)); });
@@ -92,7 +100,7 @@
 
 void Sensor::updateValue(double newValue)
 {
-    timestamp = std::time(0);
+    timestamp = Clock().timestamp();
 
     if (value == newValue)
     {
diff --git a/src/sensor.hpp b/src/sensor.hpp
index 3393b06..3c9c746 100644
--- a/src/sensor.hpp
+++ b/src/sensor.hpp
@@ -18,7 +18,8 @@
     using ValueVariant = std::variant<std::monostate, double>;
 
   public:
-    Sensor(interfaces::Sensor::Id sensorId, boost::asio::io_context& ioc,
+    Sensor(interfaces::Sensor::Id sensorId, const std::string& sensorMetadata,
+           boost::asio::io_context& ioc,
            const std::shared_ptr<sdbusplus::asio::connection>& bus);
 
     Sensor(const Sensor&) = delete;
@@ -27,6 +28,7 @@
     static Id makeId(std::string_view service, std::string_view path);
 
     Id id() const override;
+    std::string metadata() const override;
     void registerForUpdates(
         const std::weak_ptr<interfaces::SensorListener>& weakListener) override;
     void unregisterFromUpdates(
@@ -43,6 +45,7 @@
     void updateValue(double);
 
     interfaces::Sensor::Id sensorId;
+    std::string sensorMetadata;
     boost::asio::io_context& ioc;
     std::shared_ptr<sdbusplus::asio::connection> bus;
     Milliseconds timerInterval = Milliseconds(0);
diff --git a/src/trigger.cpp b/src/trigger.cpp
index ff229b8..0b210ae 100644
--- a/src/trigger.cpp
+++ b/src/trigger.cpp
@@ -13,7 +13,7 @@
     const std::shared_ptr<sdbusplus::asio::object_server>& objServer,
     const std::string& idIn, const std::string& nameIn,
     const std::vector<std::string>& triggerActionsIn,
-    const std::vector<std::string>& reportNamesIn,
+    const std::vector<std::string>& reportIdsIn,
     const std::vector<LabeledSensorInfo>& LabeledSensorsInfoIn,
     const LabeledTriggerThresholdParams& labeledThresholdParamsIn,
     std::vector<std::shared_ptr<interfaces::Threshold>>&& thresholdsIn,
@@ -21,7 +21,7 @@
     interfaces::JsonStorage& triggerStorageIn) :
     id(idIn),
     name(nameIn), triggerActions(std::move(triggerActionsIn)),
-    path(triggerDir + id), reportNames(reportNamesIn),
+    path(triggerDir + id), reportIds(reportIdsIn),
     labeledSensorsInfo(LabeledSensorsInfoIn),
     labeledThresholdParams(labeledThresholdParamsIn),
     thresholds(std::move(thresholdsIn)),
@@ -82,7 +82,7 @@
                 });
 
             dbusIface.register_property_r(
-                "ReportNames", reportNames,
+                "ReportNames", reportIds,
                 sdbusplus::vtable::property_::emits_change,
                 [](const auto& x) { return x; });
 
@@ -125,7 +125,7 @@
         data["TriggerActions"] = triggerActions;
         data["ThresholdParams"] =
             utils::labeledThresholdParamsToJson(labeledThresholdParams);
-        data["ReportNames"] = reportNames;
+        data["ReportIds"] = reportIds;
         data["Sensors"] = labeledSensorsInfo;
 
         triggerStorage.store(fileName, data);
diff --git a/src/trigger.hpp b/src/trigger.hpp
index e1874e7..54f67c5 100644
--- a/src/trigger.hpp
+++ b/src/trigger.hpp
@@ -18,7 +18,7 @@
             const std::shared_ptr<sdbusplus::asio::object_server>& objServer,
             const std::string& id, const std::string& name,
             const std::vector<std::string>& triggerActions,
-            const std::vector<std::string>& reportNames,
+            const std::vector<std::string>& reportIds,
             const std::vector<LabeledSensorInfo>& LabeledSensorsInfoIn,
             const LabeledTriggerThresholdParams& labeledThresholdParamsIn,
             std::vector<std::shared_ptr<interfaces::Threshold>>&& thresholds,
@@ -48,7 +48,7 @@
     std::vector<std::string> triggerActions;
     std::string path;
     bool persistent = false;
-    std::vector<std::string> reportNames;
+    std::vector<std::string> reportIds;
     std::vector<LabeledSensorInfo> labeledSensorsInfo;
     LabeledTriggerThresholdParams labeledThresholdParams;
     std::unique_ptr<sdbusplus::asio::dbus_interface> deleteIface;
diff --git a/src/trigger_actions.cpp b/src/trigger_actions.cpp
index e89bd84..e159cb1 100644
--- a/src/trigger_actions.cpp
+++ b/src/trigger_actions.cpp
@@ -99,7 +99,7 @@
     std::vector<std::unique_ptr<interfaces::TriggerAction>>& actionsIf,
     const std::vector<TriggerAction>& ActionsEnum, ::numeric::Type type,
     double thresholdValue, interfaces::ReportManager& reportManager,
-    const std::vector<std::string>& reportNames)
+    const std::vector<std::string>& reportIds)
 {
     actionsIf.reserve(ActionsEnum.size());
     for (auto actionType : ActionsEnum)
@@ -121,7 +121,7 @@
             case TriggerAction::UpdateReport:
             {
                 actionsIf.emplace_back(
-                    std::make_unique<UpdateReport>(reportManager, reportNames));
+                    std::make_unique<UpdateReport>(reportManager, reportIds));
                 break;
             }
         }
@@ -185,7 +185,7 @@
     std::vector<std::unique_ptr<interfaces::TriggerAction>>& actionsIf,
     const std::vector<TriggerAction>& ActionsEnum,
     ::discrete::Severity severity, interfaces::ReportManager& reportManager,
-    const std::vector<std::string>& reportNames)
+    const std::vector<std::string>& reportIds)
 {
     actionsIf.reserve(ActionsEnum.size());
     for (auto actionType : ActionsEnum)
@@ -207,7 +207,7 @@
             case TriggerAction::UpdateReport:
             {
                 actionsIf.emplace_back(
-                    std::make_unique<UpdateReport>(reportManager, reportNames));
+                    std::make_unique<UpdateReport>(reportManager, reportIds));
                 break;
             }
         }
@@ -241,7 +241,7 @@
     std::vector<std::unique_ptr<interfaces::TriggerAction>>& actionsIf,
     const std::vector<TriggerAction>& ActionsEnum,
     interfaces::ReportManager& reportManager,
-    const std::vector<std::string>& reportNames)
+    const std::vector<std::string>& reportIds)
 {
     actionsIf.reserve(ActionsEnum.size());
     for (auto actionType : ActionsEnum)
@@ -261,7 +261,7 @@
             case TriggerAction::UpdateReport:
             {
                 actionsIf.emplace_back(
-                    std::make_unique<UpdateReport>(reportManager, reportNames));
+                    std::make_unique<UpdateReport>(reportManager, reportIds));
                 break;
             }
         }
@@ -272,7 +272,7 @@
 
 void UpdateReport::commit(const std::string&, uint64_t, double)
 {
-    for (const auto& name : reportNames)
+    for (const auto& name : reportIds)
     {
         reportManager.updateReport(name);
     }
diff --git a/src/trigger_actions.hpp b/src/trigger_actions.hpp
index c180c3d..d86acb8 100644
--- a/src/trigger_actions.hpp
+++ b/src/trigger_actions.hpp
@@ -45,7 +45,7 @@
     std::vector<std::unique_ptr<interfaces::TriggerAction>>& actionsIf,
     const std::vector<TriggerAction>& ActionsEnum, ::numeric::Type type,
     double thresholdValue, interfaces::ReportManager& reportManager,
-    const std::vector<std::string>& reportNames);
+    const std::vector<std::string>& reportIds);
 } // namespace numeric
 
 namespace discrete
@@ -84,7 +84,7 @@
     std::vector<std::unique_ptr<interfaces::TriggerAction>>& actionsIf,
     const std::vector<TriggerAction>& ActionsEnum,
     ::discrete::Severity severity, interfaces::ReportManager& reportManager,
-    const std::vector<std::string>& reportNames);
+    const std::vector<std::string>& reportIds);
 
 namespace onChange
 {
@@ -112,7 +112,7 @@
     std::vector<std::unique_ptr<interfaces::TriggerAction>>& actionsIf,
     const std::vector<TriggerAction>& ActionsEnum,
     interfaces::ReportManager& reportManager,
-    const std::vector<std::string>& reportNames);
+    const std::vector<std::string>& reportIds);
 } // namespace onChange
 
 } // namespace discrete
@@ -121,9 +121,9 @@
 {
   public:
     UpdateReport(interfaces::ReportManager& reportManager,
-                 std::vector<std::string> names) :
+                 std::vector<std::string> ids) :
         reportManager(reportManager),
-        reportNames(std::move(names))
+        reportIds(std::move(ids))
     {}
 
     void commit(const std::string& id, uint64_t timestamp,
@@ -131,6 +131,6 @@
 
   private:
     interfaces::ReportManager& reportManager;
-    std::vector<std::string> reportNames;
+    std::vector<std::string> reportIds;
 };
 } // namespace action
diff --git a/src/trigger_factory.cpp b/src/trigger_factory.cpp
index d5294c4..0003360 100644
--- a/src/trigger_factory.cpp
+++ b/src/trigger_factory.cpp
@@ -23,7 +23,7 @@
 std::unique_ptr<interfaces::Trigger> TriggerFactory::make(
     const std::string& id, const std::string& name,
     const std::vector<std::string>& triggerActionsIn,
-    const std::vector<std::string>& reportNames,
+    const std::vector<std::string>& reportIds,
     interfaces::TriggerManager& triggerManager,
     interfaces::JsonStorage& triggerStorage,
     const LabeledTriggerThresholdParams& labeledThresholdParams,
@@ -57,7 +57,7 @@
                 labeledThresholdParam.at_label<ts::ThresholdValue>();
 
             action::discrete::fillActions(actions, triggerActions, severity,
-                                          reportManager, reportNames);
+                                          reportManager, reportIds);
 
             thresholds.emplace_back(std::make_shared<DiscreteThreshold>(
                 bus->get_io_context(), sensors, sensorNames, std::move(actions),
@@ -68,7 +68,7 @@
         {
             std::vector<std::unique_ptr<interfaces::TriggerAction>> actions;
             action::discrete::onChange::fillActions(actions, triggerActions,
-                                                    reportManager, reportNames);
+                                                    reportManager, reportIds);
 
             thresholds.emplace_back(std::make_shared<OnChangeThreshold>(
                 sensors, sensorNames, std::move(actions)));
@@ -92,7 +92,7 @@
 
             action::numeric::fillActions(actions, triggerActions, type,
                                          thresholdValue, reportManager,
-                                         reportNames);
+                                         reportIds);
 
             thresholds.emplace_back(std::make_shared<NumericThreshold>(
                 bus->get_io_context(), sensors, sensorNames, std::move(actions),
@@ -101,9 +101,9 @@
     }
 
     return std::make_unique<Trigger>(
-        bus->get_io_context(), objServer, id, name, triggerActionsIn,
-        reportNames, labeledSensorsInfo, labeledThresholdParams,
-        std::move(thresholds), triggerManager, triggerStorage);
+        bus->get_io_context(), objServer, id, name, triggerActionsIn, reportIds,
+        labeledSensorsInfo, labeledThresholdParams, std::move(thresholds),
+        triggerManager, triggerStorage);
 }
 
 std::pair<Sensors, std::vector<std::string>> TriggerFactory::getSensors(
@@ -116,10 +116,10 @@
     {
         const auto& service = labeledSensorInfo.at_label<ts::Service>();
         const auto& sensorPath = labeledSensorInfo.at_label<ts::SensorPath>();
-        const auto& metadata = labeledSensorInfo.at_label<ts::SensorMetadata>();
+        const auto& metadata = labeledSensorInfo.at_label<ts::Metadata>();
 
         sensors.emplace_back(sensorCache.makeSensor<Sensor>(
-            service, sensorPath, bus->get_io_context(), bus));
+            service, sensorPath, metadata, bus->get_io_context(), bus));
 
         if (metadata.empty())
         {
diff --git a/src/trigger_factory.hpp b/src/trigger_factory.hpp
index 757d663..9ae2197 100644
--- a/src/trigger_factory.hpp
+++ b/src/trigger_factory.hpp
@@ -18,7 +18,7 @@
     std::unique_ptr<interfaces::Trigger>
         make(const std::string& id, const std::string& name,
              const std::vector<std::string>& triggerActions,
-             const std::vector<std::string>& reportNames,
+             const std::vector<std::string>& reportIds,
              interfaces::TriggerManager& triggerManager,
              interfaces::JsonStorage& triggerStorage,
              const LabeledTriggerThresholdParams& labeledThresholdParams,
diff --git a/src/trigger_manager.cpp b/src/trigger_manager.cpp
index ac0fba5..358ee78 100644
--- a/src/trigger_manager.cpp
+++ b/src/trigger_manager.cpp
@@ -3,6 +3,7 @@
 #include "trigger.hpp"
 #include "types/trigger_types.hpp"
 #include "utils/conversion_trigger.hpp"
+#include "utils/generate_id.hpp"
 #include "utils/transform.hpp"
 
 #include <phosphor-logging/log.hpp>
@@ -24,7 +25,7 @@
                        const std::string& name,
                        const std::vector<std::string>& triggerActions,
                        const SensorsInfo& sensors,
-                       const std::vector<std::string>& reportNames,
+                       const std::vector<std::string>& reportIds,
                        const TriggerThresholdParamsExt& thresholds) {
                     LabeledTriggerThresholdParams
                         labeledTriggerThresholdParams = std::visit(
@@ -35,7 +36,7 @@
                         triggerFactory->getLabeledSensorsInfo(yield, sensors);
 
                     return addTrigger(id, name, triggerActions,
-                                      labeledSensorsInfo, reportNames,
+                                      labeledSensorsInfo, reportIds,
                                       labeledTriggerThresholdParams)
                         .getPath();
                 });
@@ -61,7 +62,7 @@
     }
 
     verifyTriggerIdLength(triggerId);
-    verifyIdCharacters(triggerId);
+    utils::verifyIdCharacters(triggerId);
 
     for (const auto& trigger : triggers)
     {
@@ -83,50 +84,21 @@
     }
 }
 
-void TriggerManager::verifyIdCharacters(const std::string& triggerId)
-{
-    if (triggerId.find_first_not_of(allowedCharactersInId) != std::string::npos)
-    {
-        throw sdbusplus::exception::SdBusError(
-            static_cast<int>(std::errc::invalid_argument),
-            "Invalid character in trigger id");
-    }
-}
-
 std::string TriggerManager::generateId(const std::string& prefix,
                                        const std::string& triggerName) const
 {
-    verifyIdCharacters(prefix);
-    std::string strippedId(triggerName);
-    strippedId.erase(std::remove_if(strippedId.begin(), strippedId.end(),
-                                    [](char c) {
-                                        return c == '/' ||
-                                               allowedCharactersInId.find(c) ==
-                                                   std::string_view::npos;
-                                    }),
-                     strippedId.end());
+    const auto existingTriggerIds = utils::transform(
+        triggers, [](const auto& trigger) { return trigger->getId(); });
 
-    strippedId = prefix + strippedId;
-    strippedId = strippedId.substr(
-        0, maxTriggerIdLength - std::to_string(maxTriggers - 1).length());
-
-    size_t idx = 0;
-    std::string tmpId(strippedId);
-    while (std::find_if(triggers.begin(), triggers.end(),
-                        [&tmpId](const auto& trigger) {
-                            return trigger->getId() == tmpId;
-                        }) != triggers.end())
-    {
-        tmpId = strippedId + std::to_string(idx++);
-    }
-    return tmpId;
+    return utils::generateId(prefix, triggerName, existingTriggerIds,
+                             maxTriggerIdLength);
 }
 
 interfaces::Trigger& TriggerManager::addTrigger(
     const std::string& triggerIdIn, const std::string& triggerNameIn,
     const std::vector<std::string>& triggerActions,
     const std::vector<LabeledSensorInfo>& labeledSensorsInfo,
-    const std::vector<std::string>& reportNames,
+    const std::vector<std::string>& reportIds,
     const LabeledTriggerThresholdParams& labeledThresholdParams)
 {
     std::string triggerName = triggerNameIn;
@@ -135,16 +107,12 @@
         triggerName = triggerNameDefault;
     }
 
-    std::string triggerId = triggerIdIn;
-    if (triggerId.empty() || triggerId.ends_with('/'))
-    {
-        triggerId = generateId(triggerId, triggerName);
-    }
+    std::string triggerId = generateId(triggerIdIn, triggerName);
 
     verifyAddTrigger(triggerId, triggerName);
 
     triggers.emplace_back(triggerFactory->make(
-        triggerId, triggerName, triggerActions, reportNames, *this,
+        triggerId, triggerName, triggerActions, reportIds, *this,
         *triggerStorage, labeledThresholdParams, labeledSensorsInfo));
 
     return *triggers.back();
@@ -190,14 +158,14 @@
                         .get<std::vector<discrete::LabeledThresholdParam>>();
             }
 
-            auto reportNames =
-                data->at("ReportNames").get<std::vector<std::string>>();
+            auto reportIds =
+                data->at("ReportIds").get<std::vector<std::string>>();
 
             auto labeledSensorsInfo =
                 data->at("Sensors").get<std::vector<LabeledSensorInfo>>();
 
-            addTrigger(id, name, triggerActions, labeledSensorsInfo,
-                       reportNames, labeledThresholdParams);
+            addTrigger(id, name, triggerActions, labeledSensorsInfo, reportIds,
+                       labeledThresholdParams);
         }
         catch (const std::exception& e)
         {
diff --git a/src/trigger_manager.hpp b/src/trigger_manager.hpp
index 4837062..5231546 100644
--- a/src/trigger_manager.hpp
+++ b/src/trigger_manager.hpp
@@ -36,13 +36,12 @@
     std::string generateId(const std::string& prefix,
                            const std::string& triggerName) const;
     static void verifyTriggerIdLength(const std::string& triggerId);
-    static void verifyIdCharacters(const std::string& triggerId);
 
     interfaces::Trigger&
         addTrigger(const std::string& triggerId, const std::string& triggerName,
                    const std::vector<std::string>& triggerActions,
                    const std::vector<LabeledSensorInfo>& labeledSensors,
-                   const std::vector<std::string>& reportNames,
+                   const std::vector<std::string>& reportIds,
                    const LabeledTriggerThresholdParams& labeledThresholdParams);
     void loadFromPersistent();
 
@@ -55,8 +54,5 @@
         "xyz.openbmc_project.Telemetry.TriggerManager";
     static constexpr const char* triggerManagerPath =
         "/xyz/openbmc_project/Telemetry/Triggers";
-
-    static constexpr std::string_view allowedCharactersInId =
-        "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_/";
     static constexpr const char* triggerNameDefault = "Trigger";
 };
diff --git a/src/types/operation_type.hpp b/src/types/operation_type.hpp
index 5665e79..29bceb4 100644
--- a/src/types/operation_type.hpp
+++ b/src/types/operation_type.hpp
@@ -22,13 +22,13 @@
     convDataOperationType = {
         {std::make_pair<std::string_view, OperationType>("SINGLE",
                                                          OperationType::single),
-         std::make_pair<std::string_view, OperationType>("MAX",
+         std::make_pair<std::string_view, OperationType>("Maximum",
                                                          OperationType::max),
-         std::make_pair<std::string_view, OperationType>("MIN",
+         std::make_pair<std::string_view, OperationType>("Minimum",
                                                          OperationType::min),
-         std::make_pair<std::string_view, OperationType>("AVG",
+         std::make_pair<std::string_view, OperationType>("Average",
                                                          OperationType::avg),
-         std::make_pair<std::string_view, OperationType>("SUM",
+         std::make_pair<std::string_view, OperationType>("Summation",
                                                          OperationType::sum)}};
 
 inline OperationType
diff --git a/src/types/report_types.cpp b/src/types/report_types.cpp
index f6979cc..47add24 100644
--- a/src/types/report_types.cpp
+++ b/src/types/report_types.cpp
@@ -13,12 +13,13 @@
                 utils::transform(
                     metricParams.at_label<ts::SensorPath>(),
                     [](const LabeledSensorParameters& sensorParameters) {
-                        return sdbusplus::message::object_path(
-                            sensorParameters.at_label<ts::Path>());
+                        return std::tuple<sdbusplus::message::object_path,
+                                          std::string>(
+                            sensorParameters.at_label<ts::Path>(),
+                            sensorParameters.at_label<ts::Metadata>());
                     }),
                 utils::enumToString(metricParams.at_label<ts::OperationType>()),
                 metricParams.at_label<ts::Id>(),
-                metricParams.at_label<ts::MetricMetadata>(),
                 utils::enumToString(
                     metricParams.at_label<ts::CollectionTimeScope>()),
                 metricParams.at_label<ts::CollectionDuration>().t.count());
diff --git a/src/types/report_types.hpp b/src/types/report_types.hpp
index 9d4a160..978fd18 100644
--- a/src/types/report_types.hpp
+++ b/src/types/report_types.hpp
@@ -18,20 +18,21 @@
     std::vector<std::tuple<sdbusplus::message::object_path, std::string,
                            std::string, std::string>>;
 
-using ReadingParameters = std::vector<
-    std::tuple<std::vector<sdbusplus::message::object_path>, std::string,
-               std::string, std::string, std::string, uint64_t>>;
+using ReadingParameters = std::vector<std::tuple<
+    std::vector<std::tuple<sdbusplus::message::object_path, std::string>>,
+    std::string, std::string, std::string, uint64_t>>;
 
 using LabeledSensorParameters =
-    utils::LabeledTuple<std::tuple<std::string, std::string>,
-                        utils::tstring::Service, utils::tstring::Path>;
+    utils::LabeledTuple<std::tuple<std::string, std::string, std::string>,
+                        utils::tstring::Service, utils::tstring::Path,
+                        utils::tstring::Metadata>;
 
 using LabeledMetricParameters = utils::LabeledTuple<
     std::tuple<std::vector<LabeledSensorParameters>, OperationType, std::string,
-               std::string, CollectionTimeScope, CollectionDuration>,
+               CollectionTimeScope, CollectionDuration>,
     utils::tstring::SensorPath, utils::tstring::OperationType,
-    utils::tstring::Id, utils::tstring::MetricMetadata,
-    utils::tstring::CollectionTimeScope, utils::tstring::CollectionDuration>;
+    utils::tstring::Id, utils::tstring::CollectionTimeScope,
+    utils::tstring::CollectionDuration>;
 
 using ReadingData = std::tuple<std::string, std::string, double, uint64_t>;
 
diff --git a/src/types/trigger_types.hpp b/src/types/trigger_types.hpp
index 0ad9087..b21e8eb 100644
--- a/src/types/trigger_types.hpp
+++ b/src/types/trigger_types.hpp
@@ -138,7 +138,7 @@
 using LabeledSensorInfo =
     utils::LabeledTuple<std::tuple<std::string, std::string, std::string>,
                         utils::tstring::Service, utils::tstring::SensorPath,
-                        utils::tstring::SensorMetadata>;
+                        utils::tstring::Metadata>;
 
 using TriggerThresholdParamsExt =
     std::variant<std::monostate, std::vector<numeric::ThresholdParam>,
diff --git a/src/utils/conversion.hpp b/src/utils/conversion.hpp
index 222b990..fd3dbcb 100644
--- a/src/utils/conversion.hpp
+++ b/src/utils/conversion.hpp
@@ -1,5 +1,7 @@
 #pragma once
 
+#include <sdbusplus/exception.hpp>
+
 #include <algorithm>
 #include <array>
 #include <stdexcept>
@@ -13,7 +15,9 @@
 {
     [[noreturn]] static void throwConversionError()
     {
-        throw std::out_of_range("Value is not in range of enum");
+        throw sdbusplus::exception::SdBusError(
+            static_cast<int>(std::errc::invalid_argument),
+            "Invalid enum value");
     }
 };
 
diff --git a/src/utils/conversion_trigger.cpp b/src/utils/conversion_trigger.cpp
index aec0f28..ab06a48 100644
--- a/src/utils/conversion_trigger.cpp
+++ b/src/utils/conversion_trigger.cpp
@@ -73,7 +73,7 @@
     return utils::transform(infos, [](const LabeledSensorInfo& val) {
         return SensorsInfo::value_type(
             sdbusplus::message::object_path(val.at_label<ts::SensorPath>()),
-            val.at_label<ts::SensorMetadata>());
+            val.at_label<ts::Metadata>());
     });
 }
 
diff --git a/src/utils/generate_id.cpp b/src/utils/generate_id.cpp
new file mode 100644
index 0000000..adb1a5b
--- /dev/null
+++ b/src/utils/generate_id.cpp
@@ -0,0 +1,64 @@
+#include "utils/generate_id.hpp"
+
+#include <sdbusplus/exception.hpp>
+
+#include <system_error>
+
+namespace utils
+{
+namespace details
+{
+
+static constexpr std::string_view allowedCharactersInId =
+    "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_/";
+
+}
+
+void verifyIdCharacters(std::string_view triggerId)
+{
+    if (triggerId.find_first_not_of(details::allowedCharactersInId) !=
+        std::string::npos)
+    {
+        throw sdbusplus::exception::SdBusError(
+            static_cast<int>(std::errc::invalid_argument),
+            "Invalid character in id");
+    }
+}
+
+std::string generateId(std::string_view prefix, std::string_view name,
+                       const std::vector<std::string>& conflictIds,
+                       size_t maxLength)
+{
+    verifyIdCharacters(prefix);
+
+    if (!prefix.empty() && !prefix.ends_with('/'))
+    {
+        return std::string(prefix);
+    }
+
+    std::string strippedId(name);
+    strippedId.erase(
+        std::remove_if(strippedId.begin(), strippedId.end(),
+                       [](char c) {
+                           return c == '/' ||
+                                  details::allowedCharactersInId.find(c) ==
+                                      std::string_view::npos;
+                       }),
+        strippedId.end());
+    strippedId = std::string(prefix) + strippedId;
+
+    size_t idx = 0;
+    std::string tmpId = strippedId.substr(0, maxLength);
+
+    while (std::find(conflictIds.begin(), conflictIds.end(), tmpId) !=
+               conflictIds.end() ||
+           tmpId.empty())
+    {
+        tmpId = strippedId.substr(0, maxLength - std::to_string(idx).length()) +
+                std::to_string(idx);
+        ++idx;
+    }
+    return tmpId;
+}
+
+} // namespace utils
diff --git a/src/utils/generate_id.hpp b/src/utils/generate_id.hpp
new file mode 100644
index 0000000..aa9508e
--- /dev/null
+++ b/src/utils/generate_id.hpp
@@ -0,0 +1,15 @@
+#pragma once
+
+#include <string>
+#include <string_view>
+#include <vector>
+
+namespace utils
+{
+
+void verifyIdCharacters(std::string_view triggerId);
+std::string generateId(std::string_view prefix, std::string_view triggerName,
+                       const std::vector<std::string>& conflictIds,
+                       size_t maxLength);
+
+} // namespace utils
diff --git a/src/utils/labeled_tuple.hpp b/src/utils/labeled_tuple.hpp
index 398e4be..55789e9 100644
--- a/src/utils/labeled_tuple.hpp
+++ b/src/utils/labeled_tuple.hpp
@@ -167,6 +167,8 @@
         }
         else
         {
+            static_assert(Idx + 1 < sizeof...(Args),
+                          "Label not found in LabeledTuple");
             return find_item<Idx + 1, Label>(self);
         }
     }
diff --git a/src/utils/tstring.hpp b/src/utils/tstring.hpp
index f0bc679..e4529d8 100644
--- a/src/utils/tstring.hpp
+++ b/src/utils/tstring.hpp
@@ -24,11 +24,11 @@
     }
 };
 
-struct SensorMetadata
+struct Metadata
 {
     static std::string str()
     {
-        return "sensorMetadata";
+        return "metadata";
     }
 };
 
@@ -40,14 +40,6 @@
     }
 };
 
-struct MetricMetadata
-{
-    static std::string str()
-    {
-        return "metricMetadata";
-    }
-};
-
 struct Service
 {
     static std::string str()
