Convert atomic Int64 to native type when logging value
The atomic Int64 type wasn't able to be represented when logging
via go-kit log and ended up as `"unsupported value type"`.
@@ -686,17 +686,18 @@ func (h *Head) ApplyConfig(cfg *config.Config) error {
}
// Head uses opts.MaxExemplars in combination with opts.EnableExemplarStorage
- // to decide if it should pass exemplars along to it's exemplar storage, so we
+ // to decide if it should pass exemplars along to its exemplar storage, so we
// need to update opts.MaxExemplars here.
prevSize := h.opts.MaxExemplars.Load()
h.opts.MaxExemplars.Store(cfg.StorageConfig.ExemplarsConfig.MaxExemplars)
+ newSize := h.opts.MaxExemplars.Load()
- if prevSize == h.opts.MaxExemplars.Load() {
+ if prevSize == newSize {
return nil
}
- migrated := h.exemplars.(*CircularExemplarStorage).Resize(h.opts.MaxExemplars.Load())
- level.Info(h.logger).Log("msg", "Exemplar storage resized", "from", prevSize, "to", h.opts.MaxExemplars, "migrated", migrated)
+ migrated := h.exemplars.(*CircularExemplarStorage).Resize(newSize)
+ level.Info(h.logger).Log("msg", "Exemplar storage resized", "from", prevSize, "to", newSize, "migrated", migrated)
return nil
}
