mirror of
https://github.com/netbirdio/netbird.git
synced 2024-12-14 19:00:50 +01:00
22 lines
336 B
Go
22 lines
336 B
Go
package metrics
|
|
|
|
import "go.opentelemetry.io/otel/metric"
|
|
|
|
type Metrics struct {
|
|
metric.Meter
|
|
|
|
Peers metric.Int64UpDownCounter
|
|
}
|
|
|
|
func NewMetrics(meter metric.Meter) (*Metrics, error) {
|
|
peers, err := meter.Int64UpDownCounter("peers")
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return &Metrics{
|
|
Meter: meter,
|
|
Peers: peers,
|
|
}, nil
|
|
}
|