influxdata / influxdb-relay

Service to replicate InfluxDB data for high availability
MIT License
855 stars 350 forks source link

Feature/ping response code #45

Open kinok opened 8 years ago

kinok commented 8 years ago

Hey guys,

We had a problem regarding the hardcoded 204 No Content of /ping response code. Indeed, Google Cloud Plateform http health-checks only accept 200 OK. With this PR, you'll be able to control what response code of /ping you want/need to have, from the config file, using default-ping-response.

Thank you guys for this great tool!

kinok commented 8 years ago

Hey @joelegasse, thanks for your relevant review. I agree with all your remarks, just made the changes.

kinok commented 7 years ago

Hey there, Any chance to have a review of this PR? Thank you guys

roman-vynar commented 7 years ago

Also Amazon ELB requires 200 and does not work with 204.

roman-vynar commented 7 years ago

Getting an error with this PR:

goroutine 1 [running]:
github.com/influxdata/influxdb-relay/relay.NewHTTP(0xc420016761, 0xb, 0xc420014e21, 0xe, 0xc4200167e5, 0x0, 0x0, 0x0, 0xc8, 0xc42009c2c0, ...)
    /go/src/github.com/influxdata/influxdb-relay/relay/http.go:61 +0xdf
github.com/influxdata/influxdb-relay/relay.New(0xc4200561e0, 0x1, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
    /go/src/github.com/influxdata/influxdb-relay/relay/relay.go:18 +0x15b
main.main()
    /go/src/github.com/influxdata/influxdb-relay/main.go:31 +0x1a1
panic: assignment to entry in nil map

Fix:

-       h := new(HTTP)
-
-       h.addr = cfg.Addr
-       h.name = cfg.Name
+       h := &HTTP{
+               addr:                cfg.Addr,
+               name:                cfg.Name,
+               pingResponseHeaders: map[string]string{},
+       }
PatrickSplice commented 4 years ago

Soooo...this is still an issue. Google gcp still only accepts 200 response codes. This has been open since 2016 and never fixed? It has been adjusted in both influxdb and telegraf. See this issue: https://github.com/influxdata/telegraf/pull/5704/files