Skip to content

Commit 481edca

Browse files
authored
Minor component fixes (#9)
1 parent 42eecfb commit 481edca

File tree

4 files changed

+53
-49
lines changed

4 files changed

+53
-49
lines changed

base/monitoring/prometheus/prometheus.ConfigMap.yaml

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,21 @@ data:
7575
target_label: name
7676
separator: '-'
7777
78+
# Extra rules
79+
extra_rules.yml: |
80+
groups:
81+
- name: container.rules
82+
rules:
83+
- record: container:process_cpu_seconds_total:ratio_rate5m
84+
expr: sum by (instance) (rate(process_cpu_seconds_total[5m])) / engine_daemon_engine_cpus_cpus
85+
- record: container:process_cpu_seconds_total:sum
86+
expr: sum by (instance) (irate(process_cpu_seconds_total[1m]))
87+
- record: container:process_resident_memory_bytes:max
88+
expr: max by (instance) (process_resident_memory_bytes)
89+
- record: container:process_virtual_memory_bytes:max
90+
expr: max by (instance) (process_virtual_memory_bytes)
91+
92+
# List of static targets
7893
prometheus_targets.yml: |
7994
- labels:
8095
nodename: "sourcegraph-services"
@@ -103,7 +118,7 @@ data:
103118
- worker-executors:6996
104119
- labels:
105120
nodename: "sourcegraph-services"
106-
job: node
121+
job: syntect-server
107122
targets:
108123
- syntect-server:6060
109124
- labels:
@@ -147,40 +162,31 @@ data:
147162
targets:
148163
- otel-collector:8888
149164
150-
extra_rules.yml: |
151-
groups:
152-
- name: container.rules
153-
rules:
154-
- record: container:process_cpu_seconds_total:ratio_rate5m
155-
expr: sum by (instance) (rate(process_cpu_seconds_total[5m])) / engine_daemon_engine_cpus_cpus
156-
- record: container:process_cpu_seconds_total:sum
157-
expr: sum by (instance) (irate(process_cpu_seconds_total[1m]))
158-
- record: container:process_resident_memory_bytes:max
159-
expr: max by (instance) (process_resident_memory_bytes)
160-
- record: container:process_virtual_memory_bytes:max
161-
expr: max by (instance) (process_virtual_memory_bytes)
162-
165+
# Add new targets based on replica count of symbols
163166
symbols_targets.yml: |
164167
- labels:
165168
nodename: "sourcegraph-services"
166169
job: symbols
167170
targets:
168171
- symbols-0.symbols:6060
169172
173+
# Add new targets based on replica count of searcher
170174
searcher_targets.yml: |
171175
- labels:
172176
nodename: "sourcegraph-services"
173177
job: searcher
174178
targets:
175179
- searcher-0.searcher:6060
176180
181+
# Add new targets based on replica count of gitserver
177182
gitserver_targets.yml: |
178183
- labels:
179184
nodename: "sourcegraph-services"
180185
job: gitserver
181186
targets:
182187
- gitserver-0.gitserver:6060
183188
189+
# Add new targets based on replica count of indexed-search
184190
indexed-search_targets.yml: |
185191
- labels:
186192
nodename: "sourcegraph-services"

components/clusters/minikube/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ patches:
2828
version: v1
2929
path: patches/remove-statefulset-resources-container-1.yaml
3030
- target:
31-
kind: Deployment
31+
kind: Deployment|StatefulSet
3232
name: sourcegraph-frontend|pgsql|codeintel-db|codeinsights-db
3333
group: apps
3434
version: v1
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
apiVersion: kustomize.config.k8s.io/v1alpha1
22
kind: Component
3-
patchesJson6902:
4-
- target:
5-
kind: .*
6-
name: .*
7-
group: apps
8-
version: v1
9-
patch: |-
3+
patches:
4+
- patch: |-
105
- op: replace
116
path: /spec/replicas
127
value: 0
13-
- target:
14-
kind: Deployment
15-
name: pgsql|codeintel-db|codeinsights-db
8+
target:
169
group: apps
10+
kind: .*
11+
name: .*
1712
version: v1
18-
patch: |-
13+
- patch: |-
1914
- op: replace
2015
path: /spec/replicas
2116
value: 1
17+
target:
18+
group: apps
19+
kind: Deployment|StatefulSet
20+
name: pgsql|codeintel-db|codeinsights-db
21+
version: v1

instances/template/kustomization.template.yaml

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ components:
8888
# Monitoring Stack
8989
#---------------------------------------------------------------------------------------
9090
- ../../components/monitoring # -- Add default resources for Sourcegraph monitoring services
91+
# - ../../components/monitoring/otel # -- Deploy OpenTelemetry Collector
92+
# - ../../components/monitoring/tracing # -- Deploy OpenTelemetry Collector with Jaeger as tracing backend
9193
# - ../../components/monitoring/cadvisor # -- Add resources for cAdvisor (requires privileges)
92-
# - ../../components/monitoring/otel # -- Add resources for otel
93-
# - ../../components/monitoring/tracing # -- Add resources for otel with Jaeger as tracing backend
9494
# - ../../components/monitoring/privileged # -- Run monitoring stack with privileged and root access
9595
# - ../../components/remove/daemonset # -- Remove all services with daemonsets: node-exporter & otel
9696
# - ../../components/remove/otel-collector # -- Remove otel-collector and otel-agent
@@ -187,33 +187,31 @@ components:
187187
# resources using patch files to customize your deployment
188188
##########################################################################################
189189

190-
# patchesStrategicMerge:
191-
# - patches/frontend-ingress.annotations.yaml # Add new annotations to frontend ingress
192-
# - patches/frontend-env-vars.yaml # Update env vars in frontend
193-
# - patches/prometheus.ConfigMap.yaml
194-
# - patches/pgsql.ConfigMap.yaml
195-
# - patches/otel-collector.ConfigMap.yaml
196-
# - patches/custom.NodePort.yaml
197-
# - patches/resources.yaml
198-
199-
# ------------------------------------------------------------------------
200-
# Storage Size
201-
# ------------------------------------------------------------------------
202-
# patchesJson6902:
203-
# - target:
204-
# kind: PersistentVolumeClaim
205-
# name: blobstore|codeinsights-db|codeintel-db|pgsql|prometheus|redis-store|redis-cache
206-
# patch: |-
190+
# patches:
191+
# - patch: patches/frontend-ingress.annotations.yaml
192+
# - patch: patches/frontend-env-vars.yaml
193+
# - patch: patches/prometheus.ConfigMap.yaml
194+
# - patch: patches/pgsql.ConfigMap.yaml
195+
# - patch: patches/otel-collector.ConfigMap.yaml
196+
# - patch: patches/custom.NodePort.yaml
197+
# - patch: patches/resources.yaml
198+
# #---------------------------------------------------------------------------------------
199+
# # [STORAGE SIZES]
200+
# #---------------------------------------------------------------------------------------
201+
# - patch: |-
207202
# - op: replace
208203
# path: /spec/resources/requests/storage
209204
# value: 100Gi
210-
# - target:
211-
# kind: StatefulSet
212-
# name: gitserver|indexed-search|searcher|symbols
213-
# patch: |-
205+
# target:
206+
# kind: PersistentVolumeClaim
207+
# name: blobstore|codeinsights-db|codeintel-db|pgsql|prometheus|redis-store|redis-cache
208+
# - patch: |-
214209
# - op: replace
215210
# path: /spec/volumeClaimTemplates/0/spec/resources/requests/storage
216211
# value: 200Gi
212+
# target:
213+
# kind: StatefulSet
214+
# name: gitserver|indexed-search|searcher|symbols
217215

218216
##########################################################################################
219217
# [BUILD CONFIGURATIONS] Handles updating configs using env vars for kustomize

0 commit comments

Comments
 (0)