Skip to content

Commit a6318c7

Browse files
authored
The overrides exporter is integrated in cortex since v1.9.0 (#7)
The only caveat is that it doesn't support the presets. Everything else works the same Signed-off-by: Friedrich Gonzalez <[email protected]>
1 parent b8be2c2 commit a6318c7

File tree

3 files changed

+10
-43
lines changed

3 files changed

+10
-43
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## master / unreleased
44

55
* [CHANGE] Updated readme to use this repo with tanka
6+
* [CHANGE] Use integrated cortex overrides exporter
67
* [ENHANCEMENT] How to rename buckets in AWS and Azure for `not healthy index found` playbook. #5
78
* [BUGFIX] Updated blocks_storage_s3_endpoint in config.libsonnet to include the correct aws region
89

cortex/images.libsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
store_gateway: self.cortex,
2020
query_scheduler: self.cortex,
2121

22-
cortex_tools: 'grafana/cortex-tools:v0.4.0',
22+
overrides_exporter: self.cortex,
2323
query_tee: 'quay.io/cortexproject/query-tee:v1.11.0',
2424
testExporter: 'cortexproject/test-exporter:v1.11.0',
2525
},

cortex/overrides-exporter.libsonnet

Lines changed: 8 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,23 @@
1-
// this enables overrides exporter, which will expose the configured
2-
// overrides and presets (if configured). Those metrics can be potentially
3-
// high cardinality.
1+
// this enables overrides exporter, which will expose the configured overrides.
42
{
53
local name = 'overrides-exporter',
64

7-
_config+: {
8-
// overrides exporter can also make the configured presets available, this
9-
// list references entries within $._config.overrides
10-
11-
overrides_exporter_presets:: [
12-
'extra_small_user',
13-
'small_user',
14-
'medium_user',
15-
'big_user',
16-
'super_user',
17-
'mega_user',
18-
],
19-
},
20-
21-
local presets_enabled = std.length($._config.overrides_exporter_presets) > 0,
22-
23-
local configMap = $.core.v1.configMap,
24-
overrides_exporter_presets_configmap:
25-
if presets_enabled then
26-
configMap.new('overrides-presets') +
27-
configMap.withData({
28-
'overrides-presets.yaml': $.util.manifestYaml(
29-
{
30-
presets: {
31-
[key]: $._config.overrides[key]
32-
for key in $._config.overrides_exporter_presets
33-
},
34-
}
35-
),
36-
}),
37-
385
local containerPort = $.core.v1.containerPort,
39-
overrides_exporter_port:: containerPort.newNamed(name='http-metrics', containerPort=9683),
6+
overrides_exporter_port:: containerPort.newNamed(name='http-metrics', containerPort=80),
407

418
overrides_exporter_args:: {
42-
'overrides-file': '/etc/cortex/overrides.yaml',
43-
} + if presets_enabled then {
44-
'presets-file': '/etc/cortex_presets/overrides-presets.yaml',
45-
} else {},
9+
target: 'overrides-exporter',
10+
11+
'runtime-config.file': '/etc/cortex/overrides.yaml',
12+
},
4613

4714
local container = $.core.v1.container,
4815
overrides_exporter_container::
49-
container.new(name, $._images.cortex_tools) +
16+
container.new(name, $._images.overrides_exporter) +
5017
container.withPorts([
5118
$.overrides_exporter_port,
5219
]) +
53-
container.withArgsMixin([name] + $.util.mapToFlags($.overrides_exporter_args, prefix='--')) +
20+
container.withArgsMixin($.util.mapToFlags($.overrides_exporter_args, prefix='--')) +
5421
$.util.resourcesRequests('0.5', '0.5Gi') +
5522
$.util.readinessProbe +
5623
container.mixin.readinessProbe.httpGet.withPort($.overrides_exporter_port.name),
@@ -59,7 +26,6 @@
5926
overrides_exporter_deployment:
6027
deployment.new(name, 1, [$.overrides_exporter_container], { name: name }) +
6128
$.util.configVolumeMount($._config.overrides_configmap, '/etc/cortex') +
62-
$.util.configVolumeMount('overrides-presets', '/etc/cortex_presets') +
6329
deployment.mixin.metadata.withLabels({ name: name }),
6430

6531
overrides_exporter_service:

0 commit comments

Comments
 (0)