Skip to content

Commit

Permalink
feat: Enable Batch Scraping Configuration (#173)
Browse files Browse the repository at this point in the history
  • Loading branch information
hkfgo authored Oct 25, 2024
1 parent 14c11c9 commit cbe1b10
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
3 changes: 3 additions & 0 deletions promitor-agent-scraper/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` |
Expand Down
18 changes: 14 additions & 4 deletions promitor-agent-scraper/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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 }}
2 changes: 2 additions & 0 deletions promitor-agent-scraper/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ azureMonitor:
enabled: false
logLevel:
integration:
metricsBatching:
enabled: false
history:
startingFromInHours:

Expand Down

0 comments on commit cbe1b10

Please sign in to comment.