-
Notifications
You must be signed in to change notification settings - Fork 554
feat: Add timer/counter telemetry for GitOps #3119
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
Conversation
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.
use defered properly
util/helper.go
Outdated
|
|
||
| func TriggerGitOpsMetrics(operation string, method string, startTime time.Time, err error) { | ||
| if err != nil { | ||
| middleware.GitOpsDuration.WithLabelValues(operation, method, "Failed", fmt.Sprintf("%v", startTime.Format("Mon, 02 Jan 2006 15:04:05 MST"))).Observe(time.Since(startTime).Seconds()) |
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.
refactor this properly
|
Kudos, SonarCloud Quality Gate passed!
|








Description
Show the timer/counter metrics forGitOps using Prometheus.
Fixes #https://dev.azure.com/DevtronLabs/Devtron/_workitems/edit/2314
Github issue: #3022
How Has This Been Tested?
Checklist:
Does this PR introduce a user-facing change?