Merge pull request 'changed MetricPrefix to Labels' (#112) from devstigneev/micro-store-redis:v3 into v3
Reviewed-on: #112 Reviewed-by: Василий Толстов <v.tolstov@unistack.org>
This commit is contained in:
commit
1afa5532b1
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
.idea
|
@ -27,6 +27,9 @@ var (
|
||||
DefaultMeterStatsInterval = 5 * time.Second
|
||||
// DefaultMeterMetricPrefix holds default metric prefix
|
||||
DefaultMeterMetricPrefix = "micro_store_"
|
||||
|
||||
labelHost = "redis_host"
|
||||
labelName = "redis_name"
|
||||
)
|
||||
|
||||
// Options struct holds wrapper options
|
||||
@ -36,6 +39,8 @@ type Options struct {
|
||||
Tracer tracer.Tracer
|
||||
MeterMetricPrefix string
|
||||
MeterStatsInterval time.Duration
|
||||
RedisHost string
|
||||
RedisName string
|
||||
}
|
||||
|
||||
// Option func signature
|
||||
@ -56,7 +61,9 @@ func NewOptions(opts ...Option) Options {
|
||||
}
|
||||
|
||||
options.Meter = options.Meter.Clone(
|
||||
meter.MetricPrefix(options.MeterMetricPrefix),
|
||||
meter.Labels(
|
||||
labelHost, options.RedisHost,
|
||||
labelName, options.RedisName),
|
||||
)
|
||||
|
||||
options.Logger = options.Logger.Clone(logger.WithCallerSkipCount(1))
|
||||
|
Loading…
Reference in New Issue
Block a user