Skip to content

Commit

Permalink
Merge pull request #10 from msalman899/feat/enable_prometheus_metrics
Browse files Browse the repository at this point in the history
feat: support for prometheus metrics
  • Loading branch information
janikgar authored Oct 26, 2022
2 parents 6f64e57 + fcfed78 commit 52d332d
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/boundary-chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.2.4
version: 0.2.5

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
7 changes: 7 additions & 0 deletions charts/boundary-chart/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@ data:
purpose = "proxy"
tls_disable = true
}
{{- if .Values.metrics.enabled }}
listener "tcp" {
address = "0.0.0.0"
purpose = "ops"
tls_disable = true
}
{{- end }}
{{- if .Values.vault.enabled }}
{{- $fqdn := .Values.vault.fqdn }}
{{- $mountPath := .Values.vault.mountPath }}
Expand Down
10 changes: 10 additions & 0 deletions charts/boundary-chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ spec:
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.metrics.enabled }}
prometheus.io/path: {{ .Values.metrics.path }}
prometheus.io/port: {{ .Values.metrics.port | quote }}
prometheus.io/scrape: "true"
{{- end }}
{{- if .Values.vault.enabled }}
{{- $credPath := .Values.vault.database.vaultCredPath }}
{{- $adminCredPath := .Values.vault.database.vaultAdminCredPath }}
Expand Down Expand Up @@ -109,6 +114,11 @@ spec:
protocol: TCP
{{- end }}
{{- end }}
{{- if .Values.metrics.enabled }}
- name: {{ .Values.metrics.name }}
containerPort: {{ .Values.metrics.port }}
protocol: TCP
{{- end }}
livenessProbe:
httpGet:
path: /
Expand Down
24 changes: 24 additions & 0 deletions charts/boundary-chart/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,27 @@ spec:
selector:
{{- $selectorLabels | nindent 4 }}
{{- end }}

---

{{ if .Values.metrics.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ $fullName }}-metrics
labels:
{{- $labels | nindent 4 }}
annotations:
prometheus.io/path: {{ .Values.metrics.path }}
prometheus.io/port: {{ .Values.metrics.port | quote }}
prometheus.io/scrape: "true"
spec:
type: ClusterIP
ports:
- port: {{ .Values.metrics.port }}
targetPort: {{ .Values.metrics.name }}
protocol: TCP
name: {{ .Values.metrics.name }}
selector:
{{- $selectorLabels | nindent 4 }}
{{- end }}
7 changes: 7 additions & 0 deletions charts/boundary-chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ vault:
vaultCredPath: postgres/creds/boundary-db
vaultDbRole: boundary

# set true to enable prometheus metrics
metrics:
enabled: false
name: metrics
port: 9203
path: /metrics

serviceAccount:
# Specifies whether a service account should be created
create: true
Expand Down

0 comments on commit 52d332d

Please sign in to comment.