meter: remove prefix options
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
a98618ed5b
commit
b2f4e14199
@ -17,10 +17,6 @@ type Options struct {
|
|||||||
Address string
|
Address string
|
||||||
// Path holds the path for metrics
|
// Path holds the path for metrics
|
||||||
Path string
|
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 holds the default labels
|
||||||
Labels []string
|
Labels []string
|
||||||
// WriteProcessMetrics flag to write process metrics
|
// WriteProcessMetrics flag to write process metrics
|
||||||
@ -32,11 +28,9 @@ type Options struct {
|
|||||||
// NewOptions prepares a set of options:
|
// NewOptions prepares a set of options:
|
||||||
func NewOptions(opt ...Option) Options {
|
func NewOptions(opt ...Option) Options {
|
||||||
opts := Options{
|
opts := Options{
|
||||||
Address: DefaultAddress,
|
Address: DefaultAddress,
|
||||||
Path: DefaultPath,
|
Path: DefaultPath,
|
||||||
Context: context.Background(),
|
Context: context.Background(),
|
||||||
MetricPrefix: DefaultMetricPrefix,
|
|
||||||
LabelPrefix: DefaultLabelPrefix,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, o := range opt {
|
for _, o := range opt {
|
||||||
@ -46,20 +40,6 @@ func NewOptions(opt ...Option) Options {
|
|||||||
return opts
|
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
|
// Context sets the metrics context
|
||||||
func Context(ctx context.Context) Option {
|
func Context(ctx context.Context) Option {
|
||||||
return func(o *Options) {
|
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 {
|
func Labels(ls ...string) Option {
|
||||||
return func(o *Options) {
|
return func(o *Options) {
|
||||||
o.Labels = append(o.Labels, ls...)
|
o.Labels = append(o.Labels, ls...)
|
||||||
|
Loading…
Reference in New Issue
Block a user