Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
influxdb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
influxdb
Commits
17baa48c
Unverified
Commit
17baa48c
authored
Jan 20, 2022
by
alespour
Committed by
GitHub
Jan 20, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix probes and internal metrics configuration (#408)
* fix: enable probes when metrics or output health is enabled * fix: add option to control internal metrics
parent
99f6a75c
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
45 additions
and
16 deletions
+45
-16
Chart.yaml
charts/telegraf/Chart.yaml
+2
-2
default-values.yaml
charts/telegraf/ci/default-values.yaml
+1
-0
metrics-health-enabled-values.yaml
charts/telegraf/ci/metrics-health-enabled-values.yaml
+3
-0
_helpers.tpl
charts/telegraf/templates/_helpers.tpl
+19
-0
configmap.yaml
charts/telegraf/templates/configmap.yaml
+5
-3
deployment.yaml
charts/telegraf/templates/deployment.yaml
+8
-8
service.yaml
charts/telegraf/templates/service.yaml
+4
-3
values.yaml
charts/telegraf/values.yaml
+3
-0
No files found.
charts/telegraf/Chart.yaml
View file @
17baa48c
apiVersion
:
v2
name
:
telegraf
version
:
1.8.1
0
appVersion
:
1.21.
1
version
:
1.8.1
1
appVersion
:
1.21.
2
deprecated
:
false
description
:
Telegraf is an agent written in Go for collecting, processing, aggregating, and writing metrics.
keywords
:
...
...
charts/telegraf/ci/default-values.yaml
0 → 100644
View file @
17baa48c
# Default values only, no overrides
charts/telegraf/ci/metrics-health-enabled-values.yaml
0 → 100644
View file @
17baa48c
metrics
:
health
:
enabled
:
true
charts/telegraf/templates/_helpers.tpl
View file @
17baa48c
...
...
@@ -532,3 +532,22 @@ Create the name of the service account to use
{{ default "default" .Values.serviceAccount.name }}
{{- end -}}
{{- end -}}
{
{
/*
Get
health
configuration
*/
}
}
{{- define "telegraf.health" -}}
{{- if .Values.metrics.health.enabled -}}
{{- .Values.metrics.health | toYaml -}}
{{- else -}}
{{- $health := dict -}}
{{- range $objectKey, $objectValue := .Values.config.outputs }}
{{- range $key, $value := . -}}
{{- if eq $key "health" -}}
{{- $health = $value -}}
{{- end -}}
{{- end -}}
{{- end }}
{{- $health | toYaml -}}
{{- end -}}
{{- end -}}
charts/telegraf/templates/configmap.yaml
View file @
17baa48c
...
...
@@ -13,14 +13,16 @@ data:
{{ template "outputs" .Values.config.outputs }}
{{- if .Values.metrics.health.enabled }}
[[outputs.health]]
service_address = "
http://:8888
"
service_address = "
{{ .Values.metrics.health.service_address }}
"
namepass = ["internal_write"]
[[outputs.health.compares]]
field = "buffer_size"
lt = {{ .Values.metrics.health.threshold
}}
lt = {{ .Values.metrics.health.threshold
| int64 }}.0
[[outputs.health.contains]]
field = "buffer_size"
{{- end }}
{{ template "inputs" .Values.config.inputs -}}
{{- if .Values.metrics.internal.enabled }}
[[inputs.internal]]
collect_memstats = {{ .Values.metrics.collect_memstats }}
collect_memstats = {{ or .Values.metrics.internal.collect_memstats (.Values.metrics.collect_memstats | default false) }}
{{- end }}
charts/telegraf/templates/deployment.yaml
View file @
17baa48c
...
...
@@ -77,20 +77,20 @@ spec:
{{
end
}}
{{
end
}}
{{
end
}}
{{
- range $objectKey
,
$objectValue
:
= .Values.config.outputs
}}
{{
- range $key
,
$value
:
= . -
}}
{{
- $tp
:
= typeOf $value -
}}
{{
- if eq $key "health"
}}
{{
- $health
:
= include "telegraf.health" . | fromYaml
}}
{{
- with $health
}}
startupProbe
:
httpGet
:
path
:
/
port
:
{{
trimPrefix "http
:
//
:
"
.service_address
|
int64
}}
livenessProbe:
httpGet:
path:
/
port
:
{{
trimPrefix "http
:
//
:
"
$value
.service_address
|
int64
}}
port:
{{
trimPrefix
"
http
:
//
:
"
.service_address
|
int64
}}
readinessProbe:
httpGet:
path:
/
port:
{{
trimPrefix
"
http
:
//
:
"
$value.service_address
|
int64
}}
{{-
end
}}
{{-
end
}}
port:
{{
trimPrefix
"
http
:
//
:
"
.service_address
|
int64
}}
{{-
end
}}
{{-
if
.Values.imagePullSecrets
}}
imagePullSecrets:
...
...
charts/telegraf/templates/service.yaml
View file @
17baa48c
...
...
@@ -12,9 +12,10 @@ metadata:
spec
:
type
:
{{
.Values.service.type
}}
ports
:
{{
- if .Values.metrics.health.enabled
}}
-
port
:
8888
targetPort
:
8888
{{
- $health
:
= include "telegraf.health" . | fromYaml
}}
{{
- with $health
}}
-
port
:
{{
trimPrefix "http
:
//
:
"
.service_address
|
int64
}}
targetPort:
{{
trimPrefix
"
http
:
//
:
"
.service_address
|
int64
}}
name:
"
health"
{{
- end
}}
{{
- range $objectKey
,
$objectValue
:
= .Values.config.inputs
}}
...
...
charts/telegraf/values.yaml
View file @
17baa48c
...
...
@@ -170,7 +170,10 @@ config:
metrics
:
health
:
enabled
:
false
service_address
:
"
http://:8888"
threshold
:
5000.0
internal
:
enabled
:
true
collect_memstats
:
false
# Lifecycle hooks
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment