From 4ae72771403e8bbbc195df20b500934eca229532 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Fri, 20 Sep 2024 08:27:25 +0300 Subject: [PATCH] meter: remove prefix options Signed-off-by: Vasiliy Tolstov --- meter/options.go | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/meter/options.go b/meter/options.go index 79ef2a11..236bebd3 100644 --- a/meter/options.go +++ b/meter/options.go @@ -17,10 +17,6 @@ type Options struct { Address string // Path holds the path for metrics Path string - // MetricPrefix holds the prefix for all metrics - MetricPrefix string - // LabelPrefix holds the prefix for all labels - LabelPrefix string // Labels holds the default labels Labels []string // WriteProcessMetrics flag to write process metrics @@ -32,11 +28,9 @@ type Options struct { // NewOptions prepares a set of options: func NewOptions(opt ...Option) Options { opts := Options{ - Address: DefaultAddress, - Path: DefaultPath, - Context: context.Background(), - MetricPrefix: DefaultMetricPrefix, - LabelPrefix: DefaultLabelPrefix, + Address: DefaultAddress, + Path: DefaultPath, + Context: context.Background(), } for _, o := range opt { @@ -46,20 +40,6 @@ func NewOptions(opt ...Option) Options { return opts } -// LabelPrefix sets the labels prefix -func LabelPrefix(pref string) Option { - return func(o *Options) { - o.LabelPrefix = pref - } -} - -// MetricPrefix sets the metric prefix -func MetricPrefix(pref string) Option { - return func(o *Options) { - o.MetricPrefix = pref - } -} - // Context sets the metrics context func Context(ctx context.Context) Option { return func(o *Options) { @@ -90,7 +70,7 @@ func TimingObjectives(value map[float64]float64) Option { } */ -// Labels sets the meter labels +// Labels add the meter labels func Labels(ls ...string) Option { return func(o *Options) { o.Labels = append(o.Labels, ls...)