Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 20 additions & 14 deletions base/monitoring/prometheus/prometheus.ConfigMap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,21 @@ data:
target_label: name
separator: '-'

# Extra rules
extra_rules.yml: |
groups:
- name: container.rules
rules:
- record: container:process_cpu_seconds_total:ratio_rate5m
expr: sum by (instance) (rate(process_cpu_seconds_total[5m])) / engine_daemon_engine_cpus_cpus
- record: container:process_cpu_seconds_total:sum
expr: sum by (instance) (irate(process_cpu_seconds_total[1m]))
- record: container:process_resident_memory_bytes:max
expr: max by (instance) (process_resident_memory_bytes)
- record: container:process_virtual_memory_bytes:max
expr: max by (instance) (process_virtual_memory_bytes)

# List of static targets
prometheus_targets.yml: |
- labels:
nodename: "sourcegraph-services"
Expand Down Expand Up @@ -103,7 +118,7 @@ data:
- worker-executors:6996
- labels:
nodename: "sourcegraph-services"
job: node
job: syntect-server
targets:
- syntect-server:6060
- labels:
Expand Down Expand Up @@ -147,40 +162,31 @@ data:
targets:
- otel-collector:8888

extra_rules.yml: |
groups:
- name: container.rules
rules:
- record: container:process_cpu_seconds_total:ratio_rate5m
expr: sum by (instance) (rate(process_cpu_seconds_total[5m])) / engine_daemon_engine_cpus_cpus
- record: container:process_cpu_seconds_total:sum
expr: sum by (instance) (irate(process_cpu_seconds_total[1m]))
- record: container:process_resident_memory_bytes:max
expr: max by (instance) (process_resident_memory_bytes)
- record: container:process_virtual_memory_bytes:max
expr: max by (instance) (process_virtual_memory_bytes)

# Add new targets based on replica count of symbols
symbols_targets.yml: |
- labels:
nodename: "sourcegraph-services"
job: symbols
targets:
- symbols-0.symbols:6060

# Add new targets based on replica count of searcher
searcher_targets.yml: |
- labels:
nodename: "sourcegraph-services"
job: searcher
targets:
- searcher-0.searcher:6060

# Add new targets based on replica count of gitserver
gitserver_targets.yml: |
- labels:
nodename: "sourcegraph-services"
job: gitserver
targets:
- gitserver-0.gitserver:6060

# Add new targets based on replica count of indexed-search
indexed-search_targets.yml: |
- labels:
nodename: "sourcegraph-services"
Expand Down
2 changes: 1 addition & 1 deletion components/clusters/minikube/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ patches:
version: v1
path: patches/remove-statefulset-resources-container-1.yaml
- target:
kind: Deployment
kind: Deployment|StatefulSet
name: sourcegraph-frontend|pgsql|codeintel-db|codeinsights-db
group: apps
version: v1
Expand Down
22 changes: 11 additions & 11 deletions components/utils/multi-version-upgrade/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component
patchesJson6902:
- target:
kind: .*
name: .*
group: apps
version: v1
patch: |-
patches:
- patch: |-
- op: replace
path: /spec/replicas
value: 0
- target:
kind: Deployment
name: pgsql|codeintel-db|codeinsights-db
target:
group: apps
kind: .*
name: .*
version: v1
patch: |-
- patch: |-
- op: replace
path: /spec/replicas
value: 1
target:
group: apps
kind: Deployment|StatefulSet
name: pgsql|codeintel-db|codeinsights-db
version: v1
44 changes: 21 additions & 23 deletions instances/template/kustomization.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ components:
# Monitoring Stack
#---------------------------------------------------------------------------------------
- ../../components/monitoring # -- Add default resources for Sourcegraph monitoring services
# - ../../components/monitoring/otel # -- Deploy OpenTelemetry Collector
# - ../../components/monitoring/tracing # -- Deploy OpenTelemetry Collector with Jaeger as tracing backend
# - ../../components/monitoring/cadvisor # -- Add resources for cAdvisor (requires privileges)
# - ../../components/monitoring/otel # -- Add resources for otel
# - ../../components/monitoring/tracing # -- Add resources for otel with Jaeger as tracing backend
# - ../../components/monitoring/privileged # -- Run monitoring stack with privileged and root access
# - ../../components/remove/daemonset # -- Remove all services with daemonsets: node-exporter & otel
# - ../../components/remove/otel-collector # -- Remove otel-collector and otel-agent
Expand Down Expand Up @@ -187,33 +187,31 @@ components:
# resources using patch files to customize your deployment
##########################################################################################

# patchesStrategicMerge:
# - patches/frontend-ingress.annotations.yaml # Add new annotations to frontend ingress
# - patches/frontend-env-vars.yaml # Update env vars in frontend
# - patches/prometheus.ConfigMap.yaml
# - patches/pgsql.ConfigMap.yaml
# - patches/otel-collector.ConfigMap.yaml
# - patches/custom.NodePort.yaml
# - patches/resources.yaml

# ------------------------------------------------------------------------
# Storage Size
# ------------------------------------------------------------------------
# patchesJson6902:
# - target:
# kind: PersistentVolumeClaim
# name: blobstore|codeinsights-db|codeintel-db|pgsql|prometheus|redis-store|redis-cache
# patch: |-
# patches:
# - patch: patches/frontend-ingress.annotations.yaml
# - patch: patches/frontend-env-vars.yaml
# - patch: patches/prometheus.ConfigMap.yaml
# - patch: patches/pgsql.ConfigMap.yaml
# - patch: patches/otel-collector.ConfigMap.yaml
# - patch: patches/custom.NodePort.yaml
# - patch: patches/resources.yaml
# #---------------------------------------------------------------------------------------
# # [STORAGE SIZES]
# #---------------------------------------------------------------------------------------
# - patch: |-
# - op: replace
# path: /spec/resources/requests/storage
# value: 100Gi
# - target:
# kind: StatefulSet
# name: gitserver|indexed-search|searcher|symbols
# patch: |-
# target:
# kind: PersistentVolumeClaim
# name: blobstore|codeinsights-db|codeintel-db|pgsql|prometheus|redis-store|redis-cache
# - patch: |-
# - op: replace
# path: /spec/volumeClaimTemplates/0/spec/resources/requests/storage
# value: 200Gi
# target:
# kind: StatefulSet
# name: gitserver|indexed-search|searcher|symbols

##########################################################################################
# [BUILD CONFIGURATIONS] Handles updating configs using env vars for kustomize
Expand Down