Compare commits

...

2 Commits

Author SHA1 Message Date
KyleKincer 70c8184610
Merge 7b8b3a603d into 930d904205 2024-11-13 20:27:23 +08:00
Kyle Kincer 7b8b3a603d feat: add command name to metrics 2024-07-13 19:29:15 -04:00
1 changed files with 1 additions and 0 deletions

View File

@ -216,6 +216,7 @@ func (mh *metricsHook) ProcessHook(hook redis.ProcessHook) redis.ProcessHook {
attrs = append(attrs, mh.attrs...) attrs = append(attrs, mh.attrs...)
attrs = append(attrs, attribute.String("type", "command")) attrs = append(attrs, attribute.String("type", "command"))
attrs = append(attrs, statusAttr(err)) attrs = append(attrs, statusAttr(err))
attrs = append(attrs, attribute.String("cmd", cmd.FullName()))
mh.useTime.Record(ctx, milliseconds(dur), metric.WithAttributes(attrs...)) mh.useTime.Record(ctx, milliseconds(dur), metric.WithAttributes(attrs...))