Unverified Commit dd05e46f authored by alespour's avatar alespour Committed by GitHub

[telegraf] render percentiles as floats (#396)

* fix: percentiles are always floats * refactor: simplified array iteration * bump version
parent 54dfd107
apiVersion: v2
name: telegraf
version: 1.8.9
version: 1.8.10
appVersion: 1.21.1
deprecated: false
description: Telegraf is an agent written in Go for collecting, processing, aggregating, and writing metrics.
......
......@@ -207,21 +207,24 @@ app.kubernetes.io/instance: {{ .Release.Name }}
{{- range $b, $val := $value }}
{{- $i := int64 $b }}
{{- $tp := typeOf $val }}
{{- if eq $i $numOut }}
{{- if eq $tp "string" }}
{{- if eq $tp "string" }}
{{ $val | quote }}
{{- end }}
{{- if eq $tp "float64" }}
{{- end }}
{{- if eq $tp "float64" }}
{{- if eq $key "percentiles" }}
{{- $xval := float64 (int64 $val) }}
{{- if eq $val $xval }}
{{ $val | int64 }}.0
{{- else }}
{{ $val | float64 }}
{{- end }}
{{- else }}
{{ $val | int64 }}
{{- end }}
{{- else }}
{{- if eq $tp "string" }}
{{ $val | quote }},
{{- end}}
{{- if eq $tp "float64" }}
{{ $val | int64 }},
{{- end }}
{{- end }}
{{- if ne $i $numOut -}}
,
{{- end -}}
{{- end }}
]
{{- end }}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment