Skip to content

Commit

Permalink
[metric_storage] Metric storage group expire (#676)
Browse files Browse the repository at this point in the history
Signed-off-by: Mikhail Scherba <[email protected]>
  • Loading branch information
miklezzzz authored Nov 1, 2024
1 parent 7bde4c5 commit e643dff
Show file tree
Hide file tree
Showing 5 changed files with 394 additions and 15 deletions.
326 changes: 326 additions & 0 deletions pkg/metric/grouped_storage_mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pkg/metric/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ type Storage interface {
type GroupedStorage interface {
Registerer() prometheus.Registerer
ExpireGroupMetrics(group string)
ExpireGroupMetricByName(group, name string)
GetOrCreateCounterCollector(name string, labelNames []string) (*ConstCounterCollector, error)
GetOrCreateGaugeCollector(name string, labelNames []string) (*ConstGaugeCollector, error)
CounterAdd(group string, name string, value float64, labels map[string]string)
Expand Down
2 changes: 1 addition & 1 deletion pkg/metric_storage/metric_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ func NewMetricStorage(ctx context.Context, prefix string, newRegistry bool) *Met
Counters: make(map[string]*prometheus.CounterVec),
Histograms: make(map[string]*prometheus.HistogramVec),
HistogramBuckets: make(map[string][]float64),
groupedVault: vault.NewGroupedVault(),
Gatherer: prometheus.DefaultGatherer,
Registerer: prometheus.DefaultRegisterer,
}
m.groupedVault = vault.NewGroupedVault(m.resolveMetricName)
m.groupedVault.SetRegisterer(m.Registerer)

if newRegistry {
Expand Down
Loading

0 comments on commit e643dff

Please sign in to comment.