Skip to content

Commit ae733e0

Browse files
authored
finish extra common tags clarity (#112)
1 parent 0e84d29 commit ae733e0

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

spectator/config.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import (
99

1010
// Config represents the Registry's configuration.
1111
type Config struct {
12-
location string
13-
commonTags map[string]string
14-
log logger.Logger
12+
location string
13+
extraCommonTags map[string]string
14+
log logger.Logger
1515
}
1616

1717
// NewConfig creates a new configuration with the provided location, extra common tags, and logger. All fields are
@@ -47,9 +47,9 @@ func NewConfig(
4747
lg := calculateLogger(log)
4848

4949
return &Config{
50-
location: location,
51-
commonTags: mergedTags,
52-
log: lg,
50+
location: location,
51+
extraCommonTags: mergedTags,
52+
log: lg,
5353
}, nil
5454
}
5555

spectator/registry.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func NewRegistry(config *Config) (Registry, error) {
7474
return nil, err
7575
}
7676

77-
config.log.Infof("Create Registry with extra commonTags=%v", config.commonTags)
77+
config.log.Infof("Create Registry with extraCommonTags=%v", config.extraCommonTags)
7878

7979
r := &spectatordRegistry{
8080
config: config,
@@ -90,12 +90,12 @@ func (r *spectatordRegistry) GetLogger() logger.Logger {
9090
return r.logger
9191
}
9292

93-
// NewId calls meters.NewId() and adds the commonTags registered in the config.
93+
// NewId calls meters.NewId() and adds the extraCommonTags registered in the config.
9494
func (r *spectatordRegistry) NewId(name string, tags map[string]string) *meter.Id {
9595
newId := meter.NewId(name, tags)
9696

97-
if r.config.commonTags != nil && len(r.config.commonTags) > 0 {
98-
newId = newId.WithTags(r.config.commonTags)
97+
if r.config.extraCommonTags != nil && len(r.config.extraCommonTags) > 0 {
98+
newId = newId.WithTags(r.config.extraCommonTags)
9999
}
100100

101101
return newId

0 commit comments

Comments
 (0)