Skip to content

Commit

Permalink
Merge pull request #143 from holaplex/mpw/nfts-metrics
Browse files Browse the repository at this point in the history
add service monitor to hub-nfts
  • Loading branch information
mpwsh authored Sep 13, 2023
2 parents ca82f95 + a27cd90 commit 759644a
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/hub-nfts/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,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.7.0
version: 0.8.0

# 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
26 changes: 26 additions & 0 deletions charts/hub-nfts/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,29 @@ spec:
name: http
selector:
{{- include "hub-nfts.selectorLabels" . | nindent 4 }}
{{- if and (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1") (.Values.serviceMonitor.enabled) }}
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "hub-nfts.fullname" . }}
{{- if .Release.Namespace }}
namespace: {{ .Release.Namespace }}
{{- end }}
labels:
{{- include "hub-nfts.labels" . | nindent 4 }}
{{- with .Values.serviceMonitor.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
endpoints:
- path: /metrics
port: http
scheme: {{ .Values.serviceMonitor.scheme }}
interval: {{ .Values.serviceMonitor.scrapeInterval }}
scrapeTimeout: {{ .Values.serviceMonitor.scrapeTimeout }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "hub-nfts.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}
9 changes: 8 additions & 1 deletion charts/hub-nfts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ service:
type: ClusterIP
port: 80

serviceMonitor:
enabled: true
scheme: http
scrapeInterval: 60s
scrapeTimeout: 30s
labels: {}

resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
Expand Down Expand Up @@ -86,7 +93,7 @@ tolerations: []

affinity: {}

creditSheetName:
creditSheetName: ""

secrets:
enabled: true
Expand Down

0 comments on commit 759644a

Please sign in to comment.