Skip to content

Commit

Permalink
fix for backwards compatibility
Browse files Browse the repository at this point in the history
Signed-off-by: hfuss <hayden.fuss@kaleido.io>
  • Loading branch information
onelapahead committed Dec 5, 2024
1 parent 7e98810 commit 88fdd54
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 0 additions & 1 deletion pkg/ffresty/metrics.go

This file was deleted.

12 changes: 7 additions & 5 deletions pkg/metric/metric.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,11 @@ type Options struct {
MetricsPrefix string
}

func NewPrometheusMetricsRegistry(componentName string /*component name will be added to all metrics as a label*/, opts *Options) MetricsRegistry {
func NewPrometheusMetricsRegistry(componentName string /*component name will be added to all metrics as a label*/) MetricsRegistry {
return NewPrometheusMetricsRegistryWithOptions(componentName, Options{})
}

func NewPrometheusMetricsRegistryWithOptions(componentName string /*component name will be added to all metrics as a label*/, opts Options) MetricsRegistry {
registry := prometheus.NewRegistry()
registerer := prometheus.WrapRegistererWith(prometheus.Labels{compulsoryComponentLabel: componentName}, registry)

Expand All @@ -103,10 +107,8 @@ func NewPrometheusMetricsRegistry(componentName string /*component name will be
registerer.MustRegister(collectors.NewProcessCollector(collectors.ProcessCollectorOpts{}))

metricsPrefix := ffMetricsPrefix
if opts != nil {
if opts.MetricsPrefix != "" {
metricsPrefix = opts.MetricsPrefix
}
if opts.MetricsPrefix != "" {
metricsPrefix = opts.MetricsPrefix
}

return &prometheusMetricsRegistry{
Expand Down

0 comments on commit 88fdd54

Please sign in to comment.