lib/sidekiq_prometheus/metrics.rb in sidekiq_prometheus-1.8.3 vs lib/sidekiq_prometheus/metrics.rb in sidekiq_prometheus-1.9.0
- old
+ new
@@ -174,10 +174,15 @@
labels: all_labels,
preset_labels: all_preset_labels}
options[:buckets] = buckets if buckets
- registry.send(type, name.to_sym, **options)
+ metric = registry.send(type, name.to_sym, **options)
+
+ init_label_sets = SidekiqPrometheus.init_label_sets.fetch(name, [])
+ init_label_sets.each { |label_set| metric.init_label_set(label_set) }
+
+ metric
end
def unregister(name:)
registry.unregister(name.to_sym)
end