diff --git a/charts/tempo-distributed/Chart.yaml b/charts/tempo-distributed/Chart.yaml index 868897b1db..2208e571e5 100644 --- a/charts/tempo-distributed/Chart.yaml +++ b/charts/tempo-distributed/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: tempo-distributed description: Grafana Tempo in MicroService mode type: application -version: 1.15.4 +version: 1.16.0 appVersion: 2.5.0 engine: gotpl home: https://grafana.com/docs/tempo/latest/ diff --git a/charts/tempo-distributed/README.md b/charts/tempo-distributed/README.md index 972eeeb092..990e292a9c 100755 --- a/charts/tempo-distributed/README.md +++ b/charts/tempo-distributed/README.md @@ -1,6 +1,6 @@ # tempo-distributed -![Version: 1.15.4](https://img.shields.io/badge/Version-1.15.4-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.5.0](https://img.shields.io/badge/AppVersion-2.5.0-informational?style=flat-square) +![Version: 1.16.0](https://img.shields.io/badge/Version-1.16.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.5.0](https://img.shields.io/badge/AppVersion-2.5.0-informational?style=flat-square) Grafana Tempo in MicroService mode @@ -261,6 +261,16 @@ The memcached default args are removed and should be provided manually. The sett | cache.caches[0].roles[0] | string | `"parquet-footer"` | | | cache.caches[0].roles[1] | string | `"bloom"` | | | cache.caches[0].roles[2] | string | `"frontend-search"` | | +| compactor.autoscaling | object | `{"enabled":false,"hpa":{"behavior":{},"enabled":false,"targetCPUUtilizationPercentage":100,"targetMemoryUtilizationPercentage":null},"keda":{"enabled":false,"triggers":[]},"maxReplicas":3,"minReplicas":1}` | Autoscaling configurations | +| compactor.autoscaling.enabled | bool | `false` | Enable autoscaling for the compactor | +| compactor.autoscaling.hpa | object | `{"behavior":{},"enabled":false,"targetCPUUtilizationPercentage":100,"targetMemoryUtilizationPercentage":null}` | Autoscaling via HPA object | +| compactor.autoscaling.hpa.behavior | object | `{}` | Autoscaling behavior configuration for the compactor | +| compactor.autoscaling.hpa.targetCPUUtilizationPercentage | int | `100` | Target CPU utilisation percentage for the compactor | +| compactor.autoscaling.hpa.targetMemoryUtilizationPercentage | string | `nil` | Target memory utilisation percentage for the compactor | +| compactor.autoscaling.keda | object | `{"enabled":false,"triggers":[]}` | Autoscaling via keda/ScaledObject | +| compactor.autoscaling.keda.triggers | list | `[]` | List of autoscaling triggers for the compactor | +| compactor.autoscaling.maxReplicas | int | `3` | Maximum autoscaling replicas for the compactor | +| compactor.autoscaling.minReplicas | int | `1` | Minimum autoscaling replicas for the compactor | | compactor.config.compaction.block_retention | string | `"48h"` | Duration to keep blocks | | compactor.config.compaction.compacted_block_retention | string | `"1h"` | | | compactor.config.compaction.compaction_cycle | string | `"30s"` | The time between compaction cycles | diff --git a/charts/tempo-distributed/templates/compactor/hpa.yaml b/charts/tempo-distributed/templates/compactor/hpa.yaml new file mode 100644 index 0000000000..7ee1dc6c4c --- /dev/null +++ b/charts/tempo-distributed/templates/compactor/hpa.yaml @@ -0,0 +1,46 @@ +{{- if and .Values.compactor.autoscaling.enabled .Values.compactor.autoscaling.hpa.enabled }} +{{- $apiVersion := include "tempo.hpa.apiVersion" . -}} +apiVersion: {{ $apiVersion }} +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "tempo.resourceName" (dict "ctx" . "component" "compactor") }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "tempo.labels" (dict "ctx" . "component" "compactor") | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "tempo.resourceName" (dict "ctx" . "component" "compactor") }} + minReplicas: {{ .Values.compactor.autoscaling.minReplicas }} + maxReplicas: {{ .Values.compactor.autoscaling.maxReplicas }} + {{- with .Values.compactor.autoscaling.hpa.behavior }} + behavior: + {{- toYaml . | nindent 4 }} + {{- end }} + metrics: + {{- with .Values.compactor.autoscaling.hpa.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + {{- if (eq $apiVersion "autoscaling/v2") }} + target: + type: Utilization + averageUtilization: {{ . }} + {{- else }} + targetAverageUtilization: {{ . }} + {{- end }} + {{- end }} + {{- with .Values.compactor.autoscaling.hpa.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + {{- if (eq $apiVersion "autoscaling/v2") }} + target: + type: Utilization + averageUtilization: {{ . }} + {{- else }} + targetAverageUtilization: {{ . }} + {{- end }} + {{- end }} +{{- end }} diff --git a/charts/tempo-distributed/templates/compactor/keda-scaledObject.yaml b/charts/tempo-distributed/templates/compactor/keda-scaledObject.yaml new file mode 100644 index 0000000000..180bad5c0d --- /dev/null +++ b/charts/tempo-distributed/templates/compactor/keda-scaledObject.yaml @@ -0,0 +1,25 @@ +{{- if and .Values.compactor.autoscaling.enabled .Values.compactor.autoscaling.keda.enabled }} +apiVersion: keda.sh/v1alpha1 +kind: ScaledObject +metadata: + name: {{ include "tempo.resourceName" (dict "ctx" . "component" "compactor") }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "tempo.labels" (dict "ctx" . "component" "compactor") | nindent 4 }} +spec: + minReplicaCount: {{ .Values.compactor.autoscaling.minReplicas }} + maxReplicaCount: {{ .Values.compactor.autoscaling.maxReplicas }} + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "tempo.resourceName" (dict "ctx" . "component" "compactor") }} + triggers: + {{- range .Values.compactor.autoscaling.keda.triggers }} + - type: {{ .type | quote }} + metadata: + serverAddress: {{ .metadata.serverAddress }} + threshold: {{ .metadata.threshold | quote }} + query: | + {{- .metadata.query | nindent 8 }} + {{- end }} +{{- end }} diff --git a/charts/tempo-distributed/values.yaml b/charts/tempo-distributed/values.yaml index 6a2387b6b9..73bead113c 100755 --- a/charts/tempo-distributed/values.yaml +++ b/charts/tempo-distributed/values.yaml @@ -541,6 +541,42 @@ distributor: compactor: # -- Number of replicas for the compactor replicas: 1 + + # -- Autoscaling configurations + autoscaling: + # -- Enable autoscaling for the compactor + enabled: false + # -- Minimum autoscaling replicas for the compactor + minReplicas: 1 + # -- Maximum autoscaling replicas for the compactor + maxReplicas: 3 + # -- Autoscaling via HPA object + hpa: + enabled: false + # -- Autoscaling behavior configuration for the compactor + behavior: {} + # -- Target CPU utilisation percentage for the compactor + targetCPUUtilizationPercentage: 100 + # -- Target memory utilisation percentage for the compactor + targetMemoryUtilizationPercentage: + # -- Autoscaling via keda/ScaledObject + keda: + # requires https://keda.sh/ + enabled: false + # -- List of autoscaling triggers for the compactor + triggers: [] + # - type: prometheus + # metadata: + # serverAddress: "http://:9090" + # threshold: "250" + # query: |- + # sum by (cluster, namespace, tenant) ( + # tempodb_compaction_outstanding_blocks{container="compactor", namespace=~".*"} + # ) / + # ignoring(tenant) group_left count by (cluster, namespace)( + # tempo_build_info{container="compactor", namespace=~".*"} + # ) + # -- hostAliases to add hostAliases: [] # - ip: 1.2.3.4