mirror of
https://github.com/bitnami/charts.git
synced 2026-03-13 14:57:24 +08:00
Add Prometheus metrics support
This commit is contained in:
@@ -69,3 +69,36 @@ data:
|
||||
flush_interval 10s
|
||||
</buffer>
|
||||
</match>
|
||||
{{- if .Values.metrics.enabled }}
|
||||
metrics.conf: |
|
||||
# Prometheus Exporter Plugin
|
||||
# input plugin that exports metrics
|
||||
<source>
|
||||
@type prometheus
|
||||
port {{ .Values.metrics.service.port }}
|
||||
</source>
|
||||
|
||||
# input plugin that collects metrics from MonitorAgent
|
||||
<source>
|
||||
@type prometheus_monitor
|
||||
<labels>
|
||||
host ${hostname}
|
||||
</labels>
|
||||
</source>
|
||||
|
||||
# input plugin that collects metrics for output plugin
|
||||
<source>
|
||||
@type prometheus_output_monitor
|
||||
<labels>
|
||||
host ${hostname}
|
||||
</labels>
|
||||
</source>
|
||||
|
||||
# input plugin that collects metrics for in_tail plugin
|
||||
<source>
|
||||
@type prometheus_tail_monitor
|
||||
<labels>
|
||||
host ${hostname}
|
||||
</labels>
|
||||
</source>
|
||||
{{- end }}
|
||||
|
||||
@@ -49,6 +49,11 @@ spec:
|
||||
- name: http
|
||||
containerPort: 9880
|
||||
protocol: TCP
|
||||
{{- if .Values.metrics.enabled }}
|
||||
- name: metrics
|
||||
containerPort: {{ .Values.metrics.service.port }}
|
||||
protocol: TCP
|
||||
{{- end }}
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /fluentd.healthcheck?json=%7B%22ping%22%3A+%22pong%22%7D
|
||||
|
||||
@@ -5,11 +5,17 @@ metadata:
|
||||
labels:
|
||||
{{- include "fluentd.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: forwarder
|
||||
{{- if or (and .Values.metrics.enabled .Values.metrics.service.annotations) .Values.service.annotations }}
|
||||
annotations:
|
||||
{{- if and .Values.metrics.enabled .Values.metrics.service.annotations }}
|
||||
{{- tpl (toYaml .Values.metrics.service.annotations) $ | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if and .Values.service.annotations }}
|
||||
{{- tpl (toYaml .Values.service.annotations) $ | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
spec:
|
||||
type: {{ .Values.service.type }}
|
||||
{{- if .Values.service.nodePort }}
|
||||
nodePort: {{ .Values.service.nodePort }}
|
||||
{{- end }}
|
||||
{{- if eq .Values.service.type "LoadBalancer" }} {{- if .Values.service.loadBalancerIP }}
|
||||
loadBalancerIP: {{ .Values.service.loadBalancerIP }}
|
||||
{{- end }} {{- end }}
|
||||
@@ -17,8 +23,15 @@ spec:
|
||||
ports:
|
||||
- name: http
|
||||
targetPort: http
|
||||
protocol: TCP
|
||||
port: {{ .Values.service.port }}
|
||||
{{- if .Values.service.nodePort }}
|
||||
nodePort: {{ .Values.service.nodePort }}
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.enabled }}
|
||||
- name: metrics
|
||||
port: {{ .Values.metrics.service.port }}
|
||||
targetPort: metrics
|
||||
{{- end }}
|
||||
selector:
|
||||
app.kubernetes.io/name: {{ include "fluentd.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
|
||||
@@ -211,11 +211,22 @@ serviceAccount:
|
||||
# name:
|
||||
|
||||
## Role Based Access
|
||||
## Ref: https://kubernetes.io/docs/admin/authorization/rbac/
|
||||
## ref: https://kubernetes.io/docs/admin/authorization/rbac/
|
||||
##
|
||||
rbac:
|
||||
create: true
|
||||
|
||||
## Prometheus metrics
|
||||
## ref: https://github.com/fluent/fluent-plugin-prometheus/blob/master/README.md
|
||||
##
|
||||
metrics:
|
||||
enabled: false
|
||||
service:
|
||||
port: 24231
|
||||
annotations:
|
||||
prometheus.io/scrape: "true"
|
||||
prometheus.io/port: "24231"
|
||||
prometheus.io/path: "/metrics"
|
||||
|
||||
service:
|
||||
type: ClusterIP
|
||||
|
||||
Reference in New Issue
Block a user