From 1867ed4d5c6ce9d7bb011d4c63d684570a4143f3 Mon Sep 17 00:00:00 2001 From: Hoan Lac <96110829+hlac9x@users.noreply.github.com> Date: Fri, 5 Jul 2024 00:24:25 +0700 Subject: [PATCH] [prometheus-elasticsearch-exporter] Bump chart api version, min kubernetes version, set standard labels (#4636) * [prometheus-elasticsearch-exporter]: Prevent Duplicate Labels in ServiceMonitor Signed-off-by: Hoan Lac * [prometheus-elasticsearch-exporter]: bump chart version Signed-off-by: Hoan Lac * [prometheus-elasticsearch-exporter]: follows the new Helm Standard Labels recommendations Signed-off-by: Hoan Lac * Update charts/prometheus-elasticsearch-exporter/templates/_helpers.tpl Co-authored-by: zeritti <47476160+zeritti@users.noreply.github.com> Signed-off-by: Hoan Lac <96110829+hlac9x@users.noreply.github.com> * Update charts/prometheus-elasticsearch-exporter/templates/_helpers.tpl Co-authored-by: zeritti <47476160+zeritti@users.noreply.github.com> Signed-off-by: Hoan Lac <96110829+hlac9x@users.noreply.github.com> * Update charts/prometheus-elasticsearch-exporter/values.yaml Co-authored-by: zeritti <47476160+zeritti@users.noreply.github.com> Signed-off-by: Hoan Lac <96110829+hlac9x@users.noreply.github.com> * Update charts/prometheus-elasticsearch-exporter/values.yaml Co-authored-by: zeritti <47476160+zeritti@users.noreply.github.com> Signed-off-by: Hoan Lac <96110829+hlac9x@users.noreply.github.com> * Update charts/prometheus-elasticsearch-exporter/values.yaml Co-authored-by: zeritti <47476160+zeritti@users.noreply.github.com> Signed-off-by: Hoan Lac <96110829+hlac9x@users.noreply.github.com> * Update charts/prometheus-elasticsearch-exporter/values.yaml Co-authored-by: zeritti <47476160+zeritti@users.noreply.github.com> Signed-off-by: Hoan Lac <96110829+hlac9x@users.noreply.github.com> * Add note in README Signed-off-by: zeritti <47476160+zeritti@users.noreply.github.com> * Bump chart api version Signed-off-by: zeritti <47476160+zeritti@users.noreply.github.com> * Update NOTES Signed-off-by: zeritti <47476160+zeritti@users.noreply.github.com> * Insert commonLabels and uncomment namespace fields Signed-off-by: zeritti <47476160+zeritti@users.noreply.github.com> * Add commonLabels to pods Signed-off-by: zeritti <47476160+zeritti@users.noreply.github.com> --------- Signed-off-by: Hoan Lac Signed-off-by: Hoan Lac <96110829+hlac9x@users.noreply.github.com> Signed-off-by: zeritti <47476160+zeritti@users.noreply.github.com> Co-authored-by: zeritti <47476160+zeritti@users.noreply.github.com> --- .../Chart.yaml | 7 +- .../README.md | 66 +++++++++++-------- .../templates/NOTES.txt | 6 +- .../templates/_helpers.tpl | 23 +++++++ .../templates/cert-secret.yaml | 5 +- .../templates/deployment.yaml | 14 ++-- .../templates/podmonitor.yaml | 8 +-- .../templates/podsecuritypolicies.yaml | 5 +- .../templates/prometheusrule.yaml | 5 +- .../templates/role.yaml | 5 +- .../templates/rolebinding.yaml | 5 +- .../templates/service.yaml | 8 +-- .../templates/serviceaccount.yaml | 5 +- .../templates/servicemonitor.yaml | 8 +-- .../values.yaml | 40 ++++++----- 15 files changed, 111 insertions(+), 99 deletions(-) diff --git a/charts/prometheus-elasticsearch-exporter/Chart.yaml b/charts/prometheus-elasticsearch-exporter/Chart.yaml index ae283733e755..ae41b4353814 100644 --- a/charts/prometheus-elasticsearch-exporter/Chart.yaml +++ b/charts/prometheus-elasticsearch-exporter/Chart.yaml @@ -1,8 +1,8 @@ -apiVersion: v1 +apiVersion: v2 description: Elasticsearch stats exporter for Prometheus name: prometheus-elasticsearch-exporter -version: 5.9.0 -kubeVersion: ">=1.10.0-0" +version: 6.0.0 +kubeVersion: ">=1.19.0-0" appVersion: "v1.7.0" home: https://github.com/prometheus-community/elasticsearch_exporter sources: @@ -18,3 +18,4 @@ maintainers: email: cedric@desaintmartin.fr - name: zeritti email: rootsandtrees@posteo.de +type: application diff --git a/charts/prometheus-elasticsearch-exporter/README.md b/charts/prometheus-elasticsearch-exporter/README.md index f28a6c51ccda..d9861030e031 100644 --- a/charts/prometheus-elasticsearch-exporter/README.md +++ b/charts/prometheus-elasticsearch-exporter/README.md @@ -1,33 +1,28 @@ -# Elasticsearch Exporter +# Prometheus Elasticsearch Exporter -Prometheus exporter for various metrics about ElasticSearch, written in Go. +Prometheus exporter for various metrics about Elasticsearch, written in Go. For more information, please, see the project's [repository](https://github.com/prometheus-community/elasticsearch_exporter). -Learn more: - -This chart creates an Elasticsearch-Exporter deployment on a [Kubernetes](http://kubernetes.io) +This chart creates an Elasticsearch exporter deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager. ## Prerequisites -- Kubernetes 1.10+ +- Helm 3.7+ +- Kubernetes 1.19+ ## Get Helm Repository Info - + ```console helm repo add prometheus-community https://prometheus-community.github.io/helm-charts helm repo update ``` -_See [`helm repo`](https://helm.sh/docs/helm/helm_repo/) for command documentation._ - +_See [helm repo](https://helm.sh/docs/helm/helm_repo/) for command documentation._ + ## Install Helm Chart ```console -# Helm 3 -$ helm install [RELEASE_NAME] prometheus-community/prometheus-elasticsearch-exporter - -# Helm 2 -$ helm install --name [RELEASE_NAME] prometheus-community/prometheus-elasticsearch-exporter +helm install [RELEASE_NAME] prometheus-community/prometheus-elasticsearch-exporter ``` The command deploys Elasticsearch Exporter on the Kubernetes cluster using the default configuration. @@ -39,11 +34,7 @@ _See [helm install](https://helm.sh/docs/helm/helm_install/) for command documen ## Uninstall Helm Chart ```console -# Helm 3 -$ helm uninstall [RELEASE_NAME] - -# Helm 2 -# helm delete --purge [RELEASE_NAME] +helm uninstall [RELEASE_NAME] ``` This removes all the Kubernetes components associated with the chart and deletes the release. @@ -53,12 +44,39 @@ _See [helm uninstall](https://helm.sh/docs/helm/helm_uninstall/) for command doc ## Upgrading Helm Chart ```console -# Helm 3 or 2 -$ helm upgrade [RELEASE_NAME] [CHART] --install +helm upgrade [RELEASE_NAME] prometheus-community/prometheus-elasticsearch-exporter --install ``` _See [helm upgrade](https://helm.sh/docs/helm/helm_upgrade/) for command documentation._ +## To 6.0.0 + +In release 6.0, the chart API version has been increased to v2. From now on, the chart supports Helm 3 only. + +The minimum Kubernetes version supported by the chart has been raised to 1.19. + +Labels and selectors have been replaced following [Helm 3 label and annotation best practices](https://helmsh/docs/chart_best_practices/labels/): + +| Previous | Current | +|---------------------|------------------------------| +| app | app.kubernetes.io/name | +| chart | helm.sh/chart | +| [none] | app.kubernetes.io/version | +| heritage | app.kubernetes.io/managed-by | +| release | app.kubernetes.io/instance | + +As the change is affecting immutable selector labels, the deployment must be deleted before upgrading the release, e.g.: + +```console +kubectl delete deploy -l app=prometheus-elasticsearch-exporter +``` + +Once the resources have been deleted, you can upgrade the release: + +```console +helm upgrade -i RELEASE_NAME prometheus-community/prometheus-elasticsearch-exporter +``` + ### To 5.0.0 `securityContext` has been renamed to `podSecurityContext` and `securityContext.enabled` has no effect anymore. To mirror the behaviour of `securityContext.enabled=false` of 4.x unset `podSecurityContext`. @@ -100,11 +118,7 @@ See [Customizing the Chart Before Installing](https://helm.sh/docs/intro/using_h To see all configurable options with detailed comments, visit the chart's [values.yaml](./values.yaml), or run these configuration commands: ```console -# Helm 2 -$ helm inspect values prometheus-community/prometheus-elasticsearch-exporter - -# Helm 3 -$ helm show values prometheus-community/prometheus-elasticsearch-exporter +helm show values prometheus-community/prometheus-elasticsearch-exporter ``` > **Tip**: You can use the default [values.yaml](values.yaml) diff --git a/charts/prometheus-elasticsearch-exporter/templates/NOTES.txt b/charts/prometheus-elasticsearch-exporter/templates/NOTES.txt index 4311f10466c7..cb59bd764ee9 100644 --- a/charts/prometheus-elasticsearch-exporter/templates/NOTES.txt +++ b/charts/prometheus-elasticsearch-exporter/templates/NOTES.txt @@ -9,7 +9,9 @@ export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "elasticsearch-exporter.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') echo http://$SERVICE_IP:{{ .Values.service.httpPort }}{{ .Values.web.path }} {{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "elasticsearch-exporter.fullname" . }}" -o jsonpath="{.items[0].metadata.name}") - echo "Visit http://127.0.0.1:{{ .Values.service.httpPort }}{{ .Values.web.path }} to use your application" + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ template + "elasticsearch-exporter.name" . }}" -o jsonpath="{.items[0].metadata.name}") + kubectl port-forward $POD_NAME {{ .Values.service.httpPort }}:{{ .Values.service.httpPort }} --namespace {{ .Release.Namespace }} + echo "Visit http://127.0.0.1:{{ .Values.service.httpPort }}{{ .Values.web.path }} to use your application" {{- end }} diff --git a/charts/prometheus-elasticsearch-exporter/templates/_helpers.tpl b/charts/prometheus-elasticsearch-exporter/templates/_helpers.tpl index 70302c726c89..83e3f375c8a4 100644 --- a/charts/prometheus-elasticsearch-exporter/templates/_helpers.tpl +++ b/charts/prometheus-elasticsearch-exporter/templates/_helpers.tpl @@ -95,3 +95,26 @@ Return the correct (overridden global) image registry. {{- printf "%s" .Values.image.repository -}} {{- end }} {{- end -}} + +{{/* +Common labels +*/}} +{{- define "elasticsearch-exporter.labels" -}} +helm.sh/chart: {{ include "elasticsearch-exporter.chart" . }} +{{ include "elasticsearch-exporter.selectorLabels" . }} +{{- with .Chart.AppVersion }} +app.kubernetes.io/version: {{ . | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- if .Values.commonLabels }} +{{ toYaml .Values.commonLabels }} +{{- end }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "elasticsearch-exporter.selectorLabels" -}} +app.kubernetes.io/name: {{ include "elasticsearch-exporter.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} diff --git a/charts/prometheus-elasticsearch-exporter/templates/cert-secret.yaml b/charts/prometheus-elasticsearch-exporter/templates/cert-secret.yaml index c662e2dfa01a..a2391bc935bb 100644 --- a/charts/prometheus-elasticsearch-exporter/templates/cert-secret.yaml +++ b/charts/prometheus-elasticsearch-exporter/templates/cert-secret.yaml @@ -4,10 +4,7 @@ kind: Secret metadata: name: {{ template "elasticsearch-exporter.fullname" . }}-cert labels: - chart: {{ template "elasticsearch-exporter.chart" . }} - app: {{ template "elasticsearch-exporter.name" . }} - release: "{{ .Release.Name }}" - heritage: "{{ .Release.Service }}" + {{- include "elasticsearch-exporter.labels" . | nindent 4 }} type: Opaque data: ca.pem: {{ .Values.es.ssl.ca.pem | b64enc }} diff --git a/charts/prometheus-elasticsearch-exporter/templates/deployment.yaml b/charts/prometheus-elasticsearch-exporter/templates/deployment.yaml index ba13fdbc04d9..88c9124b1d8e 100644 --- a/charts/prometheus-elasticsearch-exporter/templates/deployment.yaml +++ b/charts/prometheus-elasticsearch-exporter/templates/deployment.yaml @@ -3,10 +3,7 @@ kind: Deployment metadata: name: {{ template "elasticsearch-exporter.fullname" . }} labels: - chart: {{ template "elasticsearch-exporter.chart" . }} - app: {{ template "elasticsearch-exporter.name" . }} - release: "{{ .Release.Name }}" - heritage: "{{ .Release.Service }}" + {{- include "elasticsearch-exporter.labels" . | nindent 4 }} {{- with .Values.deployment.labels }} {{- toYaml . | nindent 4 }} {{- end }} @@ -19,8 +16,7 @@ spec: revisionHistoryLimit: {{ .Values.revisionHistoryLimit }} selector: matchLabels: - app: {{ template "elasticsearch-exporter.name" . }} - release: "{{ .Release.Name }}" + {{- include "elasticsearch-exporter.selectorLabels" . | nindent 6 }} strategy: rollingUpdate: maxSurge: 1 @@ -29,8 +25,10 @@ spec: template: metadata: labels: - app: {{ template "elasticsearch-exporter.name" . }} - release: "{{ .Release.Name }}" + {{- include "elasticsearch-exporter.selectorLabels" . | nindent 8 }} + {{- with .Values.commonLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} {{- with .Values.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} diff --git a/charts/prometheus-elasticsearch-exporter/templates/podmonitor.yaml b/charts/prometheus-elasticsearch-exporter/templates/podmonitor.yaml index 666f5d32f620..9c0d1ca7b293 100644 --- a/charts/prometheus-elasticsearch-exporter/templates/podmonitor.yaml +++ b/charts/prometheus-elasticsearch-exporter/templates/podmonitor.yaml @@ -9,10 +9,7 @@ metadata: namespace: {{ .Values.podMonitor.namespace }} {{- end }} labels: - chart: {{ template "elasticsearch-exporter.chart" . }} - app: {{ template "elasticsearch-exporter.name" . }} - release: "{{ .Release.Name }}" - heritage: "{{ .Release.Service }}" + {{- include "elasticsearch-exporter.labels" . | nindent 4 }} {{- if .Values.podMonitor.labels }} {{- toYaml .Values.podMonitor.labels | nindent 4 }} {{- end }} @@ -45,6 +42,5 @@ spec: {{- end }} selector: matchLabels: - app: {{ template "elasticsearch-exporter.name" . }} - release: "{{ .Release.Name }}" + {{- include "elasticsearch-exporter.selectorLabels" . | nindent 6 }} {{- end }} diff --git a/charts/prometheus-elasticsearch-exporter/templates/podsecuritypolicies.yaml b/charts/prometheus-elasticsearch-exporter/templates/podsecuritypolicies.yaml index c94d123cc1e9..ea1aed6c80cc 100644 --- a/charts/prometheus-elasticsearch-exporter/templates/podsecuritypolicies.yaml +++ b/charts/prometheus-elasticsearch-exporter/templates/podsecuritypolicies.yaml @@ -4,10 +4,7 @@ kind: PodSecurityPolicy metadata: name: {{ template "elasticsearch-exporter.fullname" . }} labels: - chart: {{ template "elasticsearch-exporter.chart" . }} - app: {{ template "elasticsearch-exporter.name" . }} - release: "{{ .Release.Name }}" - heritage: "{{ .Release.Service }}" + {{- include "elasticsearch-exporter.labels" . | nindent 4 }} spec: privileged: false allowPrivilegeEscalation: false diff --git a/charts/prometheus-elasticsearch-exporter/templates/prometheusrule.yaml b/charts/prometheus-elasticsearch-exporter/templates/prometheusrule.yaml index 59179013a03d..c55ee1275d5a 100644 --- a/charts/prometheus-elasticsearch-exporter/templates/prometheusrule.yaml +++ b/charts/prometheus-elasticsearch-exporter/templates/prometheusrule.yaml @@ -8,10 +8,7 @@ metadata: namespace: {{ .Values.prometheusRule.namespace }} {{- end }} labels: - chart: {{ template "elasticsearch-exporter.chart" . }} - app: {{ template "elasticsearch-exporter.name" . }} - release: "{{ .Release.Name }}" - heritage: "{{ .Release.Service }}" + {{- include "elasticsearch-exporter.labels" . | nindent 4 }} {{- if .Values.prometheusRule.labels }} {{- toYaml .Values.prometheusRule.labels | nindent 4 }} {{- end }} diff --git a/charts/prometheus-elasticsearch-exporter/templates/role.yaml b/charts/prometheus-elasticsearch-exporter/templates/role.yaml index 9bf97d1bfac9..6fb8dcb57388 100644 --- a/charts/prometheus-elasticsearch-exporter/templates/role.yaml +++ b/charts/prometheus-elasticsearch-exporter/templates/role.yaml @@ -4,10 +4,7 @@ kind: Role metadata: name: {{ template "elasticsearch-exporter.fullname" . }} labels: - chart: {{ template "elasticsearch-exporter.chart" . }} - app: {{ template "elasticsearch-exporter.name" . }} - release: "{{ .Release.Name }}" - heritage: "{{ .Release.Service }}" + {{- include "elasticsearch-exporter.labels" . | nindent 4 }} rules: - apiGroups: ['extensions'] resources: ['podsecuritypolicies'] diff --git a/charts/prometheus-elasticsearch-exporter/templates/rolebinding.yaml b/charts/prometheus-elasticsearch-exporter/templates/rolebinding.yaml index 06f81e869328..67a3b4a50aa1 100644 --- a/charts/prometheus-elasticsearch-exporter/templates/rolebinding.yaml +++ b/charts/prometheus-elasticsearch-exporter/templates/rolebinding.yaml @@ -4,10 +4,7 @@ kind: RoleBinding metadata: name: {{ template "elasticsearch-exporter.fullname" . }} labels: - chart: {{ template "elasticsearch-exporter.chart" . }} - app: {{ template "elasticsearch-exporter.name" . }} - release: "{{ .Release.Name }}" - heritage: "{{ .Release.Service }}" + {{- include "elasticsearch-exporter.labels" . | nindent 4 }} roleRef: apiGroup: rbac.authorization.k8s.io kind: Role diff --git a/charts/prometheus-elasticsearch-exporter/templates/service.yaml b/charts/prometheus-elasticsearch-exporter/templates/service.yaml index a3420a999392..25ffcd022d82 100644 --- a/charts/prometheus-elasticsearch-exporter/templates/service.yaml +++ b/charts/prometheus-elasticsearch-exporter/templates/service.yaml @@ -4,10 +4,7 @@ apiVersion: v1 metadata: name: {{ template "elasticsearch-exporter.fullname" . }} labels: - chart: {{ template "elasticsearch-exporter.chart" . }} - app: {{ template "elasticsearch-exporter.name" . }} - release: "{{ .Release.Name }}" - heritage: "{{ .Release.Service }}" + {{- include "elasticsearch-exporter.labels" . | nindent 4 }} {{- if .Values.service.labels }} {{ toYaml .Values.service.labels | indent 4 }} {{- end }} @@ -22,6 +19,5 @@ spec: port: {{ .Values.service.httpPort }} protocol: TCP selector: - app: {{ template "elasticsearch-exporter.name" . }} - release: "{{ .Release.Name }}" + {{- include "elasticsearch-exporter.selectorLabels" . | nindent 4 }} {{- end }} diff --git a/charts/prometheus-elasticsearch-exporter/templates/serviceaccount.yaml b/charts/prometheus-elasticsearch-exporter/templates/serviceaccount.yaml index 4e03001caf1c..5b2411ebeaaa 100644 --- a/charts/prometheus-elasticsearch-exporter/templates/serviceaccount.yaml +++ b/charts/prometheus-elasticsearch-exporter/templates/serviceaccount.yaml @@ -4,10 +4,7 @@ kind: ServiceAccount metadata: name: {{ template "elasticsearch-exporter.fullname" . }} labels: - chart: {{ template "elasticsearch-exporter.chart" . }} - app: {{ template "elasticsearch-exporter.name" . }} - release: "{{ .Release.Name }}" - heritage: "{{ .Release.Service }}" + {{- include "elasticsearch-exporter.labels" . | nindent 4 }} {{- with .Values.serviceAccount.annotations }} annotations: {{- toYaml . | nindent 4 }} diff --git a/charts/prometheus-elasticsearch-exporter/templates/servicemonitor.yaml b/charts/prometheus-elasticsearch-exporter/templates/servicemonitor.yaml index b7d4e206be98..8039f401a015 100644 --- a/charts/prometheus-elasticsearch-exporter/templates/servicemonitor.yaml +++ b/charts/prometheus-elasticsearch-exporter/templates/servicemonitor.yaml @@ -8,10 +8,7 @@ metadata: namespace: {{ .Values.serviceMonitor.namespace }} {{- end }} labels: - chart: {{ template "elasticsearch-exporter.chart" . }} - app: {{ template "elasticsearch-exporter.name" . }} - release: "{{ .Release.Name }}" - heritage: "{{ .Release.Service }}" + {{- include "elasticsearch-exporter.labels" . | nindent 4 }} {{- if .Values.serviceMonitor.labels }} {{- toYaml .Values.serviceMonitor.labels | nindent 4 }} {{- end }} @@ -36,8 +33,7 @@ spec: jobLabel: {{ default .Release.Name .Values.serviceMonitor.jobLabel }} selector: matchLabels: - app: {{ template "elasticsearch-exporter.name" . }} - release: "{{ .Release.Name }}" + {{- include "elasticsearch-exporter.selectorLabels" . | nindent 6 }} namespaceSelector: matchNames: - {{ .Release.Namespace }} diff --git a/charts/prometheus-elasticsearch-exporter/values.yaml b/charts/prometheus-elasticsearch-exporter/values.yaml index b8d75cb40123..a61407b36a6f 100644 --- a/charts/prometheus-elasticsearch-exporter/values.yaml +++ b/charts/prometheus-elasticsearch-exporter/values.yaml @@ -2,22 +2,22 @@ ## This allows to set the same values for the imagePullSecrets, obviating the need ## to set the same values for each chart (and image) separately global: -## Allow either an array of {name: pullSecret} maps (k8s-style), or an array of strings (more common helm-style). -## imagePullSecrets: -## - name: pullSecret1 -## - name: pullSecret2 -## -## or -## -## imagePullSecrets: -## - pullSecret1 -## - pullSecret2 -## -## or a templated value -## -## imagePullSecrets: -## - "{{ .Values.templateValue }}" -## templateValue: test + ## Allow either an array of {name: pullSecret} maps (k8s-style), or an array of strings (more common helm-style). + ## imagePullSecrets: + ## - name: pullSecret1 + ## - name: pullSecret2 + ## + ## or + ## + ## imagePullSecrets: + ## - pullSecret1 + ## - pullSecret2 + ## + ## or a templated value + ## + ## imagePullSecrets: + ## - "{{ .Values.templateValue }}" + ## templateValue: test imagePullSecrets: [] imageRegistry: "" @@ -89,6 +89,9 @@ podAnnotations: {} podLabels: {} +## Labels to attach to all resources +commonLabels: {} + affinity: {} initContainers: [] @@ -266,8 +269,9 @@ serviceMonitor: ## enabled: false apiVersion: "monitoring.coreos.com/v1" - # namespace: monitoring + namespace: "" labels: {} + # release: kube-prometheus-stack interval: 10s jobLabel: "" scrapeTimeout: 10s @@ -298,7 +302,7 @@ prometheusRule: ## ## The rules will be processed as Helm template, allowing to set variables in them. enabled: false - # namespace: monitoring + namespace: "" labels: {} rules: [] # - record: elasticsearch_filesystem_data_used_percent