feat(opensearch): add query exporter helm chart#1602
Open
joluc wants to merge 11 commits into
Open
Conversation
Signed-off-by: joluc <jonathan.schwarze@sap.com>
Signed-off-by: joluc <jonathan.schwarze@sap.com>
Signed-off-by: joluc <jonathan.schwarze@sap.com>
Signed-off-by: joluc <jonathan.schwarze@sap.com>
Signed-off-by: joluc <jonathan.schwarze@sap.com>
…y exporter Signed-off-by: joluc <jonathan.schwarze@sap.com>
…ce labels Signed-off-by: joluc <jonathan.schwarze@sap.com>
Signed-off-by: joluc <jonathan.schwarze@sap.com>
Signed-off-by: joluc <jonathan.schwarze@sap.com>
Signed-off-by: joluc <jonathan.schwarze@sap.com>
Signed-off-by: joluc <jonathan.schwarze@sap.com>
d27a03c to
752df87
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds an optional “query exporter” component to the OpenSearch Helm chart, intended to run scheduled OpenSearch queries and expose the results as Prometheus metrics for scraping.
Changes:
- Bumps the OpenSearch plugin/chart version from
0.0.59to0.0.60. - Introduces
queryExportervalues/configuration and aqueryExporter.enabledPluginDefinition option. - Adds Helm templates to deploy the query exporter (Deployment, Service, ConfigMaps) and optionally a ServiceMonitor.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| opensearch/plugindefinition.yaml | Bumps plugin/chart version and adds queryExporter.enabled option. |
| opensearch/chart/Chart.yaml | Chart version bump to 0.0.60. |
| opensearch/chart/values.yaml | Adds queryExporter configuration block (image, creds refs, queries, ServiceMonitor settings, etc.). |
| opensearch/chart/templates/_helpers.tpl | Adds helper templates for query-exporter naming/labels/selectors. |
| opensearch/chart/templates/query-exporter-config.yaml | Adds ConfigMaps for exporter config and optional query definitions. |
| opensearch/chart/templates/query-exporter-deployment.yaml | Adds Deployment for the query exporter (mounts config, certs, and optional queries). |
| opensearch/chart/templates/query-exporter-service.yaml | Adds Service exposing the metrics port. |
| opensearch/chart/templates/query-exporter-servicemonitor.yaml | Adds optional ServiceMonitor for Prometheus Operator scraping. |
| opensearch/chart/ci/test-values.yaml | Enables query exporter in CI values and provides sample queries. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| spec: | ||
| selector: | ||
| matchLabels: | ||
| {{- include "opensearch.query-exporter-selector" . | nindent 6 }} |
| {{- include "opensearch.query-exporter-labels" . | nindent 4 }} | ||
| data: | ||
| config.yaml: | | ||
| opensearch_url: https://{{ include "opensearch.logs-cluster-name" . }}:9200 |
| config.yaml: | | ||
| opensearch_url: https://{{ include "opensearch.logs-cluster-name" . }}:9200 | ||
| ca_cert_path: /certs/ca.crt | ||
| insecure: true |
Comment on lines
+117
to
+128
| {{- if .Values.queryExporter.queries }} | ||
| - name: queries | ||
| configMap: | ||
| name: {{ $name }}-queries | ||
| {{- end }} | ||
| - name: certs | ||
| secret: | ||
| secretName: opensearch-http-cert | ||
| items: | ||
| - key: ca.crt | ||
| path: ca.crt | ||
| {{- end }} |
Comment on lines
+44
to
+62
| env: | ||
| - name: {{ upper $credRef }}_USERNAME | ||
| valueFrom: | ||
| secretKeyRef: | ||
| name: {{ $credRef }}-credentials | ||
| key: username | ||
| - name: {{ upper $credRef }}_PASSWORD | ||
| valueFrom: | ||
| secretKeyRef: | ||
| name: {{ $credRef }}-credentials | ||
| key: password | ||
| {{- range $ref := (.Values.queryExporter.additionalCredentialsRefs | default list) }} | ||
| - name: {{ upper $ref }}_USERNAME | ||
| valueFrom: | ||
| secretKeyRef: | ||
| name: {{ $ref }}-credentials | ||
| key: username | ||
| - name: {{ upper $ref }}_PASSWORD | ||
| valueFrom: |
| # -- Image repository for the query exporter | ||
| repository: sap-cloud-infrastructure/opensearch-query-exporter | ||
| # -- Image tag for the query exporter | ||
| tag: latest |
Comment on lines
+4
to
+16
| {{- if .Values.queryExporter.enabled }} | ||
| {{- $name := include "opensearch.query-exporter-name" . }} | ||
| {{- $credRef := .Values.queryExporter.credentialsRef | default "logs" }} | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: {{ $name }} | ||
| namespace: {{ .Release.Namespace }} | ||
| labels: | ||
| {{- include "opensearch.query-exporter-labels" . | nindent 4 }} | ||
| spec: | ||
| replicas: {{ .Values.queryExporter.replicas | default 1 }} | ||
| selector: |
Comment on lines
+20
to
+24
| - username: "${{ upper $credRef }}_USERNAME" | ||
| password: "${{ upper $credRef }}_PASSWORD" | ||
| {{- range $ref := (.Values.queryExporter.additionalCredentialsRefs | default list) }} | ||
| - username: "${{ upper $ref }}_USERNAME" | ||
| password: "${{ upper $ref }}_PASSWORD" |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Details
Add optional query exporter component. It runs custom OpenSearch queries on a schedule, exposes results as Prometheus metrics.