sidekiq-prometheus-exporter 0.1.10 → 0.1.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/FUNDING.yml +12 -0
- data/.github/workflows/ci.yaml +76 -0
- data/.gitignore +3 -1
- data/.rubocop.yml +28 -28
- data/Appraisals +17 -4
- data/README.md +120 -37
- data/Rakefile +76 -0
- data/docker/Dockerfile +24 -0
- data/docker/README.md +60 -0
- data/docker/config.ru +40 -0
- data/examples/docker-compose.yml +2 -2
- data/examples/screenshot.png +0 -0
- data/examples/{sidekiq.json → sidekiq-dashboard.grafana-6.json} +10 -52
- data/examples/sidekiq-dashboard.grafana-7.json +845 -0
- data/gemfiles/{sidekiq_3.3.1.gemfile → sidekiq_3.3.1.Gemfile} +2 -1
- data/gemfiles/sidekiq_3.3.1.Gemfile.lock +124 -0
- data/gemfiles/{sidekiq_3.x.gemfile → sidekiq_3.x.Gemfile} +2 -1
- data/gemfiles/{sidekiq_3.x.gemfile.lock → sidekiq_3.x.Gemfile.lock} +47 -46
- data/gemfiles/{sidekiq_4.x.gemfile → sidekiq_4.x.Gemfile} +1 -1
- data/gemfiles/{sidekiq_4.x.gemfile.lock → sidekiq_4.x.Gemfile.lock} +38 -38
- data/gemfiles/{sidekiq_5.x.gemfile → sidekiq_5.x.Gemfile} +1 -1
- data/gemfiles/{sidekiq_5.x.gemfile.lock → sidekiq_5.x.Gemfile.lock} +41 -40
- data/gemfiles/sidekiq_6.x.Gemfile +8 -0
- data/gemfiles/sidekiq_6.x.Gemfile.lock +97 -0
- data/gemfiles/sidekiq_latest.Gemfile +9 -0
- data/gemfiles/sidekiq_latest.Gemfile.lock +113 -0
- data/helm/sidekiq-prometheus-exporter/.helmignore +22 -0
- data/helm/sidekiq-prometheus-exporter/Chart.yaml +6 -0
- data/helm/sidekiq-prometheus-exporter/README.md +87 -0
- data/helm/sidekiq-prometheus-exporter/templates/NOTES.txt +15 -0
- data/helm/sidekiq-prometheus-exporter/templates/_helpers.tpl +109 -0
- data/helm/sidekiq-prometheus-exporter/templates/clusterrole.yaml +20 -0
- data/helm/sidekiq-prometheus-exporter/templates/clusterrolebinding.yaml +17 -0
- data/helm/sidekiq-prometheus-exporter/templates/deployment.yaml +62 -0
- data/helm/sidekiq-prometheus-exporter/templates/service.yaml +17 -0
- data/helm/sidekiq-prometheus-exporter/templates/serviceaccount.yaml +9 -0
- data/helm/sidekiq-prometheus-exporter/templates/servicemonitor.yaml +26 -0
- data/helm/sidekiq-prometheus-exporter/values.yaml +134 -0
- data/lib/sidekiq/prometheus/exporter.rb +12 -1
- data/lib/sidekiq/prometheus/exporter/exporters.rb +4 -1
- data/lib/sidekiq/prometheus/exporter/standard.rb +1 -1
- data/lib/sidekiq/prometheus/exporter/version.rb +1 -1
- data/sidekiq-prometheus-exporter.gemspec +3 -3
- metadata +43 -23
- data/.travis.yml +0 -23
- data/gemfiles/sidekiq_3.3.1.gemfile.lock +0 -138
@@ -0,0 +1,15 @@
|
|
1
|
+
Try out an exporter metrics:
|
2
|
+
{{- if contains "NodePort" .Values.service.type }}
|
3
|
+
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "sidekiq-prometheus-exporter.fullname" . }})
|
4
|
+
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
|
5
|
+
echo "Run the following command: curl http://$NODE_IP:$NODE_PORT/metrics"
|
6
|
+
{{- else if contains "LoadBalancer" .Values.service.type }}
|
7
|
+
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
|
8
|
+
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "sidekiq-prometheus-exporter.fullname" . }}'
|
9
|
+
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "sidekiq-prometheus-exporter.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
|
10
|
+
echo "Run the following command: curl http://$SERVICE_IP:{{ .Values.service.port }}/metrics"
|
11
|
+
{{- else if contains "ClusterIP" .Values.service.type }}
|
12
|
+
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "sidekiq-prometheus-exporter.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
|
13
|
+
kubectl port-forward $POD_NAME 9292:{{ .Values.containerPort }}
|
14
|
+
echo "Run the following command: curl http://127.0.0.1:9292/metrics"
|
15
|
+
{{- end }}
|
@@ -0,0 +1,109 @@
|
|
1
|
+
{{/* vim: set filetype=mustache: */}}
|
2
|
+
{{/*
|
3
|
+
Expand the name of the chart.
|
4
|
+
*/}}
|
5
|
+
{{- define "sidekiq-prometheus-exporter.name" -}}
|
6
|
+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
|
7
|
+
{{- end -}}
|
8
|
+
|
9
|
+
{{/*
|
10
|
+
Expand the name of the docker image.
|
11
|
+
*/}}
|
12
|
+
{{- define "sidekiq-prometheus-exporter.image" -}}
|
13
|
+
{{- $registryName := .Values.image.registry -}}
|
14
|
+
{{- $repositoryName := .Values.image.repository -}}
|
15
|
+
{{- $tag := .Values.image.tag | toString -}}
|
16
|
+
{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}}
|
17
|
+
{{- end -}}
|
18
|
+
|
19
|
+
{{/*
|
20
|
+
Create a default fully qualified app name.
|
21
|
+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
22
|
+
If release name contains chart name it will be used as a full name.
|
23
|
+
*/}}
|
24
|
+
{{- define "sidekiq-prometheus-exporter.fullname" -}}
|
25
|
+
{{- if .Values.fullnameOverride -}}
|
26
|
+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
|
27
|
+
{{- else -}}
|
28
|
+
{{- $name := default .Chart.Name .Values.nameOverride -}}
|
29
|
+
{{- if contains $name .Release.Name -}}
|
30
|
+
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
|
31
|
+
{{- else -}}
|
32
|
+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
|
33
|
+
{{- end -}}
|
34
|
+
{{- end -}}
|
35
|
+
{{- end -}}
|
36
|
+
|
37
|
+
{{/*
|
38
|
+
Create chart name and version as used by the chart label.
|
39
|
+
*/}}
|
40
|
+
{{- define "sidekiq-prometheus-exporter.chart" -}}
|
41
|
+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
|
42
|
+
{{- end -}}
|
43
|
+
|
44
|
+
{{/*
|
45
|
+
Create the name of the service account to use.
|
46
|
+
*/}}
|
47
|
+
{{- define "sidekiq-prometheus-exporter.serviceAccountName" -}}
|
48
|
+
{{- if .Values.serviceAccount.create -}}
|
49
|
+
{{ default (include "sidekiq-prometheus-exporter.fullname" .) .Values.serviceAccount.name }}
|
50
|
+
{{- else -}}
|
51
|
+
{{ default "default" .Values.serviceAccount.name }}
|
52
|
+
{{- end -}}
|
53
|
+
{{- end -}}
|
54
|
+
|
55
|
+
{{/*
|
56
|
+
Create pod service account name.
|
57
|
+
*/}}
|
58
|
+
{{- define "sidekiq-prometheus-exporter.podServiceAccountName" -}}
|
59
|
+
{{- if and .Values.serviceAccount .Values.serviceAccount.create -}}
|
60
|
+
serviceAccountName: {{ include "sidekiq-prometheus-exporter.serviceAccountName" . }}
|
61
|
+
{{- end -}}
|
62
|
+
{{- end -}}
|
63
|
+
|
64
|
+
{{/*
|
65
|
+
Create pod image pull secrets.
|
66
|
+
*/}}
|
67
|
+
{{- define "sidekiq-prometheus-exporter.podImagePullSecrets" -}}
|
68
|
+
{{- if .Values.image.pullSecrets -}}
|
69
|
+
imagePullSecrets:
|
70
|
+
{{- range .Values.image.pullSecrets }}
|
71
|
+
- name: {{ . }}
|
72
|
+
{{- end }}
|
73
|
+
{{- end -}}
|
74
|
+
{{- end -}}
|
75
|
+
|
76
|
+
{{/*
|
77
|
+
Create container environment variables.
|
78
|
+
*/}}
|
79
|
+
{{- define "sidekiq-prometheus-exporter.env" -}}
|
80
|
+
{{- if .Values.envFrom -}}
|
81
|
+
envFrom:
|
82
|
+
{{ if eq (default "configMapRef" .Values.envFrom.type) "secretRef" -}}
|
83
|
+
- secretRef:
|
84
|
+
name: {{ .Values.envFrom.name }}
|
85
|
+
{{- else -}}
|
86
|
+
- configMapRef:
|
87
|
+
name: {{ .Values.envFrom.name }}
|
88
|
+
{{- end -}}
|
89
|
+
{{- else if .Values.env -}}
|
90
|
+
env:
|
91
|
+
{{- range $name, $value := .Values.env }}
|
92
|
+
- name: {{ $name }}
|
93
|
+
value: {{ $value | quote }}
|
94
|
+
{{- end }}
|
95
|
+
{{- end -}}
|
96
|
+
{{- end -}}
|
97
|
+
|
98
|
+
{{/*
|
99
|
+
Expand common labels.
|
100
|
+
*/}}
|
101
|
+
{{- define "sidekiq-prometheus-exporter.labels" -}}
|
102
|
+
app.kubernetes.io/name: {{ include "sidekiq-prometheus-exporter.name" . }}
|
103
|
+
helm.sh/chart: {{ include "sidekiq-prometheus-exporter.chart" . }}
|
104
|
+
app.kubernetes.io/instance: {{ .Release.Name }}
|
105
|
+
{{- if .Chart.AppVersion }}
|
106
|
+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
107
|
+
{{- end }}
|
108
|
+
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
109
|
+
{{- end -}}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
{{- if and .Values.rbac.create }}
|
2
|
+
---
|
3
|
+
apiVersion: rbac.authorization.k8s.io/v1
|
4
|
+
kind: ClusterRole
|
5
|
+
metadata:
|
6
|
+
name: {{ template "sidekiq-prometheus-exporter.fullname" . }}
|
7
|
+
labels:
|
8
|
+
{{- include "sidekiq-prometheus-exporter.labels" . | nindent 4 }}
|
9
|
+
rules:
|
10
|
+
- apiGroups: [""]
|
11
|
+
resources:
|
12
|
+
{{- if eq (default "configMapRef" .Values.envFrom.type) "secretRef" }}
|
13
|
+
- "secrets"
|
14
|
+
{{- else }}
|
15
|
+
- "configmap"
|
16
|
+
{{- end }}
|
17
|
+
resourceNames:
|
18
|
+
- {{ .Values.envFrom.name | quote }}
|
19
|
+
verbs: ["get"]
|
20
|
+
{{- end }}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
{{- if and .Values.rbac.create }}
|
2
|
+
---
|
3
|
+
apiVersion: rbac.authorization.k8s.io/v1
|
4
|
+
kind: ClusterRoleBinding
|
5
|
+
metadata:
|
6
|
+
name: {{ template "sidekiq-prometheus-exporter.fullname" . }}
|
7
|
+
labels:
|
8
|
+
{{- include "sidekiq-prometheus-exporter.labels" . | nindent 4 }}
|
9
|
+
subjects:
|
10
|
+
- kind: ServiceAccount
|
11
|
+
name: {{ include "sidekiq-prometheus-exporter.serviceAccountName" . }}
|
12
|
+
namespace: {{ .Release.Namespace }}
|
13
|
+
roleRef:
|
14
|
+
kind: ClusterRole
|
15
|
+
name: {{ template "sidekiq-prometheus-exporter.fullname" . }}
|
16
|
+
apiGroup: rbac.authorization.k8s.io
|
17
|
+
{{- end }}
|
@@ -0,0 +1,62 @@
|
|
1
|
+
---
|
2
|
+
apiVersion: apps/v1
|
3
|
+
kind: Deployment
|
4
|
+
metadata:
|
5
|
+
name: {{ include "sidekiq-prometheus-exporter.fullname" . }}
|
6
|
+
labels:
|
7
|
+
{{- include "sidekiq-prometheus-exporter.labels" . | nindent 4 }}
|
8
|
+
spec:
|
9
|
+
replicas: 1
|
10
|
+
selector:
|
11
|
+
matchLabels:
|
12
|
+
app.kubernetes.io/name: {{ include "sidekiq-prometheus-exporter.name" . }}
|
13
|
+
app.kubernetes.io/instance: {{ .Release.Name }}
|
14
|
+
template:
|
15
|
+
metadata:
|
16
|
+
labels:
|
17
|
+
app.kubernetes.io/name: {{ include "sidekiq-prometheus-exporter.name" . }}
|
18
|
+
app.kubernetes.io/instance: {{ .Release.Name }}
|
19
|
+
{{- with .Values.podAnnotations }}
|
20
|
+
annotations:
|
21
|
+
{{- toYaml . | nindent 8 }}
|
22
|
+
{{- end }}
|
23
|
+
spec:
|
24
|
+
containers:
|
25
|
+
- name: {{ .Chart.Name }}
|
26
|
+
image: {{ include "sidekiq-prometheus-exporter.image" . }}
|
27
|
+
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
28
|
+
ports:
|
29
|
+
- name: metrics
|
30
|
+
containerPort: {{ .Values.containerPort }}
|
31
|
+
protocol: TCP
|
32
|
+
{{- with .Values.resources }}
|
33
|
+
resources:
|
34
|
+
{{- toYaml . | nindent 12 }}
|
35
|
+
{{- end }}
|
36
|
+
livenessProbe:
|
37
|
+
tcpSocket:
|
38
|
+
port: metrics
|
39
|
+
{{- toYaml .Values.livenessProbe | nindent 12 }}
|
40
|
+
readinessProbe:
|
41
|
+
tcpSocket:
|
42
|
+
port: metrics
|
43
|
+
{{- toYaml .Values.readinessProbe | nindent 12 }}
|
44
|
+
{{- include "sidekiq-prometheus-exporter.env" . | nindent 10 }}
|
45
|
+
{{- with .Values.nodeSelector }}
|
46
|
+
nodeSelector:
|
47
|
+
{{- toYaml . | nindent 8 }}
|
48
|
+
{{- end }}
|
49
|
+
{{- with .Values.affinity }}
|
50
|
+
affinity:
|
51
|
+
{{- toYaml . | nindent 8 }}
|
52
|
+
{{- end }}
|
53
|
+
{{- with .Values.tolerations }}
|
54
|
+
tolerations:
|
55
|
+
{{- toYaml . | nindent 8 }}
|
56
|
+
{{- end }}
|
57
|
+
{{- with .Values.securityContext }}
|
58
|
+
securityContext:
|
59
|
+
{{- toYaml . | nindent 8 }}
|
60
|
+
{{- end }}
|
61
|
+
{{- include "sidekiq-prometheus-exporter.podServiceAccountName" . | nindent 6 }}
|
62
|
+
{{- include "sidekiq-prometheus-exporter.podImagePullSecrets" . | nindent 6 }}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
---
|
2
|
+
apiVersion: v1
|
3
|
+
kind: Service
|
4
|
+
metadata:
|
5
|
+
name: {{ include "sidekiq-prometheus-exporter.fullname" . }}
|
6
|
+
labels:
|
7
|
+
{{- include "sidekiq-prometheus-exporter.labels" . | nindent 4 }}
|
8
|
+
spec:
|
9
|
+
type: {{ .Values.service.type }}
|
10
|
+
ports:
|
11
|
+
- port: {{ .Values.service.port }}
|
12
|
+
targetPort: metrics
|
13
|
+
protocol: TCP
|
14
|
+
name: metrics
|
15
|
+
selector:
|
16
|
+
app.kubernetes.io/name: {{ include "sidekiq-prometheus-exporter.name" . }}
|
17
|
+
app.kubernetes.io/instance: {{ .Release.Name }}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
{{- if .Values.serviceMonitor.enabled }}
|
2
|
+
---
|
3
|
+
apiVersion: monitoring.coreos.com/v1
|
4
|
+
kind: ServiceMonitor
|
5
|
+
metadata:
|
6
|
+
name: {{ template "sidekiq-prometheus-exporter.fullname" . }}
|
7
|
+
namespace: {{ .Release.Namespace | quote }}
|
8
|
+
labels:
|
9
|
+
{{- include "sidekiq-prometheus-exporter.labels" . | nindent 4 }}
|
10
|
+
{{- with .Values.serviceMonitor.labels }}
|
11
|
+
{{- toYaml . | nindent 4 }}
|
12
|
+
{{- end }}
|
13
|
+
spec:
|
14
|
+
jobLabel: {{ template "sidekiq-prometheus-exporter.fullname" . }}
|
15
|
+
selector:
|
16
|
+
matchLabels:
|
17
|
+
{{- include "sidekiq-prometheus-exporter.labels" . | nindent 6 }}
|
18
|
+
namespaceSelector:
|
19
|
+
matchNames:
|
20
|
+
- {{ .Release.Namespace | quote }}
|
21
|
+
endpoints:
|
22
|
+
- port: metrics
|
23
|
+
path: {{ .Values.serviceMonitor.path }}
|
24
|
+
interval: {{ .Values.serviceMonitor.interval }}
|
25
|
+
scrapeTimeout: {{ .Values.serviceMonitor.scrapeTimeout }}
|
26
|
+
{{- end }}
|
@@ -0,0 +1,134 @@
|
|
1
|
+
---
|
2
|
+
## Default values for sidekiq-prometheus-exporter.
|
3
|
+
## This is a YAML-formatted file.
|
4
|
+
## Declare variables to be passed into your templates.
|
5
|
+
|
6
|
+
## Official docker image version
|
7
|
+
## ref: https://hub.docker.com/r/strech/sidekiq-prometheus-exporter/tags/
|
8
|
+
##
|
9
|
+
image:
|
10
|
+
registry: docker.io
|
11
|
+
repository: strech/sidekiq-prometheus-exporter
|
12
|
+
tag: 0.1.15
|
13
|
+
## Specify a imagePullPolicy
|
14
|
+
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
|
15
|
+
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
|
16
|
+
##
|
17
|
+
pullPolicy: IfNotPresent
|
18
|
+
## Optionally specify an array of imagePullSecrets.
|
19
|
+
## Secrets must be manually created in the namespace.
|
20
|
+
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
|
21
|
+
##
|
22
|
+
# pullSecrets:
|
23
|
+
# - myRegistryKeySecretName
|
24
|
+
|
25
|
+
## String to partially override Values.fullname template (will maintain the release name)
|
26
|
+
##
|
27
|
+
# nameOverride:
|
28
|
+
|
29
|
+
## String to fully override Values.fullname template
|
30
|
+
##
|
31
|
+
# fullnameOverride:
|
32
|
+
|
33
|
+
## Metrics exporter resource requests and limits
|
34
|
+
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
|
35
|
+
##
|
36
|
+
# resources:
|
37
|
+
# limits:
|
38
|
+
# cpu: 100m
|
39
|
+
# memory: 128Mi
|
40
|
+
# requests:
|
41
|
+
# cpu: 100m
|
42
|
+
# memory: 128Mi
|
43
|
+
|
44
|
+
## Metrics exporter selectors and tolerations for pod assignment
|
45
|
+
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector
|
46
|
+
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#taints-and-tolerations-beta-feature
|
47
|
+
##
|
48
|
+
# nodeSelector:
|
49
|
+
# tolerations:
|
50
|
+
|
51
|
+
## Metrics exporter pod/node affinity/anti-affinity
|
52
|
+
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
|
53
|
+
##
|
54
|
+
# affinity:
|
55
|
+
|
56
|
+
## Metrics exporter liveness and readiness probes
|
57
|
+
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/
|
58
|
+
##
|
59
|
+
livenessProbe:
|
60
|
+
initialDelaySeconds: 5
|
61
|
+
periodSeconds: 5
|
62
|
+
timeoutSeconds: 5
|
63
|
+
successThreshold: 1
|
64
|
+
failureThreshold: 3
|
65
|
+
readinessProbe:
|
66
|
+
initialDelaySeconds: 5
|
67
|
+
periodSeconds: 5
|
68
|
+
timeoutSeconds: 5
|
69
|
+
successThreshold: 1
|
70
|
+
failureThreshold: 3
|
71
|
+
|
72
|
+
## Metrics exporter container port
|
73
|
+
##
|
74
|
+
containerPort: 9292
|
75
|
+
|
76
|
+
## Metrics exporter container Environment Variables
|
77
|
+
## ref: https://github.com/Strech/sidekiq-prometheus-exporter/tree/master/docker#supported-envs
|
78
|
+
##
|
79
|
+
# env:
|
80
|
+
# REDIS_HOST: "localhost"
|
81
|
+
# REDIS_PORT: 6379
|
82
|
+
# REDIS_URL: "..."
|
83
|
+
# REDIS_PASSWORD: "..."
|
84
|
+
# REDIS_DB_NUMBER: "0"
|
85
|
+
# REDIS_NAMESPACE: "..."
|
86
|
+
# REDIS_SENTINELS: "..."
|
87
|
+
# REDIS_SENTINEL_ROLE: "..."
|
88
|
+
# REDIS_DISABLE_CLIENT_ID: "false"
|
89
|
+
# envFrom:
|
90
|
+
# type: configMapRef
|
91
|
+
# name: myConfigMapReference
|
92
|
+
|
93
|
+
## Metrics exporter Security Context
|
94
|
+
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context
|
95
|
+
##
|
96
|
+
# securityContext:
|
97
|
+
# runAsUser: 65534
|
98
|
+
|
99
|
+
## Metrics exporter pod Annotations
|
100
|
+
##
|
101
|
+
# podAnnotations:
|
102
|
+
|
103
|
+
## Metrics exporter Service properties
|
104
|
+
##
|
105
|
+
service:
|
106
|
+
## Metrics exporter Service type
|
107
|
+
##
|
108
|
+
type: ClusterIP
|
109
|
+
port: 80
|
110
|
+
|
111
|
+
serviceAccount:
|
112
|
+
## Specifies whether a ServiceAccount should be created
|
113
|
+
##
|
114
|
+
create: true
|
115
|
+
## The name of the ServiceAccount to use.
|
116
|
+
## If not set and create is true, a name is generated using the fullname template
|
117
|
+
##
|
118
|
+
# name:
|
119
|
+
|
120
|
+
rbac:
|
121
|
+
## Specifies whether RBAC resources should be created
|
122
|
+
##
|
123
|
+
create: false
|
124
|
+
|
125
|
+
## Enable this if you're using https://github.com/coreos/prometheus-operator
|
126
|
+
##
|
127
|
+
serviceMonitor:
|
128
|
+
enabled: false
|
129
|
+
path: "/metrics"
|
130
|
+
interval: 1m
|
131
|
+
scrapeTimeout: 10s
|
132
|
+
## Additional labels for the Service Monitor
|
133
|
+
##
|
134
|
+
# labels:
|
@@ -11,10 +11,21 @@ module Sidekiq
|
|
11
11
|
REQUEST_METHOD = 'REQUEST_METHOD'.freeze
|
12
12
|
NOT_FOUND_TEXT = 'Not Found'.freeze
|
13
13
|
MOUNT_PATH = '/metrics'.freeze
|
14
|
-
|
14
|
+
# rubocop:disable Style/MutableConstant
|
15
|
+
HEADERS = {'Content-Type' => 'text/plain; version=0.0.4', 'Cache-Control' => 'no-cache'}
|
16
|
+
# rubocop:enable Style/MutableConstant
|
15
17
|
EXPORTERS = Exporters.new
|
16
18
|
|
17
19
|
class << self
|
20
|
+
def banner
|
21
|
+
exporters =
|
22
|
+
EXPORTERS.enabled
|
23
|
+
.map { |klass| " - #{klass.name.split('::').last.downcase}" }
|
24
|
+
.join("\n".freeze)
|
25
|
+
|
26
|
+
"Enabled Sidekiq Prometheus exporters:\n#{exporters}"
|
27
|
+
end
|
28
|
+
|
18
29
|
def configure
|
19
30
|
yield(EXPORTERS)
|
20
31
|
end
|