Skip to content

Commit

Permalink
vendor new mimir-prometheus
Browse files Browse the repository at this point in the history
  • Loading branch information
ying-jeanne committed Dec 24, 2024
1 parent 87209d6 commit 4706bde
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 18 deletions.
5 changes: 0 additions & 5 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1279,13 +1279,8 @@ github.com/grafana/gomemcache v0.0.0-20241016125027-0a5bcc5aef40 h1:1TeKhyS+pvzO
github.com/grafana/gomemcache v0.0.0-20241016125027-0a5bcc5aef40/go.mod h1:IGRj8oOoxwJbHBYl1+OhS9UjQR0dv6SQOep7HqmtyFU=
github.com/grafana/memberlist v0.3.1-0.20220714140823-09ffed8adbbe h1:yIXAAbLswn7VNWBIvM71O2QsgfgW9fRXZNR0DXe6pDU=
github.com/grafana/memberlist v0.3.1-0.20220714140823-09ffed8adbbe/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE=
<<<<<<< HEAD
github.com/grafana/mimir-prometheus v0.0.0-20241224134504-460b7be5bce8 h1:/TwjdoLAxL7URxKJGJUeI539w6LUqcwIcj0WCUxDY/c=
github.com/grafana/mimir-prometheus v0.0.0-20241224134504-460b7be5bce8/go.mod h1:a5LEa2Vy87wOp0Vu6sLmEIR1V59fqH3QosOSiErAr30=
=======
github.com/grafana/mimir-prometheus v0.0.0-20241219104229-b50052711673 h1:z3nSCBMtEMtD/LAIkwrHsT03n7qgeU+0M6rEMZQbxVI=
github.com/grafana/mimir-prometheus v0.0.0-20241219104229-b50052711673/go.mod h1:a5LEa2Vy87wOp0Vu6sLmEIR1V59fqH3QosOSiErAr30=
>>>>>>> origin/r322
github.com/grafana/opentracing-contrib-go-stdlib v0.0.0-20230509071955-f410e79da956 h1:em1oddjXL8c1tL0iFdtVtPloq2hRPen2MJQKoAWpxu0=
github.com/grafana/opentracing-contrib-go-stdlib v0.0.0-20230509071955-f410e79da956/go.mod h1:qtI1ogk+2JhVPIXVc6q+NHziSmy2W5GbdQZFUHADCBU=
github.com/grafana/prometheus-alertmanager v0.25.1-0.20240930132144-b5e64e81e8d3 h1:6D2gGAwyQBElSrp3E+9lSr7k8gLuP3Aiy20rweLWeBw=
Expand Down
8 changes: 4 additions & 4 deletions pkg/costattribution/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,16 @@ func (m *Manager) deleteTracker(userID string) {
}

func (m *Manager) updateTracker(userID string) *Tracker {
t := m.Tracker(userID)

if t == nil {
if !m.EnabledForUser(userID) {
m.deleteTracker(userID)
return nil
}

t := m.Tracker(userID)

lbls := m.limits.CostAttributionLabels(userID)

newTrackedLabels := make([]string, 0, len(lbls))
newTrackedLabels := make([]string, len(lbls))
copy(newTrackedLabels, lbls)

// sort the labels to ensure the order is consistent
Expand Down
3 changes: 2 additions & 1 deletion pkg/costattribution/tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ func newTracker(userID string, trackedLabels []string, limit int, cooldown time.
logger: logger,
overflowLabels: overflowLabels,
totalFailedActiveSeries: atomic.NewFloat64(0),
cooldownUntil: 0,
}

tracker.discardedSampleAttribution = prometheus.NewDesc("cortex_discarded_attributed_samples_total",
Expand Down Expand Up @@ -329,7 +330,7 @@ func (t *Tracker) createNewObservation(key []byte, ts int64, activeSeriesIncreme

func (t *Tracker) recoverFromOverflow(deadline int64) bool {
t.observedMtx.RLock()
if t.cooldownUntil != 0 && t.cooldownUntil < deadline {
if t.cooldownUntil > 0 && t.cooldownUntil < deadline {
if len(t.observed) <= t.maxCardinality {
t.observedMtx.RUnlock()
return true
Expand Down
7 changes: 3 additions & 4 deletions pkg/mimir/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -1203,10 +1203,10 @@ func (t *Mimir) setupModuleManager() error {
Overrides: {RuntimeConfig},
OverridesExporter: {Overrides, MemberlistKV, Vault},
Distributor: {DistributorService, API, ActiveGroupsCleanupService, Vault},
DistributorService: {IngesterRing, IngesterPartitionRing, Overrides, Vault, CostAttributionService},
CostAttributionService: {API, Overrides},
DistributorService: {IngesterRing, IngesterPartitionRing, Overrides, Vault, CostAttributionService},
CostAttributionService: {API, Overrides},
Ingester: {IngesterService, API, ActiveGroupsCleanupService, Vault},
IngesterService: {IngesterRing, IngesterPartitionRing, Overrides, RuntimeConfig, MemberlistKV, CostAttributionService},
IngesterService: {IngesterRing, IngesterPartitionRing, Overrides, RuntimeConfig, MemberlistKV, CostAttributionService},
Flusher: {Overrides, API},
Queryable: {Overrides, DistributorService, IngesterRing, IngesterPartitionRing, API, StoreQueryable, MemberlistKV},
Querier: {TenantFederation, Vault},
Expand All @@ -1228,7 +1228,6 @@ func (t *Mimir) setupModuleManager() error {
Read: {QueryFrontend, Querier},
Backend: {QueryScheduler, Ruler, StoreGateway, Compactor, AlertManager, OverridesExporter},
All: {QueryFrontend, Querier, Ingester, Distributor, StoreGateway, Ruler, Compactor},
>>>>>>> origin/r322
}
for mod, targets := range deps {
if err := mm.AddDependency(mod, targets...); err != nil {
Expand Down
4 changes: 0 additions & 4 deletions vendor/modules.txt

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

0 comments on commit 4706bde

Please sign in to comment.