-
Notifications
You must be signed in to change notification settings - Fork 542
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ingester/Distributor: Add support for exporting cost attribution metr…
…ics (#10269) * Poc: cost attribution proposal 2 * refectory * add experimental features in about-versioning.md * change const variable to private * make timer service * rename TrackerForUser to Tracker * use fine locking * add comments explain why we use unchecked collector * rename deleteUserTracker to deleteTracker * rename cat in cost attribution package to t or tracker * avoid get tracker twice * refactor inactiveObservationsForUser * refactor shouldDelete function * rename calabels and calabelmap to labels and index * remove getter and setter of max cardinality and cooldown duration * rename CompareLabels to hasSameLabels * remove the mapping logic since the slices are ordered * remove unnecessary tracker nil checking * fix linting * refactor updateOverflow method * remove stream in comments * make observation struct private * remove unnecessary pointers * rename discardSampleMtx to discardedSampleMtx * rename variable observedMtx because I write with feet * update test name dum dum * remove test result * address doc change * remove time checking * add createIfDoesNotExist parameter * add more condition for trigger newTracker * remove the label adapter to labels call * remove useless function dum dum * make hardcoded increment value * rename + make cooldownuntil a normal int64 and lock with observedMtx * use build-in functon dum dum * modify the copy of calabels instead of directly the slice * update mimir-prometheus * vendor new mimir-prometheus * rename function * fix lint * add unittest in active series * copy slice instead * add test for discarded samples * change small map to slice since it is quicker * remove unused parameter * add new parameter * update config file * Update pkg/costattribution/manager.go Co-authored-by: Oleg Zaytsev <[email protected]> * take config before locking tracker map * simplify logics * remove useless initialization * change int64 to time.x * change pointer to instance * change instance to pointer in map * remove callback * use string when create new key in map * move the logic to different place * get cat once out of loop * update tracker per request for received samples * make the lock fanny by dum dum * make ingester work * fix lock * add changelog * update changelog * update doc with correct metrics name * remove useless function * cast only once * stop using string * simplify logics * add new tracker for active series only * add new sample tracker vs active series tracker * remove conflict * clean up code * fix * Update pkg/distributor/distributor.go Co-authored-by: Oleg Zaytsev <[email protected]> * address comments * update docs * update tests * correct the metrics name * fix lint * update examples * remove test files * change tests * rename cat to cast * remove the unnecessary indent * format * move the order function to the caller * add comments * Update pkg/costattribution/sample_tracker.go Co-authored-by: Oleg Zaytsev <[email protected]> * remove useless function * change overflowSince to time.Time * change the lock to RWMutex * change the condition of recovered to less than maxcardinality * remove useless function * change overflowsince to time.time * Update pkg/costattribution/manager.go Co-authored-by: Oleg Zaytsev <[email protected]> * Update pkg/costattribution/sample_tracker.go Co-authored-by: Oleg Zaytsev <[email protected]> * fix test * formatting * fix dum dum * just defer * use write lock to write, sounds reasonable hum? * update lock * changelog update --------- Co-authored-by: Oleg Zaytsev <[email protected]>
- Loading branch information
1 parent
504dd37
commit bd6e14b
Showing
36 changed files
with
2,217 additions
and
344 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.