From cbe1b103dacaa37feeda6b6e49cab9848436906d Mon Sep 17 00:00:00 2001 From: Stephen Chen Date: Fri, 25 Oct 2024 12:50:13 -0700 Subject: [PATCH] feat: Enable Batch Scraping Configuration (#173) --- promitor-agent-scraper/README.md | 3 +++ .../templates/configmap.yaml | 18 ++++++++++++++---- promitor-agent-scraper/values.yaml | 2 ++ 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/promitor-agent-scraper/README.md b/promitor-agent-scraper/README.md index 675da8e..f28c4d4 100644 --- a/promitor-agent-scraper/README.md +++ b/promitor-agent-scraper/README.md @@ -113,6 +113,9 @@ their default values. | `azureMonitor.logging.enabled` | Indication whether or not to provide logs on the integration with Azure Monitor and its APIs | `false` | | `azureMonitor.logging.logLevel` | Minimum level of logging for Azure Monitor interactions | N/A | | `azureMonitor.integration.useAzureMonitorSdk` | Whether to use the Azure Monitor SDK for scraping; alternative is the legacy Azure Management Library | `true` +| `azureMonitor.integration.metricsBatching.enabled` | Whether to scrape metrics in batch mode | `false` +| `azureMonitor.integration.metricsBatching.maxBatchSize` | Max number of resources within a batch | `50` +| `azureMonitor.integration.metricsBatching.azureRegion` | Azure region of resource targets for batching | | `azureMonitor.integration.history.startingFromInHours` | Defines the amount of hours Promitor will use to define the starting point of the time window used for metric queries. | N/A | | `rbac.create` | If true, create & use RBAC resources | `true` | | `rbac.podSecurityPolicyEnabled` | Create pod security policy resources | `false` | diff --git a/promitor-agent-scraper/templates/configmap.yaml b/promitor-agent-scraper/templates/configmap.yaml index 436cbe7..8b0f0e7 100644 --- a/promitor-agent-scraper/templates/configmap.yaml +++ b/promitor-agent-scraper/templates/configmap.yaml @@ -69,7 +69,7 @@ data: verbosity: {{ .Values.telemetry.containerLogs.logLevel | quote }} {{- end }} defaultVerbosity: {{ .Values.telemetry.defaultLogLevel | quote }} - {{- if or .Values.azureMonitor.logging.enabled .Values.azureMonitor.integration.history.startingFromInHours .Values.azureMonitor.integration.useAzureMonitorSdk }} + {{- if or .Values.azureMonitor.logging.enabled .Values.azureMonitor.integration.history.startingFromInHours .Values.azureMonitor.integration.useAzureMonitorSdk .Values.azureMonitor.integration.metricsBatching.enabled }} azureMonitor: {{- if .Values.azureMonitor.logging.enabled }} logging: @@ -78,13 +78,23 @@ data: {{- end }} isEnabled: {{ .Values.azureMonitor.logging.enabled | quote }} {{- end }} - {{- if .Values.azureMonitor.integration.history.startingFromInHours }} + {{- if or .Values.azureMonitor.integration.history.startingFromInHours .Values.azureMonitor.integration.useAzureMonitorSdk .Values.azureMonitor.integration.metricsBatching.enabled }} integration: - useAzureMonitorSdk: {{ .Values.azureMonitor.integration.useAzureMonitorSdk | quote}} + {{- if .Values.azureMonitor.integration.metricsBatching.enabled }} + metricsBatching: + enabled: true + maxBatchSize: {{ .Values.azureMonitor.integration.metricsBatching.maxBatchSize }} + azureRegion: {{ .Values.azureMonitor.integration.metricsBatching.azureRegion }} + {{- end }} + {{- if .Values.azureMonitor.integration.useAzureMonitorSdk }} + useAzureMonitorSdk: {{ .Values.azureMonitor.integration.useAzureMonitorSdk }} + {{- end }} + {{- if .Values.azureMonitor.integration.history.startingFromInHours }} history: startingFromInHours: {{ .Values.azureMonitor.integration.history.startingFromInHours }} {{- end }} {{- end }} + {{- end }} metrics-declaration.yaml: |- version: v1 azureMetadata: @@ -99,4 +109,4 @@ data: schedule: {{ .Values.metricDefaults.scraping.schedule | quote }} metrics:{{- if .Values.metrics | len | eq 0 }} []{{- else }} {{ tpl $metrics . | indent 4 }} -{{- end }} +{{- end }} \ No newline at end of file diff --git a/promitor-agent-scraper/values.yaml b/promitor-agent-scraper/values.yaml index 8f9776e..1446231 100644 --- a/promitor-agent-scraper/values.yaml +++ b/promitor-agent-scraper/values.yaml @@ -113,6 +113,8 @@ azureMonitor: enabled: false logLevel: integration: + metricsBatching: + enabled: false history: startingFromInHours: