Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a parameter to feed broker storage query #428

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion cmd/metricsfetcher/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ func init() {
flag.BoolVar(&config.Verbose, "verbose", false, "Verbose output")
flag.BoolVar(&config.DryRun, "dry-run", false, "Dry run mode (don't reach Zookeeper)")
flag.BoolVar(&config.Compression, "compression", true, "Whether to compress metrics data written to ZooKeeper")
brq := flag.String("broker-storage-raw-query", "", "A complete broker free storage query string to use")

envy.Parse("METRICSFETCHER")
flag.Parse()
Expand All @@ -61,7 +62,12 @@ func init() {
}

// Complete query string.
config.BrokerQuery = fmt.Sprintf("%s by {%s}.rollup(avg, %d)", *bq, config.BrokerIDTag, config.Span)
if *brq == "" {
config.BrokerQuery = fmt.Sprintf("%s by {%s}.rollup(avg, %d)", *bq, config.BrokerIDTag, config.Span)
} else {
config.BrokerQuery = *brq
}

config.PartnQuery = fmt.Sprintf("%s.rollup(avg, %d)", *pq, config.Span)
}

Expand Down