mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-24 13:14:05 -08:00
Convert atomic Int64 to native type when logging value (#9938)
The atomic Int64 type wasn't able to be represented when logging via go-kit log and ended up as `"unsupported value type"`. Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
This commit is contained in:
parent
3563db20e0
commit
084bd70708
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue