Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] OpenSearch and OpenSearch Dashboards Service Monitor Bug #581

Merged
merged 4 commits into from
Aug 28, 2024

Conversation

VILJkid
Copy link
Contributor

@VILJkid VILJkid commented Aug 26, 2024

Description

This PR addresses a bug in the ServiceMonitor template for OpenSearch and OpenSearch Dashboards. Previously, the port configuration incorrectly used a port number, but ServiceMonitor requires a port name as a string. The fix updates the configuration to use the correct port name, ensuring that Prometheus can properly scrape metrics from the OpenSearch service.

Issues Resolved

#579

Check List

  • Commits are signed per the DCO using --signoff

For any changes to files within Helm chart directories:

  • Helm chart version bumped
  • Helm chart CHANGELOG.md updated to reflect change

PR sponsored by Obmondo

Signed-off-by: VILJkid <sidvjmostwanted@gmail.com>
@VILJkid VILJkid changed the title [Fix] OpenSearch and OpenSearch Dashboards port Value Bug [Fix] OpenSearch and OpenSearch Dashboards Service Monitor Bug Aug 26, 2024
@@ -92,9 +92,9 @@ helm uninstall my-release
| `opensearchDashboardsYml.defaultMode` | Allow you to set the defaultMode for the opensearch_dashboards.yml mounted as configMap | |
| `dashboardAnnotations` | Allows you to configure custom annotation in the deployement of the OpenSearchDashboards container | {} |
| `serviceMonitor.enabled` | Enables the creation of a [ServiceMonitor] resource for Prometheus monitoring. Requires the Prometheus Operator to be installed in your Kubernetes cluster. | `false` |
| `serviceMonitor.portName` | Name of the port in the OpenSearch Dashboards service that exposes metrics. This should match the port name defined in your OpenSearch service configuration. Applicable only if `serviceMonitor.enabled` is set to `true`. | `metrics` |
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this mean the name of serviceMonitor.portName should be same as OpenSearch service created by the chart ? If so the value passed is portName: metrics, so is metrics is the OpenSearch service name?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. Correct. metrics is the name of the OpenSearch service which exposes the metrics.
Reference from the existing Service template:

Copy link
Collaborator

Choose a reason for hiding this comment

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

Got it thanks @VILJkid then should we use the same syntax ?
{{ .Values.service.metricsPortName | default "metrics" }}
@peterzhuamazon @TheAlgo @getsaurabh02

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good! Then creating portName won't be necessary. We can directly use the syntax to fetch the service name.

Thanks @prudhvigodithi! I'll make the necessary changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @prudhvigodithi,

The changes are implemented in the latest commits. Kindly review and let me know if it needs any further changes.

…arch servicemonitor

Signed-off-by: VILJkid <sidvjmostwanted@gmail.com>
…ch dashboards servicemonitor

Signed-off-by: VILJkid <sidvjmostwanted@gmail.com>
Signed-off-by: VILJkid <sidvjmostwanted@gmail.com>
VILJkid referenced this pull request Aug 27, 2024
* feat: Add serviceMonitor resource

Signed-off-by: Shubham Gupta <sgupta@obmondo.com>
Signed-off-by: VILJkid <sidvjmostwanted@gmail.com>

* fix: metrics path

Signed-off-by: Shubham Gupta <sgupta@obmondo.com>
Signed-off-by: VILJkid <sidvjmostwanted@gmail.com>

* (lint) : trailing newline

Signed-off-by: VILJkid <sidvjmostwanted@gmail.com>

* (update) : readme and changelog with comments

Signed-off-by: VILJkid <sidvjmostwanted@gmail.com>

* (add) : opensearch-dashboard for serviceMonitor

Signed-off-by: VILJkid <sidvjmostwanted@gmail.com>

* (chore) : bump changelog version

Signed-off-by: VILJkid <sidvjmostwanted@gmail.com>

* (chore) : bump version

Signed-off-by: VILJkid <sidvjmostwanted@gmail.com>

* (lint) : add newline

Signed-off-by: VILJkid <sidvjmostwanted@gmail.com>

* (fix) : changelog compare versions

Signed-off-by: VILJkid <sidvjmostwanted@gmail.com>

* (fix) : bump minor versions instead of patch

Signed-off-by: VILJkid <sidvjmostwanted@gmail.com>

---------

Signed-off-by: Shubham Gupta <sgupta@obmondo.com>
Signed-off-by: VILJkid <sidvjmostwanted@gmail.com>
Co-authored-by: Shubham Gupta <sgupta@obmondo.com>
Co-authored-by: VILJkid <sidvjmostwanted@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 1.x Backport to 1.x branch after merging to main first-time-contributor
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

4 participants