Skip to content
Snippets Groups Projects
Commit 6a5faaf3 authored by Pavel Antonov's avatar Pavel Antonov :asterisk:
Browse files

Merge branch 'fix/PRXS-2867-AddNameCache' into 'master'

Изменена сигнатура функции TelemetryMiddleware для возможности передать название кэша в метрику

See merge request perxis/perxis-go!339
parents 8540164e 4b747136
No related branches found
No related tags found
No related merge requests found
......@@ -15,12 +15,16 @@ type telemetryMiddleware struct {
}
// TelemetryMiddleware возвращает обертку над кэшем, которая используется для отслеживания количества хитов и промахов в кэше.
func TelemetryMiddleware(next Cache, keyValues ...attribute.KeyValue) Cache {
func TelemetryMiddleware(next Cache, name string, keyValues ...attribute.KeyValue) Cache {
cacheMetrics, err := metrics.GetCacheMetrics()
if err != nil {
panic(err)
}
if name != "" {
keyValues = append(keyValues, attribute.String("cache_name", name))
}
return &telemetryMiddleware{
next: next,
cacheMetrics: cacheMetrics,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment