Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upI modify the remote_storage_adapter/main.go ,is that ok? #3006
Comments
gouthamve
added
the
kind/question
label
Aug 1, 2017
This comment has been minimized.
This comment has been minimized.
|
I see you asked this question on the mailing list: https://groups.google.com/forum/#!msg/prometheus-users/V9AECACgaRY/2vaw9aiIAwAJ Thats probably the best place to discuss this, I've replied there. Closing this for now. |
tomwilkie
closed this
Aug 2, 2017
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
Mar 23, 2019
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
lock
bot
locked and limited conversation to collaborators
Mar 23, 2019
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
shanquanqiang commentedJul 31, 2017
•
edited
I want to read from different influxdbRetentionPolicy and i modify the function buildClients(cfg *config) ([]writer, []reader) like that:
`
if cfg.influxdbURL != "" {
url, err := url.Parse(cfg.influxdbURL)
if err != nil {
log.Fatalf("Failed to parse InfluxDB URL %q: %v", cfg.influxdbURL, err)
}
conf := influx.HTTPConfig{
Addr: url.String(),
Username: cfg.influxdbUsername,
Password: cfg.influxdbPassword,
Timeout: cfg.remoteTimeout,
}
c := influxdb.NewClient(conf, cfg.influxdbDatabase, cfg.influxdbRetentionPolicy)
prometheus.MustRegister(c)
writers = append(writers, c)
d := influxdb.NewClient(conf, cfg.influxdbDatabase, "sss")
e := influxdb.NewClient(conf, cfg.influxdbDatabase, "xxx")
readers = append(readers, c)
readers = append(readers, d)
readers = append(readers, e)
}
when read request comes,i chose different reader like thatif err := proto.Unmarshal(reqBuf, &req); err != nil {
http.Error(w, err.Error(), http.StatusBadRequest)
return
}
reader = readers[0] if string.Contains(req.String(),"ddd"){
reader = readers[1]
}
if string.Contains(req.String(),"ggg"){
reader = readers[2]
}
`
is ok?