Skip to content

Commit

Permalink
feat(metrics): allow for service ports for global prometheus (dapr#7929)
Browse files Browse the repository at this point in the history
* feat(metrics): add service port for metrics

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* fix: use correct key

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* fix: add target port too

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* fix: add file i missed

Signed-off-by: Samantha Coyle <sam@diagrid.io>

---------

Signed-off-by: Samantha Coyle <sam@diagrid.io>
  • Loading branch information
sicoyle authored Jul 22, 2024
1 parent 7257b2f commit 4aad51c
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ spec:
targetPort: {{ .Values.ports.targetPort }}
name: legacy
{{ end }}
{{- if eq .Values.global.prometheus.enabled true }}
- name: metrics
port: {{ .Values.global.prometheus.port }}
targetPort: {{ .Values.global.prometheus.port }}
protocol: TCP
{{- end}}
---
apiVersion: v1
kind: Service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,11 @@ spec:
port: {{ .Values.ports.apiPort }}
- name: raft-node
port: {{ .Values.ports.raftRPCPort }}
{{- if eq .Values.global.prometheus.enabled true }}
- name: metrics
port: {{ .Values.global.prometheus.port }}
targetPort: {{ .Values.global.prometheus.port }}
protocol: TCP
{{- end}}
clusterIP: None
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,11 @@ spec:
port: {{ .Values.ports.etcdHTTPClientPort }}
- name: etcd-peer
port: {{ .Values.ports.etcdGRPCPeerPort }}
{{- if eq .Values.global.prometheus.enabled true }}
- name: metrics
port: {{ .Values.global.prometheus.port }}
targetPort: {{ .Values.global.prometheus.port }}
protocol: TCP
{{- end}}
clusterIP: None # make the service headless
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,9 @@ spec:
port: {{ .Values.ports.port }}
targetPort: {{ .Values.ports.targetPort }}
name: grpc
{{- if eq .Values.global.prometheus.enabled true }}
- name: metrics
port: {{ .Values.global.prometheus.port }}
targetPort: {{ .Values.global.prometheus.port }}
protocol: TCP
{{- end}}
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,10 @@ spec:
targetPort: https
protocol: TCP
name: https
{{- if eq .Values.global.prometheus.enabled true }}
- name: metrics
port: {{ .Values.global.prometheus.port }}
targetPort: {{ .Values.global.prometheus.port }}
protocol: TCP
{{- end}}
{{- end }}

0 comments on commit 4aad51c

Please sign in to comment.