diff options
| author | robot-piglet <[email protected]> | 2023-11-28 17:06:26 +0300 | 
|---|---|---|
| committer | robot-piglet <[email protected]> | 2023-11-28 18:05:48 +0300 | 
| commit | e86f906e854caf259f096dd20f0f09425a178d28 (patch) | |
| tree | 3ca53abe8d890f08057356f5815f3b8a81c019a4 /library | |
| parent | d43e6d465089192222d8c01c10b03863ad285359 (diff) | |
Intermediate changes
Diffstat (limited to 'library')
| -rw-r--r-- | library/go/core/metrics/prometheus/registry.go | 2 | ||||
| -rw-r--r-- | library/go/core/metrics/prometheus/registry_opts.go | 9 | 
2 files changed, 8 insertions, 3 deletions
diff --git a/library/go/core/metrics/prometheus/registry.go b/library/go/core/metrics/prometheus/registry.go index e10aef935e1..d43e9267170 100644 --- a/library/go/core/metrics/prometheus/registry.go +++ b/library/go/core/metrics/prometheus/registry.go @@ -16,7 +16,7 @@ var _ metrics.Registry = (*Registry)(nil)  var _ metrics.MetricsStreamer = (*Registry)(nil)  type Registry struct { -	rg *prometheus.Registry +	rg PrometheusRegistry  	m             *sync.Mutex  	subregistries map[string]*Registry diff --git a/library/go/core/metrics/prometheus/registry_opts.go b/library/go/core/metrics/prometheus/registry_opts.go index 1dab30d40d9..2ced795b0cc 100644 --- a/library/go/core/metrics/prometheus/registry_opts.go +++ b/library/go/core/metrics/prometheus/registry_opts.go @@ -10,10 +10,15 @@ import (  	"github.com/ydb-platform/ydb/library/go/core/metrics/internal/pkg/registryutil"  ) +type PrometheusRegistry interface { +	prometheus.Registerer +	prometheus.Gatherer +} +  type RegistryOpts struct {  	Prefix        string  	Tags          map[string]string -	rg            *prometheus.Registry +	rg            PrometheusRegistry  	Collectors    []func(metrics.Registry)  	NameSanitizer func(string) string  	StreamFormat  expfmt.Format @@ -58,7 +63,7 @@ func (o *RegistryOpts) AppendPrefix(prefix string) *RegistryOpts {  //  // This is primarily used to unite externally defined metrics with metrics kept  // in the core registry. -func (o *RegistryOpts) SetRegistry(rg *prometheus.Registry) *RegistryOpts { +func (o *RegistryOpts) SetRegistry(rg PrometheusRegistry) *RegistryOpts {  	o.rg = rg  	return o  }  | 
