|
Monitoring System 0.1.0
System resource monitoring with pluggable collectors and alerting
|
Key-value labels for alert identification and routing. More...
#include <alert_types.h>

Public Member Functions | |
| alert_labels ()=default | |
| alert_labels (std::unordered_map< std::string, std::string > lbl) | |
| void | set (const std::string &key, const std::string &value) |
| Add or update a label. | |
| std::string | get (const std::string &key) const |
| Get a label value. | |
| bool | has (const std::string &key) const |
| Check if a label exists. | |
| std::string | fingerprint () const |
| Generate a fingerprint for deduplication. | |
| bool | operator== (const alert_labels &other) const |
Public Attributes | |
| std::unordered_map< std::string, std::string > | labels |
Key-value labels for alert identification and routing.
Labels are used for alert grouping, deduplication, and routing to appropriate notification channels.
Definition at line 100 of file alert_types.h.
|
default |
|
inlineexplicit |
Definition at line 105 of file alert_types.h.
|
inline |
Generate a fingerprint for deduplication.
Definition at line 140 of file alert_types.h.
References labels.
Referenced by kcenon::monitoring::alert::fingerprint().

|
inline |
Get a label value.
| key | Label key |
Definition at line 122 of file alert_types.h.
References labels.
Referenced by kcenon::monitoring::alert_aggregator::compute_group_key(), kcenon::monitoring::alert_aggregator::extract_common_labels(), kcenon::monitoring::alert_silence::matches(), kcenon::monitoring::inhibition_rule::matches_source(), kcenon::monitoring::routing_notifier::route_by_label(), kcenon::monitoring::inhibition_rule::should_inhibit(), TEST(), and TEST_F().

|
inline |
Check if a label exists.
| key | Label key |
Definition at line 132 of file alert_types.h.
References labels.
|
inline |
Definition at line 151 of file alert_types.h.
References labels, and kcenon::monitoring::other.
|
inline |
Add or update a label.
| key | Label key |
| value | Label value |
Definition at line 113 of file alert_types.h.
References labels.
Referenced by kcenon::monitoring::alert_rule::add_label(), kcenon::monitoring::create_sample_alert(), AlertTest::create_test_alert(), kcenon::monitoring::alert_aggregator::extract_common_labels(), main(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().

| std::unordered_map<std::string, std::string> kcenon::monitoring::alert_labels::labels |
Definition at line 101 of file alert_types.h.
Referenced by fingerprint(), kcenon::monitoring::json_alert_formatter::format(), get(), has(), kcenon::monitoring::alert_silence::matches(), kcenon::monitoring::inhibition_rule::matches_source(), operator==(), kcenon::monitoring::alert_template::render(), set(), kcenon::monitoring::inhibition_rule::should_inhibit(), and TEST_F().