-
Notifications
You must be signed in to change notification settings - Fork 80
Add prometheus metrics #648
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
Merged
Merged
Changes from 23 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
ae2c346
Update charts to provide optional operator metrics
jbiers a8f216f
Update BRO code to optionally export Backup metrics
jbiers 34e656b
Make metrics conditional to metricsServerEnabled
jbiers 872de73
Set debug back to false
jbiers 918a6a8
Refactor metrics and create separate loop for metadata metrics
jbiers 883c1bf
Fix wrong logrus.Error reference
jbiers a18241c
Fix logs
jbiers 69a3026
Fix formatting
jbiers 9d1a835
Add function for collecting time-related metrics and some fixes
jbiers 7823810
Add function for emitting metrics on processed backups
jbiers 2cdff68
Move metrics collection and bump histogram buckets
jbiers 1172069
Rebase with main and fix go.sum
jbiers 13ad4b1
Add values to hull tests
jbiers 734ed78
Improve hull tests
jbiers 958ad20
Add relabelings to hull tests
jbiers 166853e
More hull fixes
jbiers f3922a6
Backup metrics testing
jbiers 0bb6c98
Restore metrics testing
jbiers c732b03
Use early-return in settings backups_failed metric
jbiers dd28984
Make histogram buckets less granular
jbiers cb7ab1b
Add very basic unit tests for metrics that are complex to predict in e2e
mallardduck 5cf1221
Merge pull request #1 from mallardduck/prom-metrics-unit
jbiers 8d6b866
Add recurring backup unit test for time-sensitive metrics
jbiers cfa6b13
Fixes from feedback
jbiers 63a912c
Update tests to match new buckets
jbiers fc2604f
Replace unnecessary Sprintf functions
jbiers File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| {{ if and (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1") .Values.monitoring.serviceMonitor.enabled }} | ||
| apiVersion: monitoring.coreos.com/v1 | ||
| kind: ServiceMonitor | ||
| metadata: | ||
| name: {{ include "backupRestore.fullname" . }} | ||
| namespace: {{ .Release.Namespace }} | ||
| labels: | ||
| {{- include "backupRestore.labels" . | nindent 4 }} | ||
| {{- with .Values.monitoring.serviceMonitor.additionalLabels }} | ||
| {{- toYaml . | nindent 4 }} | ||
| {{- end }} | ||
| spec: | ||
| selector: | ||
| matchLabels: | ||
| {{- include "backupRestore.labels" . | nindent 6 }} | ||
| endpoints: | ||
| - port: http | ||
| path: /metrics | ||
| {{- with .Values.monitoring.serviceMonitor.metricRelabelings }} | ||
| metricRelabelings: | ||
| {{- toYaml . | nindent 6 }} | ||
| {{- end }} | ||
| {{- with .Values.monitoring.serviceMonitor.relabelings }} | ||
| relabelings: | ||
| {{- toYaml . | nindent 4 }} | ||
| {{- end }} | ||
| namespaceSelector: | ||
| matchNames: | ||
| - {{ .Release.Namespace }} | ||
| {{- end }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| {{ if .Values.monitoring.metrics.enabled }} | ||
| apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| name: {{ include "backupRestore.fullname" . }} | ||
| namespace: {{ .Release.Namespace }} | ||
| labels: | ||
| {{- include "backupRestore.labels" . | nindent 4 }} | ||
| annotations: | ||
| prometheus.io/path: /metrics | ||
| prometheus.io/port: /8080 | ||
| prometheus.io/scrape: "true" | ||
| spec: | ||
| type: ClusterIP | ||
| clusterIP: None | ||
| ports: | ||
| - port: 8080 | ||
| targetPort: 8080 | ||
| protocol: TCP | ||
| name: http | ||
| selector: | ||
| app.kubernetes.io/name: {{ .Release.Name }} | ||
| app.kubernetes.io/instance: {{ .Release.Name }} | ||
| {{ end }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.