Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime override of tenant-specific active series custom trackers #1188

Merged
merged 98 commits into from
Apr 5, 2022
Merged
Show file tree
Hide file tree
Changes from 91 commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
9139200
Initial implementation
gubjanos Feb 11, 2022
ceaecba
fixing test
gubjanos Feb 11, 2022
31f697b
More straightworward logic
gubjanos Feb 15, 2022
6318a97
Some tests
gubjanos Feb 15, 2022
2be8c3b
Clearing out tests
gubjanos Feb 15, 2022
6386997
Removing unused code
gubjanos Feb 15, 2022
f4dd1d5
Smaller fixes
gubjanos Feb 15, 2022
34d4953
Fixes based on oleg's review
gubjanos Feb 15, 2022
46d96bf
Simplifying diff logic by comparing current and present logic every t…
gubjanos Feb 15, 2022
c729776
Making serialization fail if matchers are not parseable
gubjanos Feb 16, 2022
c5d38a4
Proper checking of series matcher equality
gubjanos Feb 16, 2022
2821436
Changing slice allocation based on oleg's suggestion
gubjanos Feb 16, 2022
4a39127
'interning' default matchers to avoid memory leak
gubjanos Feb 16, 2022
a65aaf1
Support flag based config if no runtime config provided
gubjanos Feb 16, 2022
4fd52f1
Adding test cases for backward compatibility and overwrite check
gubjanos Feb 16, 2022
d987078
Cleaning up
gubjanos Feb 16, 2022
cd7bc5e
Early-exit when pointers reference the same object
gubjanos Feb 16, 2022
96aca48
Changing equality check to string concatenation based as it is much f…
gubjanos Feb 16, 2022
b552d66
Matcher configuration fix + adjusting test
gubjanos Feb 17, 2022
bb4e8b1
Adding active_series_custom_tracker tests
gubjanos Feb 17, 2022
fa925be
Adding active_series_test
gubjanos Feb 17, 2022
c651fca
Fixes based on oleg's suggestions
gubjanos Feb 17, 2022
28b4ff0
fixup
gubjanos Feb 17, 2022
e2250a9
fixup
gubjanos Feb 18, 2022
378c86e
Incorporating oleg's suggestions
gubjanos Feb 18, 2022
858863a
Adding more tests
gubjanos Feb 21, 2022
66e6ea1
cleanup
gubjanos Feb 21, 2022
1fcd42c
Adding testcase for empty default overwrite and fixing this corner case
gubjanos Feb 21, 2022
36cb4a4
Merge branch 'main' into runtime-matchers
gubjanos Feb 21, 2022
3dd657e
Test fixes
gubjanos Feb 21, 2022
5209623
Test fixes, lint fixes
gubjanos Feb 22, 2022
5da5bce
Adding more testcases
gubjanos Feb 22, 2022
203d66e
Changing assert.NoError to require.NoError when immediate halting is …
gubjanos Feb 22, 2022
60f67ce
lint fix and merge resolve fix
gubjanos Feb 22, 2022
40ea210
Reintroducing ActiveSeriesCustomTrackerConfig because ingester config…
gubjanos Feb 22, 2022
c8ee2c9
Adding more context to asm.key comment
gubjanos Feb 22, 2022
8cde596
Changing back flag based description as it allows multiple flags
gubjanos Feb 22, 2022
47c7a0c
changing back to exact wording
gubjanos Feb 22, 2022
9e1ef8e
fixup
gubjanos Feb 22, 2022
bbf54a5
Using config type instead of map[string]string in tests, cleanup
gubjanos Feb 22, 2022
42870e5
Adding test case for metric cleanup
gubjanos Feb 22, 2022
79304c5
Changing ActiveSeriesCustomTrackerConfig to contain []labelMatchers
gubjanos Feb 23, 2022
c076c04
Adding assumption to deserialization test, and adding comment to Stri…
gubjanos Feb 23, 2022
20cb06f
Trying to speed up comparison
gubjanos Feb 23, 2022
7d0792c
Make custom trackers be unmarshaled as a map
colega Feb 23, 2022
2bc4da1
Refactor config parsing, make string key static
colega Feb 23, 2022
23e84eb
No need to store asm.key since config.string is static now
colega Feb 23, 2022
ed1bdfa
Make config.String() be a valid flag value.
colega Feb 23, 2022
b490ca8
Move config to same file as overrides, and rename file.
colega Feb 23, 2022
712cbbe
Updating help template
gubjanos Feb 23, 2022
ef3b51b
Creating ActiveSeriesMatchers only at replace time
gubjanos Feb 23, 2022
d324631
Revert "Creating ActiveSeriesMatchers only at replace time"
gubjanos Feb 23, 2022
07ae65c
Creating ActiveSeriesMatchers only at replace time
gubjanos Feb 24, 2022
78e325a
Update tools/doc-generator/parser.go
gubjanos Feb 24, 2022
80b593b
Changes based on oleg's comments
gubjanos Feb 24, 2022
30ae4f6
Replacing matchings for active series and including test case for this
gubjanos Feb 25, 2022
dc4b3e3
Rework and implementing oleg and pstibrany's suggestions
gubjanos Feb 28, 2022
0132477
Moving active series to separate package
gubjanos Mar 1, 2022
6c332a9
Moving tenant specific configuration to limits, updating tests
gubjanos Mar 1, 2022
9820074
Lint fixes, file renaming
gubjanos Mar 2, 2022
843ee36
Merge branch 'main' into runtime-matchers
gubjanos Mar 2, 2022
3035b4f
Use plain struct for config, not pointer
colega Mar 2, 2022
44f9fdc
CustomTrackersConfig annotation fix
gubjanos Mar 3, 2022
bfe3f6d
Adding documentation on limits
gubjanos Mar 3, 2022
e289c56
Moving active serreis flag to limits, removing runtime default, fixin…
gubjanos Mar 3, 2022
62fd2ef
Adding custom trackers loading metrics and tests for it
gubjanos Mar 4, 2022
23a8996
Adjustments based on Oleg's comments, and introducing single source of
gubjanos Mar 16, 2022
d247dec
Adding back ActiveSeriesCustomTrackersConfig to ingester for backward…
gubjanos Mar 16, 2022
3f942cd
Merge branch 'main' into runtime-matchers
gubjanos Mar 16, 2022
e551d87
lintfix
gubjanos Mar 16, 2022
21e7671
Test fix
gubjanos Mar 16, 2022
34ac0a5
Rework based on Oleg's suggestions
gubjanos Mar 17, 2022
f7136fb
Update pkg/ingester/activeseries/active_series_test.go
gubjanos Mar 17, 2022
7ca8b1e
Update pkg/ingester/activeseries/active_series_test.go
gubjanos Mar 17, 2022
e14d4db
Removing accidentally added file
gubjanos Mar 17, 2022
69054d3
Update pkg/ingester/activeseries/active_series.go
gubjanos Mar 18, 2022
47326c0
Reworking active series trackers to get time from external calls
gubjanos Mar 22, 2022
fd15e6a
Addressing review on comments and minor cleanup
gubjanos Mar 24, 2022
9e0a0e2
Changing active series deprecation override location and adding unit …
gubjanos Mar 29, 2022
5d12046
Adding TODO to remove module unit tests with Mimir 2.2 and adding hig…
gubjanos Mar 29, 2022
f24c6d2
Removing accidentally commited file (again...)
gubjanos Mar 29, 2022
9d6aeb7
Merge branch 'main' into runtime-matchers
gubjanos Mar 29, 2022
df0bb8d
Removing unused method clear.
gubjanos Mar 29, 2022
c0149a7
Updating config-descriptor
gubjanos Mar 29, 2022
583d9da
WIP Fixing data race
gubjanos Mar 30, 2022
273179a
Fixing mimir_test.go
gubjanos Mar 30, 2022
c5311bb
Referencing issue in test to explain why sleep is needed
gubjanos Mar 30, 2022
a8a230f
Lint fix
gubjanos Mar 30, 2022
737a08b
Adding entry to CHANGELOG.md
gubjanos Mar 31, 2022
444d0a9
Fixup for the changelog
gubjanos Mar 31, 2022
5fb103f
More precise wording for the changelog
gubjanos Mar 31, 2022
5aed13d
Merge branch 'main' into runtime-matchers
gubjanos Mar 31, 2022
b04a320
Comment fix based on Oleg's suggestion
gubjanos Mar 31, 2022
62e3b90
Merge branch 'main' into runtime-matchers
gubjanos Apr 1, 2022
28e3b2a
Lintfix after online editor conflict resolve
gubjanos Apr 1, 2022
9f9487c
Merge branch 'main' into runtime-matchers
gubjanos Apr 4, 2022
a043d12
Modifications based on pstibrany's comments
gubjanos Apr 4, 2022
48bb8ea
Fixing reference-help
gubjanos Apr 4, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* [CHANGE] Compactor: No longer upload debug meta files to object storage. #1257
* [FEATURE] Ruler: Allow setting `evaluation_delay` for each rule group via rules group configuration file. #1474
* [FEATURE] Distributor: Added the ability to forward specifics metrics to alternative remote_write API endpoints. #1052
* [FEATURE] Ingester: Active series custom trackers now supports runtime tenant-specific overrides. The configuration has been moved to limit config, the ingester config has been deprecated. #1188
* [ENHANCEMENT] Ruler: Add more detailed query information to ruler query stats logging. #1411
* [ENHANCEMENT] Admin: Admin API now has some styling. #1482 #1549
* [BUGFIX] Query-frontend: do not shard queries with a subquery unless the subquery is inside a shardable aggregation function call. #1542
Expand Down
14 changes: 12 additions & 2 deletions cmd/mimir/config-descriptor.json
Original file line number Diff line number Diff line change
Expand Up @@ -2307,10 +2307,9 @@
"kind": "field",
"name": "active_series_custom_trackers",
"required": false,
"desc": "Additional custom trackers for active metrics. If there are active series matching a provided matcher (map value), the count will be exposed in the custom trackers metric labeled using the tracker name (map key). Zero valued counts are not exposed (and removed when they go back to zero).",
"desc": "[Deprecated] This config has been moved to the limits config, please set it there. Additional custom trackers for active metrics. If there are active series matching a provided matcher (map value), the count will be exposed in the custom trackers metric labeled using the tracker name (map key). Zero valued counts are not exposed (and removed when they go back to zero).",
"fieldValue": null,
"fieldDefaultValue": {},
"fieldFlag": "ingester.active-series-custom-trackers",
"fieldType": "map of tracker name (string) to matcher (string)",
"fieldCategory": "advanced"
},
Expand Down Expand Up @@ -2625,6 +2624,17 @@
"fieldType": "int",
"fieldCategory": "experimental"
},
{
"kind": "field",
"name": "active_series_custom_trackers_config",
"required": false,
"desc": "Additional custom trackers for active metrics. If there are active series matching a provided matcher (map value), the count will be exposed in the custom trackers metric labeled using the tracker name (map key). Zero valued counts are not exposed (and removed when they go back to zero).",
"fieldValue": null,
"fieldDefaultValue": {},
"fieldFlag": "ingester.active-series-custom-trackers",
"fieldType": "map of tracker name (string) to matcher (string)",
"fieldCategory": "advanced"
},
{
"kind": "field",
"name": "max_fetched_chunks_per_query",
Expand Down
2 changes: 2 additions & 0 deletions cmd/mimir/help.txt.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,8 @@ Usage of ./cmd/mimir/mimir:
Print basic help.
-help-all
Print help, also including advanced and experimental parameters.
-ingester.active-series-custom-trackers value
gubjanos marked this conversation as resolved.
Show resolved Hide resolved
Additional active series metrics, matching the provided matchers. Matchers should be in form <name>:<matcher>, like 'foobar:{foo="bar"}'. Multiple matchers can be provided either providing the flag multiple times or providing multiple semicolon-separated values to a single flag.
-ingester.max-global-metadata-per-metric int
The maximum number of metadata per metric, across the cluster. 0 to disable.
-ingester.max-global-metadata-per-user int
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -816,18 +816,19 @@ ring:
# CLI flag: -ingester.active-series-metrics-idle-timeout
[active_series_metrics_idle_timeout: <duration> | default = 10m]

# (advanced) Additional custom trackers for active metrics. If there are active
# series matching a provided matcher (map value), the count will be exposed in
# the custom trackers metric labeled using the tracker name (map key). Zero
# valued counts are not exposed (and removed when they go back to zero).
# (advanced) [Deprecated] This config has been moved to the limits config,
# please set it there. Additional custom trackers for active metrics. If there
# are active series matching a provided matcher (map value), the count will be
# exposed in the custom trackers metric labeled using the tracker name (map
# key). Zero valued counts are not exposed (and removed when they go back to
# zero).
# Example:
# The following configuration will count the active series coming from dev and
# prod namespaces for each tenant and label them as {name="dev"} and
# {name="prod"} in the cortex_ingester_active_series_custom_tracker metric.
# active_series_custom_trackers:
# dev: '{namespace=~"dev-.*"}'
# prod: '{namespace=~"prod-.*"}'
# CLI flag: -ingester.active-series-custom-trackers
[active_series_custom_trackers: <map of tracker name (string) to matcher (string)> | default = ]

# (experimental) Period with which to update per-tenant max exemplar limit.
Expand Down Expand Up @@ -2545,6 +2546,20 @@ The `limits` block configures default and per-tenant limits imposed by component
# CLI flag: -ingester.max-global-exemplars-per-user
[max_global_exemplars_per_user: <int> | default = 0]

# (advanced) Additional custom trackers for active metrics. If there are active
# series matching a provided matcher (map value), the count will be exposed in
# the custom trackers metric labeled using the tracker name (map key). Zero
# valued counts are not exposed (and removed when they go back to zero).
# Example:
# The following configuration will count the active series coming from dev and
# prod namespaces for each tenant and label them as {name="dev"} and
# {name="prod"} in the cortex_ingester_active_series_custom_tracker metric.
# active_series_custom_trackers_config:
# dev: '{namespace=~"dev-.*"}'
# prod: '{namespace=~"prod-.*"}'
# CLI flag: -ingester.active-series-custom-trackers
[active_series_custom_trackers_config: <map of tracker name (string) to matcher (string)> | default = ]

# Maximum number of chunks that can be fetched in a single query from ingesters
# and long-term storage. This limit is enforced in the querier, ruler and
# store-gateway. 0 to disable.
Expand Down
135 changes: 0 additions & 135 deletions pkg/ingester/active_series_custom_tracker.go

This file was deleted.