mirror of
https://github.com/hanzoai/tasks.git
synced 2026-10-04 02:04:03 +00:00
## What changed?
Using the new metricDefinition.With approach.
## Why?
The usage of metrics.Handler could be both redundant and unsafe:
```
handler.Histogram( myHisto.Name(), myHisto.Unit() ).Record(...)
│ │ └───┐
│ │ │
└─────┐ └───────────┐ │
│ │ │
Redundant and Unsafe: 'Histogram' │ │
is specified despite knowing │ │
'myHisto' is a histogram. There's │ │
also a risk if 'myHisto.Name()' │ │
refers to a metric definition that │ │
is not a histogram. │ │
└─── Redundant information
```
And using the new With(Handler) method, there's no need to specify
redundant information.
## How did you test it?
Already exists an ExampleHandler which tests all the new approach
methods.
## Potential risks
People can still use the old approach, because we are keeping
the Handler interface as-is.
## Is hotfix candidate?
No.