-
Notifications
You must be signed in to change notification settings - Fork 25
/
cli.go
48 lines (37 loc) · 1.6 KB
/
cli.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package config
import (
kingpin "gopkg.in/alecthomas/kingpin.v2"
)
// AddCommandLine setup Graphite specific cli args and flags.
func AddCommandLine(app *kingpin.Application, cfg *Config) {
app.Flag("graphite.default-prefix",
"The prefix to prepend to all metrics exported to Graphite.").
StringVar(&cfg.DefaultPrefix)
app.Flag("graphite.read.url",
"The URL of the remote Graphite Web server to send samples to.").
StringVar(&cfg.Read.URL)
app.Flag("graphite.read.max-point-delta",
"If set, interval used to linearly interpolate intermediate points.").
DurationVar(&cfg.Read.MaxPointDelta)
app.Flag("graphite.write.carbon-address",
"The host:port of the Graphite server to send samples to.").
StringVar(&cfg.Write.CarbonAddress)
app.Flag("graphite.write.carbon-transport",
"Transport protocol to use to communicate with Graphite.").
StringVar(&cfg.Write.CarbonTransport)
app.Flag("graphite.write.enable-paths-cache",
"Enables a cache to graphite paths lists for written metrics.").
BoolVar(&cfg.Write.EnablePathsCache)
app.Flag("graphite.write.paths-cache-ttl",
"Duration TTL of items within the paths cache.").
DurationVar(&cfg.Write.PathsCacheTTL)
app.Flag("graphite.write.paths-cache-purge-interval",
"Duration between purges for expired items in the paths cache.").
DurationVar(&cfg.Write.PathsCachePurgeInterval)
app.Flag("graphite.enable-tags",
"Use Graphite tags.").
BoolVar(&cfg.EnableTags)
app.Flag("graphite.filtered-tags",
"Use Graphite tags only for given tag names; Multiple names must be separated by a comma. Eg: app_name,job_name").
StringVar(&cfg.FilteredTags)
}