Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add UUID to Prometheus metrics if requested #1240

Merged
merged 16 commits into from
Oct 12, 2022
Prev Previous commit
Next Next commit
WIP
  • Loading branch information
AlekSi committed Oct 11, 2022
commit 27a51c68f1eb7920ff22cd7647927fac28143238
4 changes: 3 additions & 1 deletion internal/util/state/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ func (p *Provider) Get() (*State, error) {

b, _ := os.ReadFile(p.filename)
_ = json.Unmarshal(b, &s)
if _, err := uuid.Parse(s.UUID); err == nil {
_, err := uuid.Parse(s.UUID)

if err == nil {
// store a copy
p.rw.Lock()
p.s = s
Expand Down