From 3a4c96a8e8334ffc0e94cc1319474569da625423 Mon Sep 17 00:00:00 2001 From: Jimi Dodd-o Date: Thu, 24 Oct 2024 15:36:39 -0400 Subject: [PATCH] Chore/pagination settings prefect exporter (#404) * Pagination settings * Update pagination docs for the helm chart * Need context if pagination is disabled as it is enabled by default --- charts/prometheus-prefect-exporter/README.md | 1 + .../templates/deployment.yaml | 10 ++++++++++ .../values.schema.json | 17 +++++++++++++++++ charts/prometheus-prefect-exporter/values.yaml | 4 ++++ 4 files changed, 32 insertions(+) diff --git a/charts/prometheus-prefect-exporter/README.md b/charts/prometheus-prefect-exporter/README.md index ae9aac92..9b3b6862 100644 --- a/charts/prometheus-prefect-exporter/README.md +++ b/charts/prometheus-prefect-exporter/README.md @@ -71,6 +71,7 @@ Shoutout to @ialejandro for the original work on this chart! | livenessProbe | bool | `false` | Enable livenessProbe | | nameOverride | string | `""` | String to partially override common.names.fullname template (will maintain the release name) | | nodeSelector | object | `{}` | Node labels for pod assignment | +| pagination | object | `{"enabled":true,"limit":200}` | Pagination settings. If enabled, the exporter will paginate the API requests to Prefect Server which uses more resources. Remember to increase the resources for the exporter if enabled. | | podAnnotations | object | `{}` | Pod annotations | | podDisruptionBudget | object | `{}` | Limits the number of Pods of a replicated application that are down simultaneously from voluntary disruptions | | podSecurityContext | object | `{}` | To specify security settings for a Pod | diff --git a/charts/prometheus-prefect-exporter/templates/deployment.yaml b/charts/prometheus-prefect-exporter/templates/deployment.yaml index 89ea5b76..faee5a32 100644 --- a/charts/prometheus-prefect-exporter/templates/deployment.yaml +++ b/charts/prometheus-prefect-exporter/templates/deployment.yaml @@ -68,6 +68,16 @@ spec: - name: PREFECT_CSRF_ENABLED value: "True" {{- end }} + {{- if .Values.pagination.enabled }} + - name: PAGINATION_LIMIT + value: {{ .Values.pagination.limit | quote }} + - name: PAGINATION_ENABLED + value: "True" + {{- end }} + {{- if not .Values.pagination.enabled }} + - name: PAGINATION_ENABLED + value: "False" + {{- end }} {{- if .Values.env }} {{- range $key, $value := .Values.env }} - name: {{ $key | upper }} diff --git a/charts/prometheus-prefect-exporter/values.schema.json b/charts/prometheus-prefect-exporter/values.schema.json index 93cc2960..13d33506 100644 --- a/charts/prometheus-prefect-exporter/values.schema.json +++ b/charts/prometheus-prefect-exporter/values.schema.json @@ -82,6 +82,23 @@ "title": "CSRF Auth", "description": "Enable CSRF auth" }, + "pagination": { + "type": "object", + "title": "Pagination", + "description": "Pagination settings", + "properties": { + "enabled": { + "type": "boolean", + "title": "Enabled", + "description": "Enable pagination" + }, + "limit": { + "type": "integer", + "title": "Limit", + "description": "Pagination limit" + } + } + }, "env": { "type": "object", "title": "Environment Variables", diff --git a/charts/prometheus-prefect-exporter/values.yaml b/charts/prometheus-prefect-exporter/values.yaml index a96d6d69..61f28eea 100644 --- a/charts/prometheus-prefect-exporter/values.yaml +++ b/charts/prometheus-prefect-exporter/values.yaml @@ -35,6 +35,10 @@ prefectApiUrl: http://prefect-server.prefect.svc.cluster.local:4200/api # -- Enable CSRF authentication (Only set to true if Prefect Server has CSRF enabled) csrfAuth: false +# -- Pagination settings. If enabled, the exporter will paginate the API requests to Prefect Server which uses more resources. Remember to increase the resources for the exporter if enabled. +pagination: + enabled: true + limit: 200 # -- Environment variables to configure application env: {} # Plain vars