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
Expose pipecd ops metrics #2279
Conversation
Code coverage for golang is
|
Code coverage for golang is
|
pkg/cli/cmd.go
Outdated
@@ -142,15 +145,41 @@ type MetricsBuilder interface { | |||
Build() (io.Reader, error) | |||
} | |||
|
|||
func (t Telemetry) CustomMetricsHandlerFor(mb MetricsBuilder) http.Handler { | |||
func (t Telemetry) CustomMetricsHandlerFor(reg *prometheus.Registry, mb MetricsBuilder) http.Handler { | |||
if t.Flags.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:
if !t.Flags.Metrics {
var empty http.HandlerFunc = func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte(""))
}
return empty
}
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.
I get your point. 👍 Lets keep it as is to unify with others for now, will address it by another PR (apply this pattern to others metrics handler as well)
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.
Changed my mind, will address it in this PR and apply only for this handler, lol
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.
Addressed by 6513a2d 🙏
pkg/cli/cmd.go
Outdated
@@ -142,15 +145,41 @@ type MetricsBuilder interface { | |||
Build() (io.Reader, error) | |||
} | |||
|
|||
func (t Telemetry) CustomMetricsHandlerFor(mb MetricsBuilder) http.Handler { | |||
func (t Telemetry) CustomMetricsHandlerFor(reg *prometheus.Registry, mb MetricsBuilder) http.Handler { |
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.
Passing Gatherer
instead of Registry
.
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.
Nice catch 👍 Address by 6513a2d 🙏
Looks good! |
Yup, looks perfect ;) |
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #
Does this PR introduce a user-facing change?: