Skip to content

Commit

Permalink
Rename MetricsCollectorOpts to PrometheusMetricsOpts for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
vasayxtx committed Feb 20, 2025
1 parent 1e766a5 commit dbc2e7b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ const PrometheusMetricsLabelQuery = "query"
// DefaultQueryDurationBuckets is default buckets into which observations of executing SQL queries are counted.
var DefaultQueryDurationBuckets = []float64{0.001, 0.01, 0.1, 0.25, 0.5, 1, 2.5, 5, 10}

// MetricsCollectorOpts represents an options for PrometheusMetrics.
type MetricsCollectorOpts struct {
// PrometheusMetricsOpts represents an options for PrometheusMetrics.
type PrometheusMetricsOpts struct {
// Namespace is a namespace for metrics. It will be prepended to all metric names.
Namespace string

Expand All @@ -44,11 +44,11 @@ type PrometheusMetrics struct {

// NewPrometheusMetrics creates a new metrics collector.
func NewPrometheusMetrics() *PrometheusMetrics {
return NewPrometheusMetricsWithOpts(MetricsCollectorOpts{})
return NewPrometheusMetricsWithOpts(PrometheusMetricsOpts{})
}

// NewPrometheusMetricsWithOpts is a more configurable version of creating PrometheusMetrics.
func NewPrometheusMetricsWithOpts(opts MetricsCollectorOpts) *PrometheusMetrics {
func NewPrometheusMetricsWithOpts(opts PrometheusMetricsOpts) *PrometheusMetrics {
queryDurationBuckets := opts.QueryDurationBuckets
if queryDurationBuckets == nil {
queryDurationBuckets = DefaultQueryDurationBuckets
Expand Down

0 comments on commit dbc2e7b

Please sign in to comment.