GitHub user Duansg created a discussion: Discussion on fingerprint generation
logic
As described in issue #3828 , I reviewed the relevant logic and found the
following issues:
1. In the fingerprint generation logic of `MetricsRealTimeAlertCalculator`, if
a metric contains multiple rows of values and no tags are set for the current
metric, it may result in identical fingerprint information being generated.
This can lead to information being overwritten or abnormal alert statuses. The
critical code is as follows:
```
if (field.getLabel()) {
fingerPrints.put(field.getName(), valueStr);
}
```
2. In the fingerprint generation logic of `MetricsPeriodicAlertCalculator`, if
the calculation results return multiple entries and include high-cardinality
label values (e.g., trace_id, user_id, create_time), this not only generates a
large volume of alert messages but also leads to abnormal alert statuses. The
critical code is as follows:
```
for (Map.Entry<String, Object> entry : result.entrySet()) {
if (entry.getValue() != null && !VALUE.equals(entry.getKey()) &&
!TIMESTAMP.equals(entry.getKey())) {
fingerPrints.put(entry.getKey(), entry.getValue().toString());
}
}
```
In Question 1, if information overwriting and state confusion occur, I consider
this unacceptable. I cannot even correctly distinguish valid exception
messages, which may lead to misunderstandings for users.
In Question 2, high cardinality may lead to increased resource consumption in
TSDB. This is because high cardinality typically implies a large number of
active time series. This can result in excessive memory usage or increased
insertion operation latency, among other issues.
Welcome to join the discussion.
GitHub link: https://github.com/apache/hertzbeat/discussions/3845
----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]