Files
LuanandGitHub ea53aa9362 Migrate usage of metrics.Handler to metricDefinition.With (#5435)
## 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.
2024-03-07 23:09:49 +00:00
..