mirror of
https://github.com/safing/portbase
synced 2025-09-16 10:09:49 +00:00
Add internal ID to metric
This commit is contained in:
parent
8d792bdacc
commit
a34de1ce8e
2 changed files with 8 additions and 0 deletions
|
@ -92,6 +92,10 @@ func register(m Metric) error {
|
|||
if m.LabeledID() == registeredMetric.LabeledID() {
|
||||
return ErrAlreadyRegistered
|
||||
}
|
||||
if m.Opts().InternalID != "" &&
|
||||
m.Opts().InternalID == registeredMetric.Opts().InternalID {
|
||||
return fmt.Errorf("%w with this internal ID", ErrAlreadyRegistered)
|
||||
}
|
||||
}
|
||||
|
||||
// Add new metric to registry and sort it.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue