Skip to content

Commit

Permalink
use both service and pod metrics (#1108)
Browse files Browse the repository at this point in the history
  • Loading branch information
vangheem committed Jul 17, 2023
1 parent 7497f57 commit c0e1f1f
Show file tree
Hide file tree
Showing 15 changed files with 71 additions and 7 deletions.
4 changes: 4 additions & 0 deletions charts/nucliadb_ingest/templates/ingest-headless.svc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@ spec:
port: {{ .Values.chitchat.cluster_manager.port }}
protocol: TCP
appProtocol: tcp
- name: metrics
port: {{ .Values.serving.metricsPort}}
protocol: TCP
appProtocol: http
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ spec:
checksum/cm: {{ include (print $.Template.BasePath "/ingest.cm.yaml") . | sha256sum }}
labels:
app: ingest-orm-grpc
metrics: "enabled"
version: "{{ .Chart.Version | replace "+" "_" }}"
chart: "{{ .Chart.Name }}"
release: "{{ .Release.Name }}"
Expand Down
5 changes: 5 additions & 0 deletions charts/nucliadb_ingest/templates/ingest-orm-grpc.svc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ metadata:
name: ingest-orm-grpc
labels:
app: ingest-orm-grpc
metrics: "enabled"
version: "{{ .Chart.Version | replace "+" "_" }}"
chart: "{{ .Chart.Name }}"
release: "{{ .Release.Name }}"
Expand All @@ -21,3 +22,7 @@ spec:
port: {{ .Values.chitchat.cluster_manager.port }}
protocol: TCP
appProtocol: tcp
- name: metrics
port: {{ .Values.serving.metricsPort}}
protocol: TCP
appProtocol: http
5 changes: 5 additions & 0 deletions charts/nucliadb_ingest/templates/ingest.svc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ metadata:
name: ingest
labels:
app: ingest
metrics: "enabled"
version: "{{ .Chart.Version | replace "+" "_" }}"
chart: "{{ .Chart.Name }}"
release: "{{ .Release.Name }}"
Expand All @@ -21,3 +22,7 @@ spec:
port: {{ .Values.chitchat.cluster_manager.port }}
protocol: TCP
appProtocol: tcp
- name: metrics
port: {{ .Values.serving.metricsPort}}
protocol: TCP
appProtocol: http
32 changes: 32 additions & 0 deletions charts/nucliadb_node/templates/node.sm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{- if .Values.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: node
labels:
app: node
version: "{{ .Chart.Version | replace "+" "_" }}"
chart: "{{ .Chart.Name }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
spec:
namespaceSelector:
matchNames:
- "{{ .Release.Namespace }}"
selector:
matchLabels:
app: node
endpoints:
# node sidecar metrics
- targetPort: {{ .Values.serving.metricsPort }}
interval: 10s
path: /metrics
# reader
- targetPort: 3031
interval: 10s
path: /metrics
# writer
- targetPort: 3032
interval: 10s
path: /metrics
{{- end }}
3 changes: 1 addition & 2 deletions charts/nucliadb_node/templates/node.sts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,12 @@ spec:
metadata:
annotations:
traffic.sidecar.istio.io/excludeOutboundPorts: "{{.Values.nats.port }}"
traffic.sidecar.istio.io/excludeInboundPorts: "{{.Values.serving.metricsPort }}"
traffic.sidecar.istio.io/excludeInboundPorts: "{{.Values.serving.metricsPort }},3031,3032"
# do not have access to dependency chart cm this component references
checksum/cm: {{ include (print $.Template.BasePath "/node.cm.yaml") . | sha256sum }}
name: node
labels:
app: node
metrics: "enabled"
app.kubernetes.io/name: node
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
Expand Down
1 change: 0 additions & 1 deletion charts/nucliadb_reader/templates/reader.deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ spec:
checksum/cm: {{ include (print $.Template.BasePath "/reader.cm.yaml") . | sha256sum }}
labels:
app: reader
metrics: "enabled"
version: "{{ .Chart.Version | replace "+" "_" }}"
chart: "{{ .Chart.Name }}"
release: "{{ .Release.Name }}"
Expand Down
1 change: 1 addition & 0 deletions charts/nucliadb_reader/templates/reader.svc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ metadata:
name: reader
labels:
app: reader
metrics: "enabled"
version: "{{ .Chart.Version | replace "+" "_" }}"
chart: "{{ .Chart.Name }}"
release: "{{ .Release.Name }}"
Expand Down
1 change: 0 additions & 1 deletion charts/nucliadb_search/templates/search.deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ spec:
checksum/cm: {{ include (print $.Template.BasePath "/search.cm.yaml") . | sha256sum }}
labels:
app: search
metrics: "enabled"
version: "{{ .Chart.Version | replace "+" "_" }}"
chart: "{{ .Chart.Name }}"
release: "{{ .Release.Name }}"
Expand Down
1 change: 1 addition & 0 deletions charts/nucliadb_search/templates/search.svc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ metadata:
name: search
labels:
app: search
metrics: "enabled"
version: "{{ .Chart.Version | replace "+" "_" }}"
chart: "{{ .Chart.Name }}"
release: "{{ .Release.Name }}"
Expand Down
20 changes: 20 additions & 0 deletions charts/nucliadb_shared/templates/nucliadb.sm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: ndb-sm
labels:
version: "{{ .Chart.Version | replace "+" "_" }}"
chart: "{{ .Chart.Name }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
spec:
namespaceSelector:
matchNames:
- "{{ .Release.Namespace }}"
selector:
matchLabels:
metrics: "enabled"
endpoints:
- port: metrics
interval: 10s
path: /metrics
1 change: 0 additions & 1 deletion charts/nucliadb_train/templates/train.deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ spec:
checksum/cm: {{ include (print $.Template.BasePath "/train.cm.yaml") . | sha256sum }}
labels:
app: train
metrics: "enabled"
version: "{{ .Chart.Version | replace "+" "_" }}"
chart: "{{ .Chart.Name }}"
release: "{{ .Release.Name }}"
Expand Down
1 change: 1 addition & 0 deletions charts/nucliadb_train/templates/train.svc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ metadata:
name: train
labels:
app: train
metrics: "enabled"
version: "{{ .Chart.Version | replace "+" "_" }}"
chart: "{{ .Chart.Name }}"
release: "{{ .Release.Name }}"
Expand Down
1 change: 0 additions & 1 deletion charts/nucliadb_writer/templates/writer.deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ spec:
name: writer
labels:
app: writer
metrics: "enabled"
version: "{{ .Chart.Version | replace "+" "_" }}"
chart: "{{ .Chart.Name }}"
release: "{{ .Release.Name }}"
Expand Down
1 change: 1 addition & 0 deletions charts/nucliadb_writer/templates/writer.svc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ metadata:
name: writer
labels:
app: writer
metrics: "enabled"
version: "{{ .Chart.Version | replace "+" "_" }}"
chart: "{{ .Chart.Name }}"
release: "{{ .Release.Name }}"
Expand Down

2 comments on commit c0e1f1f

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: c0e1f1f Previous: b760df9 Ratio
nucliadb/search/tests/unit/search/test_fetch.py::test_highligh_error 5833.3490954930985 iter/sec (stddev: 9.110362881480595e-7) 5804.479338298567 iter/sec (stddev: 1.4505330313876097e-7) 1.00

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: c0e1f1f Previous: a40981d Ratio
nucliadb/tests/benchmarks/test_search.py::test_search_returns_labels 51.29825067787303 iter/sec (stddev: 0.0008826635384177155) 60.779932309336715 iter/sec (stddev: 0.0019119907918232523) 1.18
nucliadb/tests/benchmarks/test_search.py::test_search_relations 136.80337750037836 iter/sec (stddev: 0.0004377745409201615) 182.57436721258293 iter/sec (stddev: 0.0002220745559283828) 1.33

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.