-
Notifications
You must be signed in to change notification settings - Fork 251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(monitoring): Add optional ServiceMonitors to all JVM based services #181
Changes from 9 commits
531c88d
c7e8e70
ed1c3bc
da9b4ec
6c62cdf
14ef9f6
e27e242
282d3ab
958ab44
cc42589
62cc4e2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{{- if and .Values.serviceMonitor.create .Values.global.datahub.monitoring.enablePrometheus -}} | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: ServiceMonitor | ||
metadata: | ||
name: {{ printf "%s-%s" .Release.Name "datahub-frontend" }} | ||
labels: | ||
{{- include "datahub-frontend.labels" . | nindent 4 }} | ||
{{- with .Values.serviceMonitor.annotations }} | ||
annotations: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
endpoints: | ||
- port: jmx | ||
relabelings: | ||
- separator: / | ||
sourceLabels: | ||
- namespace | ||
- pod | ||
targetLabel: instance | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/managed-by: Helm | ||
app.kubernetes.io/name: datahub-frontend | ||
{{- end -}} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{{- if and .Values.serviceMonitor.create .Values.global.datahub.monitoring.enablePrometheus -}} | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: ServiceMonitor | ||
metadata: | ||
name: {{ printf "%s-%s" .Release.Name "datahub-gms" }} | ||
labels: | ||
{{- include "datahub-gms.labels" . | nindent 4 }} | ||
{{- with .Values.serviceMonitor.annotations }} | ||
annotations: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
endpoints: | ||
- port: jmx | ||
relabelings: | ||
- separator: / | ||
sourceLabels: | ||
- namespace | ||
- pod | ||
targetLabel: instance | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/managed-by: Helm | ||
app.kubernetes.io/name: datahub-gms | ||
{{- end -}} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{{- if and .Values.serviceMonitor.create .Values.global.datahub.monitoring.enablePrometheus -}} | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: ServiceMonitor | ||
metadata: | ||
name: {{ printf "%s-%s" .Release.Name "datahub-mae-consumer" }} | ||
labels: | ||
{{- include "datahub-mae-consumer.labels" . | nindent 4 }} | ||
{{- with .Values.serviceMonitor.annotations }} | ||
annotations: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
endpoints: | ||
- port: jmx | ||
relabelings: | ||
- separator: / | ||
sourceLabels: | ||
- namespace | ||
- pod | ||
targetLabel: instance | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/managed-by: Helm | ||
app.kubernetes.io/name: datahub-mae-consumer | ||
{{- end -}} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,11 +40,6 @@ spec: | |
defaultMode: 0444 | ||
secretName: {{ .Values.global.credentialsAndCertsSecrets.name }} | ||
{{- end }} | ||
{{- if .Values.exporters.jmx.enabled }} | ||
- name: config-jmx-exporter | ||
configMap: | ||
name: {{ include "datahub-mce-consumer.fullname" . }}-config-jmx-exporter | ||
{{- end }} | ||
{{- with .Values.extraVolumes }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
|
@@ -59,6 +54,9 @@ spec: | |
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" | ||
imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
ports: | ||
- name: actuator | ||
containerPort: 9090 | ||
protocol: TCP | ||
{{- if or .Values.global.datahub.monitoring.enablePrometheus .Values.global.datahub.monitoring.enableJMXPort }} | ||
- name: jmx | ||
containerPort: 4318 | ||
|
@@ -67,14 +65,14 @@ spec: | |
livenessProbe: | ||
httpGet: | ||
path: /actuator/health | ||
port: 9090 | ||
port: actuator | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you please also review Mae-consumer deployment.yaml? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the same thing is exposed on 9091 on MAE, and called There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we make it consistent then? Call all of them There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. renamed this one to http |
||
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }} | ||
periodSeconds: {{ .Values.livenessProbe.periodSeconds }} | ||
failureThreshold: {{ .Values.livenessProbe.failureThreshold }} | ||
readinessProbe: | ||
httpGet: | ||
path: /actuator/health | ||
port: 9090 | ||
port: actuator | ||
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }} | ||
periodSeconds: {{ .Values.readinessProbe.periodSeconds }} | ||
failureThreshold: {{ .Values.readinessProbe.failureThreshold }} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ printf "%s-%s" .Release.Name "datahub-mce-consumer" }} | ||
labels: | ||
{{- include "datahub-mce-consumer.labels" . | nindent 4 }} | ||
spec: | ||
type: {{ .Values.service.type }} | ||
ports: | ||
- port: {{ .Values.service.port }} | ||
targetPort: {{ .Values.service.targetPort }} | ||
protocol: {{ .Values.service.protocol }} | ||
name: {{ .Values.service.name }} | ||
{{- if eq .Values.service.type "NodePort" }} | ||
{{- with .Values.service.nodePort }} | ||
nodePort: {{ . }} | ||
{{- end }} | ||
{{- end }} | ||
{{- if .Values.global.datahub.monitoring.enablePrometheus }} | ||
- name: jmx | ||
port: 4318 | ||
targetPort: jmx | ||
protocol: TCP | ||
{{- end }} | ||
selector: | ||
{{- include "datahub-mce-consumer.selectorLabels" . | nindent 4 }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{{- if and .Values.serviceMonitor.create .Values.global.datahub.monitoring.enablePrometheus -}} | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: ServiceMonitor | ||
metadata: | ||
name: {{ printf "%s-%s" .Release.Name "datahub-mce-consumer" }} | ||
labels: | ||
{{- include "datahub-mce-consumer.labels" . | nindent 4 }} | ||
{{- with .Values.serviceMonitor.annotations }} | ||
annotations: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
endpoints: | ||
- port: jmx | ||
relabelings: | ||
- separator: / | ||
sourceLabels: | ||
- namespace | ||
- pod | ||
targetLabel: instance | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/managed-by: Helm | ||
app.kubernetes.io/name: datahub-mce-consumer | ||
{{- end -}} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,9 @@ serviceAccount: | |
# If not set and create is true, a name is generated using the fullname template | ||
name: | ||
|
||
serviceAccount: | ||
create: false | ||
|
||
podAnnotations: {} | ||
# co.elastic.logs/enabled: "true" | ||
|
||
|
@@ -39,8 +42,14 @@ securityContext: {} | |
# runAsUser: 1000 | ||
|
||
service: | ||
type: ClusterIP | ||
port: 80 | ||
type: ClusterIP # NodePort | ||
port: "9090" | ||
targetPort: actuator | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we have this for mce-consumer? Mae-consumer does not have it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it already has it. MCE was missing the service for some reason. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. MAE has the service but in the values.yaml it is using a different port and a different targetPort name, I'm asking if we can make this consistent. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. renamed it to http for consistency |
||
protocol: TCP | ||
name: actuator | ||
|
||
serviceMonitor: | ||
create: false | ||
|
||
ingress: | ||
enabled: false | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we create service monitors by default since they only get activated if and only if
global.datahub.monitoring.enablePrometheus
is also enabled?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if they don't have serviceMonitor CRD, the deployment would fail. It's an advanced feature, if somebody know what they are doing, then they can enable.