Skip to content

Commit 6c8d608

Browse files
committed
Use safer defaults
1 parent f8044fa commit 6c8d608

File tree

9 files changed

+48
-47
lines changed

9 files changed

+48
-47
lines changed

components/monitoring/prometheus/base/monitoringstack/monitoringstack.yaml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ spec:
4242
audience: # added by overlays
4343
tokenUrl: https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token
4444
url: # added by overlays
45-
writeRelabelConfigs:
46-
- action: LabelKeep
47-
regex: ""
45+
# writeRelabelConfigs: # added by overlays
4846
---
4947
# Grant permission to Federate In-Cluster Prometheus
5048
apiVersion: rbac.authorization.k8s.io/v1
@@ -80,8 +78,7 @@ spec:
8078
app.kubernetes.io/managed-by: observability-operator
8179
app.kubernetes.io/name: appstudio-federate-ms-prometheus
8280
endpoints:
83-
- params:
84-
'match[]': [] # scrape only required metrics from in-cluster prometheus
81+
- params: {} # added by overlays
8582
relabelings:
8683
# override the target's address by the prometheus-k8s service name.
8784
- action: replace

components/monitoring/prometheus/production/base/monitoringstack/endpoints-params-match.yaml renamed to components/monitoring/prometheus/production/base/monitoringstack/endpoints-params.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
---
22
- op: replace
3-
path: /spec/endpoints/0/params/match[]
4-
value: # scrape only required metrics from in-cluster prometheus
3+
path: /spec/endpoints/0/params
4+
value:
5+
'match[]': # scrape only required metrics from in-cluster prometheus
56
- '{__name__="pipeline_service_schedule_overhead_percentage_sum"}'
67
- '{__name__="pipeline_service_schedule_overhead_percentage_count"}'
78
- '{__name__="pipeline_service_execution_overhead_percentage_sum"}'

components/monitoring/prometheus/production/base/monitoringstack/kustomization.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ patches:
77
target:
88
name: appstudio-federate-smon
99
kind: ServiceMonitor
10-
- path: endpoints-params-match.yaml
10+
- path: endpoints-params.yaml
1111
target:
1212
name: appstudio-federate-smon
1313
kind: ServiceMonitor
@@ -19,7 +19,7 @@ patches:
1919
target:
2020
name: appstudio-federate-ms
2121
kind: MonitoringStack
22-
- path: writeRelabelConfigs-regex.yaml
22+
- path: writeRelabelConfigs.yaml
2323
target:
2424
name: appstudio-federate-ms
2525
kind: MonitoringStack

components/monitoring/prometheus/production/base/monitoringstack/writeRelabelConfigs-regex.yaml

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
- op: replace
3+
path: /spec/prometheusConfig/remoteWrite/0/writeRelabelConfigs
4+
value:
5+
- action: LabelKeep
6+
regex: "__name__|source_environment|source_cluster|namespace|app|pod|container|\
7+
label_pipelines_appstudio_openshift_io_type|health_status|dest_namespace|\
8+
controller|service|reason|phase|type|resource|resourcequota|le|app|image|\
9+
commit_hash|job|operation|tokenName|rateLimited|state|persistentvolumeclaim|\
10+
storageclass|volumename|release_reason|instance|result|deployment_reason|\
11+
validation_reason|strategy|succeeded|target|name|method|code|sp|le|\
12+
unexpected_status|failure|hostname|label_app_kubernetes_io_managed_by|status|\
13+
pipeline|pipelinename|pipelinerun|schedule|check|grpc_service|grpc_code|\
14+
grpc_method|lease|lease_holder|deployment|platform|mode|cpu|role|node|kind|\
15+
verb|request_kind|tested_cluster|resource_type|exported_job|http_method|\
16+
http_route|http_status_code|gin_errors|rule_result|rule_execution_cause|\
17+
policy_name|policy_background_mode|rule_type|policy_type|policy_validation_mode|\
18+
resource_request_operation|resource_kind|policy_change_type|event_type"

components/monitoring/prometheus/staging/base/monitoringstack/endpoints-params-match.yaml renamed to components/monitoring/prometheus/staging/base/monitoringstack/endpoints-params.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
---
22
- op: replace
3-
path: /spec/endpoints/0/params/match[]
4-
value: # scrape only required metrics from in-cluster prometheus
3+
path: /spec/endpoints/0/params
4+
value:
5+
'match[]': # scrape only required metrics from in-cluster prometheus
56
- '{__name__="pipeline_service_schedule_overhead_percentage_sum"}'
67
- '{__name__="pipeline_service_schedule_overhead_percentage_count"}'
78
- '{__name__="pipeline_service_execution_overhead_percentage_sum"}'

components/monitoring/prometheus/staging/base/monitoringstack/kustomization.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ patches:
77
target:
88
name: appstudio-federate-smon
99
kind: ServiceMonitor
10-
- path: endpoints-params-match.yaml
10+
- path: endpoints-params.yaml
1111
target:
1212
name: appstudio-federate-smon
1313
kind: ServiceMonitor
@@ -19,7 +19,7 @@ patches:
1919
target:
2020
name: appstudio-federate-ms
2121
kind: MonitoringStack
22-
- path: writeRelabelConfigs-regex.yaml
22+
- path: writeRelabelConfigs.yaml
2323
target:
2424
name: appstudio-federate-ms
2525
kind: MonitoringStack

components/monitoring/prometheus/staging/base/monitoringstack/writeRelabelConfigs-regex.yaml

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
- op: replace
3+
path: /spec/prometheusConfig/remoteWrite/0/writeRelabelConfigs
4+
value:
5+
- action: LabelKeep
6+
regex: "__name__|source_environment|source_cluster|namespace|app|pod|container|\
7+
label_pipelines_appstudio_openshift_io_type|health_status|dest_namespace|\
8+
controller|service|reason|phase|type|resource|resourcequota|le|app|image|\
9+
commit_hash|job|operation|tokenName|rateLimited|state|persistentvolumeclaim|\
10+
storageclass|volumename|release_reason|instance|result|deployment_reason|\
11+
validation_reason|strategy|succeeded|target|name|method|code|sp|le|\
12+
unexpected_status|failure|hostname|label_app_kubernetes_io_managed_by|status|\
13+
pipeline|pipelinename|pipelinerun|schedule|check|grpc_service|grpc_code|\
14+
grpc_method|lease|lease_holder|deployment|platform|mode|cpu|role|node|kind|\
15+
verb|request_kind|tested_cluster|resource_type|exported_job|http_method|\
16+
http_route|http_status_code|gin_errors|rule_result|rule_execution_cause|\
17+
policy_name|policy_background_mode|rule_type|policy_type|policy_validation_mode|\
18+
resource_request_operation|resource_kind|policy_change_type|event_type"

0 commit comments

Comments
 (0)