-
Notifications
You must be signed in to change notification settings - Fork 106
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
Add metrics to monitor reconcile status #346
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.
starting to look really good!
* Move init metrics to reconcile in CRDApps * Fix new lines in import * Fix metrics naming to ServMetrics to AppMetrics * Fix naming convention of metrics
pkg/app/crd_app.go
Outdated
@@ -6,6 +6,7 @@ package app | |||
import ( | |||
"context" | |||
"fmt" | |||
"github.com/vmware-tanzu/carvel-kapp-controller/pkg/metrics" |
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.
nit: move into next import subsection
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.
updated
pkg/metrics/app_metrics.go
Outdated
) | ||
|
||
// NewServerMetrics creates AppMetrics object | ||
func NewServerMetrics() *AppMetrics { |
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.
nit: NewServerMetrics -> NewAppMetrics
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.
updated
pkg/metrics/app_metrics.go
Outdated
|
||
// NewServerMetrics creates AppMetrics object | ||
func NewServerMetrics() *AppMetrics { | ||
metricNamespace := "kappctrl" |
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.
nit: you can actually use const within functions as well e.g.
const (
metricNamespace = "kappctrl"
kappNameLabel = "app_name"
kappNamespaceLabel = "namespace"
)
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.
updated
might have to rebase... |
Fix import Create construct within code Move initmetrics to app_reconile
super close @mhoshi-vm! |
I should have asked at the beginning but do I need to implement some test code ? |
Guessing I need to build something like the following. |
@mhoshi-vm thanks for sticking with it! 🔥🔥🔥 |
Feature Request for #337.
Add additional counter metrics to count the number reconciles with failures also.