-
Notifications
You must be signed in to change notification settings - Fork 238
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add serviceMonitor resource (#537)
* feat: Add serviceMonitor resource Signed-off-by: Shubham Gupta <[email protected]> Signed-off-by: VILJkid <[email protected]> * fix: metrics path Signed-off-by: Shubham Gupta <[email protected]> Signed-off-by: VILJkid <[email protected]> * (lint) : trailing newline Signed-off-by: VILJkid <[email protected]> * (update) : readme and changelog with comments Signed-off-by: VILJkid <[email protected]> * (add) : opensearch-dashboard for serviceMonitor Signed-off-by: VILJkid <[email protected]> * (chore) : bump changelog version Signed-off-by: VILJkid <[email protected]> * (chore) : bump version Signed-off-by: VILJkid <[email protected]> * (lint) : add newline Signed-off-by: VILJkid <[email protected]> * (fix) : changelog compare versions Signed-off-by: VILJkid <[email protected]> * (fix) : bump minor versions instead of patch Signed-off-by: VILJkid <[email protected]> --------- Signed-off-by: Shubham Gupta <[email protected]> Signed-off-by: VILJkid <[email protected]> Co-authored-by: Shubham Gupta <[email protected]> Co-authored-by: VILJkid <[email protected]>
- Loading branch information
1 parent
4ca8bfd
commit 4253842
Showing
10 changed files
with
310 additions
and
180 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
charts/opensearch-dashboards/templates/serviceMonitor.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{{- if .Values.serviceMonitor.enabled }} | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: ServiceMonitor | ||
metadata: | ||
name: {{ template "opensearch-dashboards.fullname" . }}-service-monitor | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
{{- include "opensearch-dashboards.labels" . | nindent 4 }} | ||
spec: | ||
selector: | ||
matchLabels: | ||
{{- include "opensearch-dashboards.selectorLabels" . | nindent 6 }} | ||
endpoints: | ||
- port: {{ .Values.metricsPort }} | ||
interval: {{ .Values.serviceMonitor.interval }} | ||
path: {{ .Values.serviceMonitor.path }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
4253842
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we cannot use the port number here, specified in
metricsPort
. My helm release is failing.2024-08-26T12:35:54.739649021Z: warning: Upgrade "opensearch" failed: failed to create resource: ServiceMonitor.monitoring.coreos.com "opensearch-cluster-master-service-monitor" is invalid: spec.endpoints[0].port: Invalid value: "integer": spec.endpoints[0].port in body must be of type string: "integer"
When you see the definition of a serviceMonitor, it states:
So a name is expected in
port
. If we want to use the port number,targetPort
would be the right field, see:https://github.com/helm/charts/blob/390ee6614b4bb0da96b397f9b382e3ddca9f59a4/stable/prometheus-operator/crds/crd-servicemonitor.yaml#L177
4253842
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @schroedermatthias, you're correct!
I've created #581 PR to fix the same.