mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
add service monitors
This commit is contained in:
parent
d59446cbb7
commit
6f501a9f0e
|
@ -17,6 +17,12 @@ spec:
|
||||||
port: {{ .Values.filer.grpcPort }}
|
port: {{ .Values.filer.grpcPort }}
|
||||||
targetPort: {{ .Values.filer.grpcPort }}
|
targetPort: {{ .Values.filer.grpcPort }}
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
|
{{- if .Values.filer.metricsPort }}
|
||||||
|
- name: "swfs-filer-metrics"
|
||||||
|
port: {{ .Values.filer.metricsPort }}
|
||||||
|
targetPort: {{ .Values.filer.metricsPort }}
|
||||||
|
protocol: TCP
|
||||||
|
{{- end }}
|
||||||
selector:
|
selector:
|
||||||
app: {{ template "seaweedfs.name" . }}
|
app: {{ template "seaweedfs.name" . }}
|
||||||
component: filer
|
component: filer
|
18
k8s/seaweedfs/templates/filer-servicemonitor.yaml
Normal file
18
k8s/seaweedfs/templates/filer-servicemonitor.yaml
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
{{- if .Values.filer.metricsPort }}
|
||||||
|
apiVersion: monitoring.coreos.com/v1
|
||||||
|
kind: ServiceMonitor
|
||||||
|
metadata:
|
||||||
|
name: {{ template "seaweedfs.name" . }}-filer
|
||||||
|
namespace: {{ .Release.Namespace }}
|
||||||
|
labels:
|
||||||
|
app: {{ template "seaweedfs.name" . }}
|
||||||
|
component: filer
|
||||||
|
spec:
|
||||||
|
endpoints:
|
||||||
|
- interval: 30s
|
||||||
|
port: swfs-filer-metrics
|
||||||
|
scrapeTimeout: 5s
|
||||||
|
selector:
|
||||||
|
app: {{ template "seaweedfs.name" . }}
|
||||||
|
component: filer
|
||||||
|
{{- end }}
|
|
@ -99,6 +99,9 @@ spec:
|
||||||
{{- end }}
|
{{- end }}
|
||||||
filer \
|
filer \
|
||||||
-port={{ .Values.filer.port }} \
|
-port={{ .Values.filer.port }} \
|
||||||
|
{{- if .Values.filer.metricsPort }}
|
||||||
|
-metricsPort {{ .Values.filer.metricsPort }} \
|
||||||
|
{{- end }}}
|
||||||
{{- if .Values.filer.redirectOnRead }}
|
{{- if .Values.filer.redirectOnRead }}
|
||||||
-redirectOnRead \
|
-redirectOnRead \
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
|
@ -71,6 +71,9 @@ spec:
|
||||||
{{- end }}
|
{{- end }}
|
||||||
s3 \
|
s3 \
|
||||||
-port={{ .Values.s3.port }} \
|
-port={{ .Values.s3.port }} \
|
||||||
|
{{- if .Values.s3.metricsPort }}
|
||||||
|
-metricsPort {{ .Values.s3.metricsPort }} \
|
||||||
|
{{- end }}}
|
||||||
{{- if .Values.global.enableSecurity }}
|
{{- if .Values.global.enableSecurity }}
|
||||||
-cert.file=/usr/local/share/ca-certificates/client/tls.crt \
|
-cert.file=/usr/local/share/ca-certificates/client/tls.crt \
|
||||||
-key.file=/usr/local/share/ca-certificates/client/tls.key \
|
-key.file=/usr/local/share/ca-certificates/client/tls.key \
|
||||||
|
|
|
@ -12,6 +12,12 @@ spec:
|
||||||
port: {{ .Values.s3.port }}
|
port: {{ .Values.s3.port }}
|
||||||
targetPort: {{ .Values.s3.port }}
|
targetPort: {{ .Values.s3.port }}
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
|
{{- if .Values.s3.metricsPort }}
|
||||||
|
- name: "swfs-s3-metrics"
|
||||||
|
port: {{ .Values.filer.s3 }}
|
||||||
|
targetPort: {{ .Values.s3.metricsPort }}
|
||||||
|
protocol: TCP
|
||||||
|
{{- end }}}
|
||||||
selector:
|
selector:
|
||||||
app: {{ template "seaweedfs.name" . }}
|
app: {{ template "seaweedfs.name" . }}
|
||||||
component: s3
|
component: s3
|
18
k8s/seaweedfs/templates/s3-servicemonitor.yaml
Normal file
18
k8s/seaweedfs/templates/s3-servicemonitor.yaml
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
{{- if .Values.s3.metricsPort }}
|
||||||
|
apiVersion: monitoring.coreos.com/v1
|
||||||
|
kind: ServiceMonitor
|
||||||
|
metadata:
|
||||||
|
name: {{ template "seaweedfs.name" . }}-s3
|
||||||
|
namespace: {{ .Release.Namespace }}
|
||||||
|
labels:
|
||||||
|
app: {{ template "seaweedfs.name" . }}
|
||||||
|
component: s3
|
||||||
|
spec:
|
||||||
|
endpoints:
|
||||||
|
- interval: 30s
|
||||||
|
port: swfs-s3-metrics
|
||||||
|
scrapeTimeout: 5s
|
||||||
|
selector:
|
||||||
|
app: {{ template "seaweedfs.name" . }}
|
||||||
|
component: s3
|
||||||
|
{{- end }}}
|
|
@ -17,6 +17,12 @@ spec:
|
||||||
port: {{ .Values.volume.grpcPort }}
|
port: {{ .Values.volume.grpcPort }}
|
||||||
targetPort: {{ .Values.volume.grpcPort }}
|
targetPort: {{ .Values.volume.grpcPort }}
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
selector:
|
{{- if .Values.volume.metricsPort }}
|
||||||
|
- name: "swfs-volume-metrics"
|
||||||
|
port: {{ .Values.volume.metricsPort }}
|
||||||
|
targetPort: {{ .Values.volume.metricsPort }}
|
||||||
|
protocol: TCP
|
||||||
|
{{- end }}}
|
||||||
|
selector:
|
||||||
app: {{ template "seaweedfs.name" . }}
|
app: {{ template "seaweedfs.name" . }}
|
||||||
component: volume
|
component: volume
|
18
k8s/seaweedfs/templates/volume-servicemonitor.yaml
Normal file
18
k8s/seaweedfs/templates/volume-servicemonitor.yaml
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
{{- if .Values.volume.metricsPort }}
|
||||||
|
apiVersion: monitoring.coreos.com/v1
|
||||||
|
kind: ServiceMonitor
|
||||||
|
metadata:
|
||||||
|
name: {{ template "seaweedfs.name" . }}-volume
|
||||||
|
namespace: {{ .Release.Namespace }}
|
||||||
|
labels:
|
||||||
|
app: {{ template "seaweedfs.name" . }}
|
||||||
|
component: volume
|
||||||
|
spec:
|
||||||
|
endpoints:
|
||||||
|
- interval: 30s
|
||||||
|
port: swfs-volume-metrics
|
||||||
|
scrapeTimeout: 5s
|
||||||
|
selector:
|
||||||
|
app: {{ template "seaweedfs.name" . }}
|
||||||
|
component: volume
|
||||||
|
{{- end }}}
|
|
@ -76,6 +76,9 @@ spec:
|
||||||
{{- end }}
|
{{- end }}
|
||||||
volume \
|
volume \
|
||||||
-port={{ .Values.volume.port }} \
|
-port={{ .Values.volume.port }} \
|
||||||
|
{{- if .Values.volume.metricsPort }}
|
||||||
|
-metricsPort {{ .Values.volume.metricsPort }} \
|
||||||
|
{{- end }}}
|
||||||
-dir={{ .Values.volume.dir }} \
|
-dir={{ .Values.volume.dir }} \
|
||||||
-max={{ .Values.volume.maxVolumes }} \
|
-max={{ .Values.volume.maxVolumes }} \
|
||||||
{{- if .Values.volume.rack }}
|
{{- if .Values.volume.rack }}
|
||||||
|
|
|
@ -121,6 +121,7 @@ volume:
|
||||||
restartPolicy: null
|
restartPolicy: null
|
||||||
port: 8080
|
port: 8080
|
||||||
grpcPort: 18080
|
grpcPort: 18080
|
||||||
|
metricsPort: 9327
|
||||||
ipBind: "0.0.0.0"
|
ipBind: "0.0.0.0"
|
||||||
replicas: 1
|
replicas: 1
|
||||||
loggingOverrideLevel: null
|
loggingOverrideLevel: null
|
||||||
|
@ -209,6 +210,7 @@ filer:
|
||||||
replicas: 1
|
replicas: 1
|
||||||
port: 8888
|
port: 8888
|
||||||
grpcPort: 18888
|
grpcPort: 18888
|
||||||
|
metricsPort: 9327
|
||||||
loggingOverrideLevel: null
|
loggingOverrideLevel: null
|
||||||
# replication type is XYZ:
|
# replication type is XYZ:
|
||||||
# X number of replica in other data centers
|
# X number of replica in other data centers
|
||||||
|
@ -313,6 +315,7 @@ s3:
|
||||||
restartPolicy: null
|
restartPolicy: null
|
||||||
replicas: 1
|
replicas: 1
|
||||||
port: 8333
|
port: 8333
|
||||||
|
metricsPort: 9327
|
||||||
loggingOverrideLevel: null
|
loggingOverrideLevel: null
|
||||||
|
|
||||||
# Suffix of the host name, {bucket}.{domainName}
|
# Suffix of the host name, {bucket}.{domainName}
|
||||||
|
|
|
@ -1891,7 +1891,7 @@
|
||||||
"steppedLine": false,
|
"steppedLine": false,
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"expr": "go_memstats_alloc_bytes{namespace=~\"$namespace\", endpoint=\"sw-filer-exporter\"}",
|
"expr": "go_memstats_alloc_bytes{namespace=~\"$namespace\", endpoint=\"swfs-filer-metrics\"}",
|
||||||
"format": "time_series",
|
"format": "time_series",
|
||||||
"hide": false,
|
"hide": false,
|
||||||
"interval": "",
|
"interval": "",
|
||||||
|
@ -1900,7 +1900,7 @@
|
||||||
"refId": "B"
|
"refId": "B"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"expr": "rate(go_memstats_alloc_bytes_total{namespace=~\"$namespace\", endpoint=\"sw-.*-exporter\"}[30s])",
|
"expr": "rate(go_memstats_alloc_bytes_total{namespace=~\"$namespace\", endpoint=\"swfs-.*-metrics\"}[30s])",
|
||||||
"format": "time_series",
|
"format": "time_series",
|
||||||
"hide": false,
|
"hide": false,
|
||||||
"interval": "",
|
"interval": "",
|
||||||
|
@ -1909,7 +1909,7 @@
|
||||||
"refId": "A"
|
"refId": "A"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"expr": "go_memstats_stack_inuse_bytes{namespace=~\"$namespace\", endpoint=\"sw-filer-exporter\"}",
|
"expr": "go_memstats_stack_inuse_bytes{namespace=~\"$namespace\", endpoint=\"swfs-filer-metrics\"}",
|
||||||
"format": "time_series",
|
"format": "time_series",
|
||||||
"hide": true,
|
"hide": true,
|
||||||
"interval": "",
|
"interval": "",
|
||||||
|
@ -1918,7 +1918,7 @@
|
||||||
"refId": "C"
|
"refId": "C"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"expr": "go_memstats_heap_inuse_bytes{namespace=~\"$namespace\", endpoint=\"sw-filer-exporter\"}",
|
"expr": "go_memstats_heap_inuse_bytes{namespace=~\"$namespace\", endpoint=\"swfs-filer-metrics\"}",
|
||||||
"format": "time_series",
|
"format": "time_series",
|
||||||
"hide": true,
|
"hide": true,
|
||||||
"interval": "",
|
"interval": "",
|
||||||
|
@ -2019,7 +2019,7 @@
|
||||||
"steppedLine": false,
|
"steppedLine": false,
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"expr": "go_gc_duration_seconds{namespace=~\"$namespace\", endpoint=\"sw-filer-exporter\"}",
|
"expr": "go_gc_duration_seconds{namespace=~\"$namespace\", endpoint=\"swfs-filer-metrics\"}",
|
||||||
"format": "time_series",
|
"format": "time_series",
|
||||||
"interval": "",
|
"interval": "",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
|
@ -2119,7 +2119,7 @@
|
||||||
"steppedLine": false,
|
"steppedLine": false,
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"expr": "go_goroutines{namespace=~\"$namespace\", endpoint=\"sw-filer-exporter\"}",
|
"expr": "go_goroutines{namespace=~\"$namespace\", endpoint=\"swfs-filer-metrics\"}",
|
||||||
"format": "time_series",
|
"format": "time_series",
|
||||||
"interval": "",
|
"interval": "",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
|
@ -2203,7 +2203,7 @@
|
||||||
"value": "s3"
|
"value": "s3"
|
||||||
},
|
},
|
||||||
"datasource": "$DS_PROMETHEUS",
|
"datasource": "$DS_PROMETHEUS",
|
||||||
"definition": "label_values({endpoint=\"sw-filer-exporter\"}, namespace)",
|
"definition": "label_values({endpoint=\"swfs-filer-metrics\"}, namespace)",
|
||||||
"hide": 0,
|
"hide": 0,
|
||||||
"includeAll": false,
|
"includeAll": false,
|
||||||
"label": "namespace",
|
"label": "namespace",
|
||||||
|
@ -2216,7 +2216,7 @@
|
||||||
"value": "s3"
|
"value": "s3"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"query": "label_values({endpoint=\"sw-filer-exporter\"}, namespace)",
|
"query": "label_values({endpoint=\"swfs-filer-metrics\"}, namespace)",
|
||||||
"refresh": 0,
|
"refresh": 0,
|
||||||
"regex": "",
|
"regex": "",
|
||||||
"skipUrlSync": false,
|
"skipUrlSync": false,
|
||||||
|
|
Loading…
Reference in a new issue