Skip to content

Commit

Permalink
Merge pull request #127 from prometheus/mr/update-dependencies
Browse files Browse the repository at this point in the history
Update dependencies
  • Loading branch information
Matthias Rampke authored Jun 12, 2020
2 parents 9f14f6b + a0c2368 commit e9da273
Show file tree
Hide file tree
Showing 224 changed files with 45,410 additions and 13,960 deletions.
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
module github.com/prometheus/graphite_exporter

require (
github.com/go-kit/kit v0.9.0
github.com/go-kit/kit v0.10.0
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.5.1
github.com/prometheus/common v0.9.1
github.com/prometheus/statsd_exporter v0.14.1
github.com/stretchr/testify v1.4.0
github.com/prometheus/client_golang v1.6.0
github.com/prometheus/common v0.10.0
github.com/prometheus/statsd_exporter v0.16.0
github.com/stretchr/testify v1.6.0
golang.org/x/sys v0.0.0-20200501145240-bc7a7d42d5c3 // indirect
gopkg.in/alecthomas/kingpin.v2 v2.2.6
gopkg.in/yaml.v2 v2.2.8 // indirect
Expand Down
311 changes: 305 additions & 6 deletions go.sum

Large diffs are not rendered by default.

11 changes: 7 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ var (
sampleExpiry = kingpin.Flag("graphite.sample-expiry", "How long a sample is valid for.").Default("5m").Duration()
strictMatch = kingpin.Flag("graphite.mapping-strict-match", "Only store metrics that match the mapping configuration.").Bool()
cacheSize = kingpin.Flag("graphite.cache-size", "Maximum size of your metric mapping cache. Relies on least recently used replacement policy if max size is reached.").Default("1000").Int()
cacheType = kingpin.Flag("graphite.cache-type", "Metric mapping cache type. Valid options are \"lru\" and \"random\"").Default("lru").Enum("lru", "random")
dumpFSMPath = kingpin.Flag("debug.dump-fsm", "The path to dump internal FSM generated for glob matching as Dot file.").Default("").String()

lastProcessed = prometheus.NewGauge(
Expand Down Expand Up @@ -81,8 +82,8 @@ func (s graphiteSample) String() string {

type metricMapper interface {
GetMapping(string, mapper.MetricType) (*mapper.MetricMapping, prometheus.Labels, bool)
InitFromFile(string, int) error
InitCache(cacheSize int)
InitFromFile(string, int, ...mapper.CacheOption) error
InitCache(int, ...mapper.CacheOption)
}

type graphiteCollector struct {
Expand Down Expand Up @@ -266,14 +267,16 @@ func main() {
prometheus.MustRegister(c)

c.mapper = &mapper.MetricMapper{}
cacheOption := mapper.WithCacheType(*cacheType)

if *mappingConfig != "" {
err := c.mapper.InitFromFile(*mappingConfig, *cacheSize)
err := c.mapper.InitFromFile(*mappingConfig, *cacheSize, cacheOption)
if err != nil {
level.Error(logger).Log("msg", "Error loading metric mapping config", "err", err)
os.Exit(1)
}
} else {
c.mapper.InitCache(0)
c.mapper.InitCache(*cacheSize, cacheOption)
}

if *dumpFSMPath != "" {
Expand Down
4 changes: 2 additions & 2 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ func (m *mockMapper) GetMapping(metricName string, metricType mapper.MetricType)

}

func (m *mockMapper) InitFromFile(string, int) error {
func (m *mockMapper) InitFromFile(string, int, ...mapper.CacheOption) error {
return nil
}
func (m *mockMapper) InitCache(int) {
func (m *mockMapper) InitCache(int, ...mapper.CacheOption) {

}
func TestProcessLine(t *testing.T) {
Expand Down
4 changes: 3 additions & 1 deletion vendor/github.com/go-kit/kit/log/json_logger.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions vendor/github.com/go-logfmt/logfmt/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions vendor/github.com/go-logfmt/logfmt/.travis.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions vendor/github.com/go-logfmt/logfmt/CHANGELOG.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions vendor/github.com/go-logfmt/logfmt/decode.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

126 changes: 0 additions & 126 deletions vendor/github.com/go-logfmt/logfmt/fuzz.go

This file was deleted.

2 changes: 1 addition & 1 deletion vendor/github.com/go-logfmt/logfmt/go.mod

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions vendor/github.com/go-logfmt/logfmt/go.sum

This file was deleted.

Loading

0 comments on commit e9da273

Please sign in to comment.