Skip to content

Conversation

@onelapahead
Copy link
Contributor

Go metrics can be useful when needing to understand heap usage and how much GC is consuming resources.

DB metrics are self-explanatory.

The ability to enable the default Go/process metrics on the API server, and for clients to manually register/enable DB metrics.

@onelapahead onelapahead requested a review from a team as a code owner January 8, 2026 19:52
Signed-off-by: hfuss <[email protected]>
Signed-off-by: hfuss <[email protected]>
Copy link
Contributor

@EnriqueL8 EnriqueL8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @onelapahead - this is great!

A few comments

opts.dbName = "default"
}

metricsRegistry.MustRegisterCollector(collectors.NewDBStatsCollector(db, opts.dbName))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as.MetricsRegistry.MustRegisterCollector(collectors.NewProcessCollector(collectors.ProcessCollectorOpts{}))
as.MetricsRegistry.MustRegisterCollector(collectors.NewGoCollector())
}
as.MetricsRegistry.MustRegisterCollector(collectors.NewBuildInfoCollector())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important comment on this collector:

The labels will only have meaningful values if the binary is built with Go module support and from source code retrieved from the source repository (rather than the local file system).

alwaysPaginate bool
handleYAML bool
monitoringEnabled bool
goProcessMetricsEnabled bool
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is whole pkg is already Golang

Suggested change
goProcessMetricsEnabled bool
processMetricsEnabled bool

Comment on lines +51 to +53
if opts.dbName == "" {
opts.dbName = "default"
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confused on this one, it feels like it should be mandatory to supply a dbName

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants