Add beat-exporter Prometheus metrics (#11408)

* Add beat-exporter Prometheus metrics from https://github.com/trustpilot/beat-exporter Signed-off-by: Denis Lavrushko <po4tatyt@gmail.com>

Signed-off-by: Denis Lavrushko <po4tatyt@gmail.com>

* fix DCO and bumped new version

Signed-off-by: Denis Lavrushko <po4tatyt@gmail.com>

* Remove blank lines

Signed-off-by: Denis Lavrushko <po4tatyt@gmail.com>

* add new line before EOF

Signed-off-by: Denis Lavrushko <po4tatyt@gmail.com>

* trailing spaces and newline at the end of file

Signed-off-by: Denis Lavrushko <po4tatyt@gmail.com>
This commit is contained in:
Denis
2019-02-14 13:03:38 -08:00
committed by Kubernetes Prow Robot
parent 643fa44426
commit e4ea88e88e
4 changed files with 64 additions and 2 deletions
+1 -1
View File
@@ -2,7 +2,7 @@ apiVersion: v1
description: A Helm chart to collect Kubernetes logs with filebeat
icon: https://www.elastic.co/assets/blt47799dcdcf08438d/logo-elastic-beats-lt.svg
name: filebeat
version: 1.2.0
version: 1.3.0
appVersion: 6.6.0
home: https://www.elastic.co/products/beats/filebeat
sources:
+13
View File
@@ -108,6 +108,19 @@ spec:
readOnly: true
{{- if .Values.extraVolumeMounts }}
{{ toYaml .Values.extraVolumeMounts | indent 8 }}
{{- end }}
{{- if .Values.monitoring.enabled }}
- name: {{ template "filebeat.fullname" . }}-prometheus-exporter
image: "{{ .Values.monitoring.image.repository }}:{{ .Values.monitoring.image.tag }}"
imagePullPolicy: {{ .Values.monitoring.image.pullPolicy }}
args:
{{- if .Values.monitoring.args }}
{{ toYaml .Values.monitoring.args | indent 8 }}
{{- end }}
{{- if .Values.monitoring.resources }}
resources:
{{ toYaml .Values.monitoring.resources | indent 10 }}
{{- end }}
{{- end }}
volumes:
- name: varlog
+20
View File
@@ -0,0 +1,20 @@
{{- if .Values.monitoring.enabled }}
kind: Service
apiVersion: v1
metadata:
name: {{ template "filebeat.fullname" . }}-metrics
namespace: {{ .Release.Namespace }}
labels:
app: {{ template "filebeat.name" . }}
chart: {{ template "filebeat.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
selector:
app: {{ template "filebeat.name" . }}
ports:
- name: metrics
port: {{ .Values.monitoring.exporterPort }}
targetPort: {{ .Values.monitoring.targetPort }}
protocol: TCP
{{ end }}
+30 -1
View File
@@ -44,7 +44,7 @@ config:
# When a key contains a period, use this format for setting values on the command line:
# --set config."http\.enabled"=true
http.enabled: false
http.enabled: true
http.port: 5066
# Upload index template to Elasticsearch if Logstash output is enabled
@@ -139,3 +139,32 @@ podSecurityPolicy:
# seccomp.security.alpha.kubernetes.io/allowedProfileNames: '*'
# seccomp.security.alpha.kubernetes.io/defaultProfileName: 'docker/default'
# apparmor.security.beta.kubernetes.io/defaultProfileName: 'runtime/default'
## Add Elastic beat-exporter for Prometheus
## https://github.com/trustpilot/beat-exporter
## Dont forget to enable http on config.http.enabled (exposing filebeat stats)
monitoring:
enabled: true
image:
repository: trustpilot/beat-exporter
tag: 0.1.1
pullPolicy: IfNotPresent
resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 200Mi
# requests:
# cpu: 100m
# memory: 100Mi
# pass custom args. This is equivalent of Cmd in docker
args: []
## default is ":9479". If changed, need pass argument "-web.listen-address <...>"
exporterPort: 9479
## Filebeat service port, which exposes Prometheus metrics
targetPort: 9479