Skip to content

Commit

Permalink
(feat) : service monitor resource support
Browse files Browse the repository at this point in the history
Signed-off-by: VILJkid <sidvjmostwanted@gmail.com>
  • Loading branch information
VILJkid committed Aug 23, 2024
1 parent 55841ee commit acdb5f7
Show file tree
Hide file tree
Showing 10 changed files with 318 additions and 179 deletions.
12 changes: 11 additions & 1 deletion charts/opensearch-dashboards/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
### Security
---
## [1.22.0]
### Added
- Added `ServiceMonitor` support for Prometheus monitoring
### Changed
### Deprecated
### Removed
### Fixed
### Security
---
## [1.21.0]
### Added
### Changed
Expand Down Expand Up @@ -466,7 +475,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
### Security

[Unreleased]: https://github.com/opensearch-project/helm-charts/compare/opensearch-dashboards-1.21.0...HEAD
[Unreleased]: https://github.com/opensearch-project/helm-charts/compare/opensearch-dashboards-1.22.0...HEAD
[1.22.0]: https://github.com/opensearch-project/helm-charts/compare/opensearch-1.21.0...opensearch-1.22.0
[1.21.0]: https://github.com/opensearch-project/helm-charts/compare/opensearch-1.20.0...opensearch-1.21.0
[1.20.0]: https://github.com/opensearch-project/helm-charts/compare/opensearch-1.19.0...opensearch-1.20.0
[1.19.0]: https://github.com/opensearch-project/helm-charts/compare/opensearch-1.18.0...opensearch-1.19.0
Expand Down
2 changes: 1 addition & 1 deletion charts/opensearch-dashboards/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.21.0
version: 1.22.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
183 changes: 111 additions & 72 deletions charts/opensearch-dashboards/README.md

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions charts/opensearch-dashboards/templates/serviceMonitor.yaml
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 }}
18 changes: 18 additions & 0 deletions charts/opensearch-dashboards/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -270,3 +270,21 @@ plugins:
enabled: false
installList: []
# - example-fake-plugin-downloadable-url

# ServiceMonitor Configuration for Prometheus
# Enabling this option will create a ServiceMonitor resource that allows Prometheus to scrape metrics from the OpenSearch service.
serviceMonitor:
# Set to true to enable the ServiceMonitor resource for OpenSearch Dashboards
enabled: false

# HTTP path where metrics are exposed by OpenSearch Dashboards.
# Ensure this path is correctly set in your service.
path: /_prometheus/metrics

# Frequency at which Prometheus will scrape metrics.
# Modify as needed for your monitoring requirements.
interval: 10s

# Port configuration for metrics.
# This should match the port exposed by the OpenSearch Dashboards service.
metricsPort: 9601
12 changes: 11 additions & 1 deletion charts/opensearch/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
### Security
---
## [1.29.0]
### Added
- Added `ServiceMonitor` support for Prometheus monitoring
### Changed
### Deprecated
### Removed
### Fixed
### Security
---
## [1.28.1]
### Added
### Changed
Expand Down Expand Up @@ -708,7 +717,8 @@ config:
### Fixed
### Security

[Unreleased]: https://github.com/opensearch-project/helm-charts/compare/opensearch-1.28.1...HEAD
[Unreleased]: https://github.com/opensearch-project/helm-charts/compare/opensearch-1.29.0...HEAD
[1.29.0]: https://github.com/opensearch-project/helm-charts/compare/opensearch-1.28.1...opensearch-1.29.0
[1.28.1]: https://github.com/opensearch-project/helm-charts/compare/opensearch-1.28.0...opensearch-1.28.1
[1.28.0]: https://github.com/opensearch-project/helm-charts/compare/opensearch-1.27.0...opensearch-1.28.0
[1.27.0]: https://github.com/opensearch-project/helm-charts/compare/opensearch-1.26.0...opensearch-1.27.0
Expand Down
2 changes: 1 addition & 1 deletion charts/opensearch/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.28.1
version: 1.29.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
205 changes: 103 additions & 102 deletions charts/opensearch/README.md

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions charts/opensearch/templates/serviceMonitor.yaml
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.uname" . }}-service-monitor
namespace: {{ .Release.Namespace }}
labels:
{{- include "opensearch.labels" . | nindent 4 }}
spec:
selector:
matchLabels:
{{- include "opensearch.selectorLabels" . | nindent 6 }}
endpoints:
- port: {{ .Values.metricsPort }}
interval: {{ .Values.serviceMonitor.interval }}
path: {{ .Values.serviceMonitor.path }}
{{- end }}
29 changes: 28 additions & 1 deletion charts/opensearch/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,20 @@ rbac:

podSecurityPolicy:
create: false
name: ""
name: ""# ServiceMonitor Configuration for Prometheus

Check failure on line 174 in charts/opensearch/values.yaml

View workflow job for this annotation

GitHub Actions / lint-test (1.19.16)

[comments] too few spaces before comment

Check failure on line 174 in charts/opensearch/values.yaml

View workflow job for this annotation

GitHub Actions / lint-test (1.21.14)

[comments] too few spaces before comment

Check failure on line 174 in charts/opensearch/values.yaml

View workflow job for this annotation

GitHub Actions / lint-test (1.22.9)

[comments] too few spaces before comment

Check failure on line 174 in charts/opensearch/values.yaml

View workflow job for this annotation

GitHub Actions / lint-test (1.23.12)

[comments] too few spaces before comment

Check failure on line 174 in charts/opensearch/values.yaml

View workflow job for this annotation

GitHub Actions / lint-test (1.24.7)

[comments] too few spaces before comment
# Enabling this option will create a ServiceMonitor resource that allows Prometheus to scrape metrics from the OpenSearch service.
serviceMonitor:
# Set to true to enable the ServiceMonitor resource
enabled: false

# HTTP path where metrics are exposed.
# Ensure this matches your OpenSearch service configuration.
path: /_prometheus/metrics

# Frequency at which Prometheus will scrape metrics.
# Adjust based on your needs.
interval: 10s

spec:
privileged: true
fsGroup:
Expand Down Expand Up @@ -509,3 +522,17 @@ extraObjects: []
# selector:
# matchLabels:
# {{- include "opensearch.selectorLabels" . | nindent 6 }}

# ServiceMonitor Configuration for Prometheus
# Enabling this option will create a ServiceMonitor resource that allows Prometheus to scrape metrics from the OpenSearch service.
serviceMonitor:

Check failure on line 528 in charts/opensearch/values.yaml

View workflow job for this annotation

GitHub Actions / lint-test (1.19.16)

[key-duplicates] duplication of key "serviceMonitor" in mapping

Check failure on line 528 in charts/opensearch/values.yaml

View workflow job for this annotation

GitHub Actions / lint-test (1.21.14)

[key-duplicates] duplication of key "serviceMonitor" in mapping

Check failure on line 528 in charts/opensearch/values.yaml

View workflow job for this annotation

GitHub Actions / lint-test (1.22.9)

[key-duplicates] duplication of key "serviceMonitor" in mapping

Check failure on line 528 in charts/opensearch/values.yaml

View workflow job for this annotation

GitHub Actions / lint-test (1.23.12)

[key-duplicates] duplication of key "serviceMonitor" in mapping

Check failure on line 528 in charts/opensearch/values.yaml

View workflow job for this annotation

GitHub Actions / lint-test (1.24.7)

[key-duplicates] duplication of key "serviceMonitor" in mapping
# Set to true to enable the ServiceMonitor resource
enabled: false

# HTTP path where metrics are exposed.
# Ensure this matches your OpenSearch service configuration.
path: /_prometheus/metrics

# Frequency at which Prometheus will scrape metrics.
# Adjust based on your needs.
interval: 10s

0 comments on commit acdb5f7

Please sign in to comment.