MM-61887: Log the userID if a metric exceeds the last histogram bucket (#29448)

We create a custom histogram metric that logs the userID
when the observed value is greater or equal to the last bucket value.

This allows us to start tracking the slowest users of a system
while at the same time not polluting the Prometheus metrics
by storing a userID for every observation.

https://mattermost.atlassian.net/browse/MM-61887

```release-note
NONE
```
Этот коммит содержится в:
Agniva De Sarker
2024-12-05 09:12:54 +05:30
коммит произвёл GitHub
родитель 421001c981
Коммит a6d37fa14c
7 изменённых файлов: 203 добавлений и 63 удалений

Просмотреть файл

@@ -15,7 +15,7 @@ import (
func AssertLog(t *testing.T, logs io.Reader, level, message string) {
t.Helper()
if !hasMsg(t, logs, level, message) {
assert.Failf(t, "failed to find %s log message: %s", level, message)
assert.Failf(t, "failed to find", "Expected log_level: %s, log_message: %s", level, message)
}
}
@@ -23,7 +23,7 @@ func AssertLog(t *testing.T, logs io.Reader, level, message string) {
func AssertNoLog(t *testing.T, logs io.Reader, level, message string) {
t.Helper()
if hasMsg(t, logs, level, message) {
assert.Failf(t, "found %s log message: %s", level, message)
assert.Failf(t, "found", "Not expected log_level: %s log_message: %s", level, message)
}
}