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(chart/opensearch): metricsPort and plugins usage info in values.yaml #593

Conversation

eyenx
Copy link
Contributor

@eyenx eyenx commented Sep 10, 2024

Description

Trying to figure out how to expose metrics, it was obvious that there is the need of installing an additional plugin to be able to expose prometheus metrics over the serviceMonitor. Also the default port exposing the metrics is 9200 and not 9600.

This fixes the default metricsPort and adds a comment about the plugin to be used in values.yaml

Issues Resolved

#590

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

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@peterzhuamazon
Copy link
Member

Note: We are in the review of an older PR now so will come back to this a little later.

@eyenx
Copy link
Contributor Author

eyenx commented Oct 18, 2024

@peterzhuamazon any update here? Thanks!

@eyenx
Copy link
Contributor Author

eyenx commented Nov 5, 2024

@peterzhuamazon any update here?

Copy link
Member

@peterzhuamazon peterzhuamazon left a comment

Choose a reason for hiding this comment

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

Hi @eyenx sorry for the delay we are in a few releases, and just completed 2.18.0 yesterday evening.

metricsPort: 9600
metricsPort: 9200
Copy link
Member

Choose a reason for hiding this comment

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

The metrics port here is for Performance Analyzer which utilizes the 9600 port
69daf97

Copy link
Member

Choose a reason for hiding this comment

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

I wonder if we need to add a new var for other metrics?

Copy link
Member

Choose a reason for hiding this comment

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

@eyenx if we want to use this metricsPort (The metrics port (for Performance Analyzer) that Kubernetes will use for the service) then it should be 9600 right ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will check tomorrow.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Does the performance Analazer actually expose metrics in prometheus format? If not I would still go for this, ut add 9600 as separate port. How can I enale the performance Analyzer plugin?

Copy link
Member

Choose a reason for hiding this comment

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

I think when you enable PA you would need to query through 9600
https://opensearch.org/docs/latest/monitoring-your-cluster/pa/index/#example-api-query-and-response

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As mentioned above, I tried curling 9600, but no response. So this is why I went for 9200 at the end. Did anyone ever got this working?

Copy link
Member

Choose a reason for hiding this comment

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

You would need to separately start the PA process I think.
Not an expert on that tho.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, after having looked at it together with @cfi2017 we came to the conclusion that the metricsPort has nothing to do with the prometheus metrics but rather is to be used in conjuction with Performance Analayzer.

Therefore I'm changing this PR to make sure the ServiceMonitor is deployed to grab metrics from 9200 (httpPort) and keeping the comment about how to install opensearch-prometheus-exporter.

We tried this locally and it just works.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please another review, but waiting for #594 before bumping the version here. @peterzhuamazon @prudhvigodithi

@eyenx eyenx force-pushed the fix/chart-opensearch/serviceMonitor-right-port-and-docs branch from 76017aa to f3409a4 Compare December 13, 2024 15:13
@eyenx
Copy link
Contributor Author

eyenx commented Dec 13, 2024

I would also be very happy to backport this to version 1.x

@peterzhuamazon
Copy link
Member

peterzhuamazon commented Dec 13, 2024

Hi @eyenx , most of the team are on vacation soon and sorry for the delay due to recent 1.3.20 release.

I am happy to put this PR on my calendar for next Monday seems like a simple change, but #594 I am afraid I need another maintainer for co-review.

I will try to @ maintainers again but most likely that will be delayed until they are back from holiday. Thanks.

@peterzhuamazon
Copy link
Member

Also seems like the changelog part needs some updates.

Thanks.

@eyenx
Copy link
Contributor Author

eyenx commented Dec 13, 2024

Yes I can add this but it's highly dependant what version will be merged first

@muhammeddanish
Copy link

Thanks team for working on this!!

I have added below code to my values:

metricsPort: 9200
service:
  metricsPortName: http
plugins:
  enabled: true
  installList:
    - https://github.com/Aiven-Open/prometheus-exporter-plugin-for-opensearch/releases/download/1.3.19.0/prometheus-exporter-1.3.19.0.zip

However, looks like password is needed for authentication and seen below error in prometheus target:

server returned HTTP status 401 Unauthorized

How we can bypass the authentication for scraping the metrics alone?

Best,
Danish

@cfi2017
Copy link

cfi2017 commented Dec 16, 2024

Thanks team for working on this!!

I have added below code to my values:

metricsPort: 9200
service:
  metricsPortName: http
plugins:
  enabled: true
  installList:
    - https://github.com/Aiven-Open/prometheus-exporter-plugin-for-opensearch/releases/download/1.3.19.0/prometheus-exporter-1.3.19.0.zip

However, looks like password is needed for authentication and seen below error in prometheus target:

server returned HTTP status 401 Unauthorized

How we can bypass the authentication for scraping the metrics alone?

Best, Danish

The plugin operates on the same port as the main application, so it's protected by the security plugin.
The easiest way here would be to add basic auth to the operator, as suggested in #594

@@ -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: 2.27.1
version: 2.28.1
Copy link
Member

Choose a reason for hiding this comment

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

2.28.0 should be fine I will get it merged today.

Signed-off-by: Peter Zhu <[email protected]>
@peterzhuamazon
Copy link
Member

Hi @eyenx I have updated your PR to have 2.28.0 version for the charts version.

Let me know what you think.

I will go ahead and merge it by the end of day. Thanks.

@peterzhuamazon peterzhuamazon merged commit 61d7961 into opensearch-project:main Dec 17, 2024
8 checks passed
@peterzhuamazon
Copy link
Member

Thanks @eyenx would you mind backport to 1.3?

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

5 participants