Skip to content

Commit

Permalink
added servicemonitor only including 1 service
Browse files Browse the repository at this point in the history
  • Loading branch information
AronKa-SAG committed Jun 6, 2024
1 parent 3bf8283 commit b9f4c41
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions apigateway/helm/templates/_helper.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,11 @@ Renders the license config name or secret. If not specified, it will be the defa
*/}}
{{- define "apigateway.licenseconfigname" -}}
{{- default ( printf "%s-%s" (include "common.names.fullname" . ) "license") .Values.licenseConfigName }}
{{- end }}

{{/*
Renders the service name for service monitoring. If not specified, it will be the default name.
*/}}
{{- define "apigateway.monitorServiceName" -}}
{{- default ( printf "%s-%s" (include "common.names.fullname" . ) "-rt") .Values.serviceMonitor.serviceName }}
{{- end }}
1 change: 1 addition & 0 deletions apigateway/helm/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,5 @@ spec:
selector:
matchLabels:
app.kubernetes.io/instance: {{ .Release.Name }}
name: {{ include "apigateway.monitorServiceName" . }}
{{- end }}
1 change: 1 addition & 0 deletions apigateway/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ prometheus:
# -- Create and enable ServiceMonitor. The default is `false`.
serviceMonitor:
enabled: false
serviceName: ""

metering:

Expand Down

0 comments on commit b9f4c41

Please sign in to comment.