Skip to content

Commit

Permalink
Add monitoring for rest of ChatQnA + DocSum components (#655)
Browse files Browse the repository at this point in the history
Which provide HTTP request metrics.

Signed-off-by: Eero Tamminen <[email protected]>
  • Loading branch information
eero-t authored Dec 25, 2024
1 parent baed0b5 commit 590991b
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 6 deletions.
13 changes: 7 additions & 6 deletions helm-charts/common/data-prep/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,13 @@ curl http://localhost:6007/v1/dataprep \

## Values

| Key | Type | Default | Description |
| ---------------------- | ------ | ----------------------- | ----------- |
| image.repository | string | `"opea/dataprep-redis"` | |
| service.port | string | `"6007"` | |
| REDIS_URL | string | `""` | |
| TEI_EMBEDDING_ENDPOINT | string | `""` | |
| Key | Type | Default | Description |
| ---------------------- | ------ | ----------------------- | ---------------------------------------- |
| image.repository | string | `"opea/dataprep-redis"` | |
| service.port | string | `"6007"` | |
| REDIS_URL | string | `""` | |
| TEI_EMBEDDING_ENDPOINT | string | `""` | |
| global.monitoring | bool | `false` | See ../../monitoring.md before enabling! |

## Milvus support

Expand Down
18 changes: 18 additions & 0 deletions helm-charts/common/data-prep/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

{{- if .Values.global.monitoring }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "data-prep.fullname" . }}
labels:
release: {{ .Values.global.prometheusRelease }}
spec:
selector:
matchLabels:
{{- include "data-prep.selectorLabels" . | nindent 6 }}
endpoints:
- port: data-prep
interval: 5s
{{- end }}
6 changes: 6 additions & 0 deletions helm-charts/common/data-prep/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,9 @@ global:
# If set, it will overwrite serviceAccount.name.
# If set, and serviceAccount.create is false, it will assume this service account is already created by others.
sharedSAName: ""

# Install Prometheus serviceMonitors for service components
monitoring: false

# Prometheus Helm install release name needed for serviceMonitors
prometheusRelease: prometheus-stack
18 changes: 18 additions & 0 deletions helm-charts/docsum/templates/m2t.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ metadata:
name: {{ .Release.Name }}-m2t
labels:
{{- include "docsum.labels" . | nindent 4 }}
app: {{ .Release.Name }}-m2t
spec:
type: {{ .Values.m2t.service.type }}
ports:
Expand All @@ -95,3 +96,20 @@ spec:
selector:
{{- include "docsum.selectorLabels" . | nindent 4 }}
app: {{ .Release.Name }}-m2t
---
{{- if .Values.global.monitoring }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "docsum.fullname" . }}-m2t
labels:
release: {{ .Values.global.prometheusRelease }}
spec:
selector:
matchLabels:
{{- include "docsum.selectorLabels" . | nindent 6 }}
app: {{ .Release.Name }}-m2t
endpoints:
- port: m2t
interval: 5s
{{- end }}
18 changes: 18 additions & 0 deletions helm-charts/docsum/templates/v2a.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ metadata:
name: {{ .Release.Name }}-v2a
labels:
{{- include "docsum.labels" . | nindent 4 }}
app: {{ .Release.Name }}-v2a
spec:
type: {{ .Values.v2a.service.type }}
ports:
Expand All @@ -90,3 +91,20 @@ spec:
selector:
{{- include "docsum.selectorLabels" . | nindent 4 }}
app: {{ .Release.Name }}-v2a
---
{{- if .Values.global.monitoring }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "docsum.fullname" . }}-v2a
labels:
release: {{ .Values.global.prometheusRelease }}
spec:
selector:
matchLabels:
{{- include "docsum.selectorLabels" . | nindent 6 }}
app: {{ .Release.Name }}-v2a
endpoints:
- port: v2a
interval: 5s
{{- end }}

0 comments on commit 590991b

Please sign in to comment.