From e1f478383eac51fb42eaa133435c249cf9fb41e2 Mon Sep 17 00:00:00 2001 From: "David G. Simmons" Date: Fri, 3 Nov 2017 13:17:10 -0400 Subject: [PATCH 1/6] Revert "Updated Test JSON" This reverts commit 92caf33fff56eb730be62f235ede68d2e833db83. --- plugins/inputs/webhooks/particle/particle_webhooks_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/inputs/webhooks/particle/particle_webhooks_test.go b/plugins/inputs/webhooks/particle/particle_webhooks_test.go index 53252ff17..850b2c4fc 100644 --- a/plugins/inputs/webhooks/particle/particle_webhooks_test.go +++ b/plugins/inputs/webhooks/particle/particle_webhooks_test.go @@ -72,8 +72,8 @@ func NewItemJSON() string { "humidity": 44.937500, "pressure": 998.998901, "altitude": 119.331436, - "broadband": 1266.0, - "infrared": 528.0, + "broadband": 1266, + "infrared": 528, "lux": 0.0 } }, From f6ea405c7aaf23dd96e7f8709b0db63842319fb4 Mon Sep 17 00:00:00 2001 From: "David G. Simmons" Date: Fri, 3 Nov 2017 13:18:17 -0400 Subject: [PATCH 2/6] Revert "Small fixes" This reverts commit a987118b010ca3827c1ee8ebe691f6f6bd287ac5. --- plugins/inputs/webhooks/particle/README.md | 4 ++-- plugins/inputs/webhooks/particle/particle_webhooks_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/inputs/webhooks/particle/README.md b/plugins/inputs/webhooks/particle/README.md index 3c345daa8..e7b206b53 100644 --- a/plugins/inputs/webhooks/particle/README.md +++ b/plugins/inputs/webhooks/particle/README.md @@ -1,10 +1,10 @@ # particle webhooks -You should configure your Particle.io's Webhooks to point at the `webhooks` service. To do this go to `(https://console.particle.io/)[https://console.particle.io]` and click `Integrations > New Integration > Webhook`. In the resulting page set `URL` to `http://:1619/particle`, and under `Advanced Settings` click on `JSON` and add: +You should configure your Particle.io's Webhooks to point at the `webhooks` service. To do this go to `console.particle.io/` and click `Integrations > New Integration > Webhook`. In the resulting page set `URL` to `http://:1619/particle`, and under `Advanced Settings` click on `JSON` and add: ``` { - "influx_db": "your_measurement_name" + "influx_db": "your_database_name" } ``` diff --git a/plugins/inputs/webhooks/particle/particle_webhooks_test.go b/plugins/inputs/webhooks/particle/particle_webhooks_test.go index 850b2c4fc..eecf26e14 100644 --- a/plugins/inputs/webhooks/particle/particle_webhooks_test.go +++ b/plugins/inputs/webhooks/particle/particle_webhooks_test.go @@ -74,7 +74,7 @@ func NewItemJSON() string { "altitude": 119.331436, "broadband": 1266, "infrared": 528, - "lux": 0.0 + "lux": 0 } }, "ttl": 60, From 9acf7f18cad33d68d9365c10d2f8794e88ffa672 Mon Sep 17 00:00:00 2001 From: "David G. Simmons" Date: Fri, 3 Nov 2017 13:18:30 -0400 Subject: [PATCH 3/6] Revert "Updated README.md" This reverts commit a6ada03b910ffa5ac8bc85ad52a1b789dc99aae6. --- plugins/inputs/webhooks/particle/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/inputs/webhooks/particle/README.md b/plugins/inputs/webhooks/particle/README.md index e7b206b53..d11b6f7fb 100644 --- a/plugins/inputs/webhooks/particle/README.md +++ b/plugins/inputs/webhooks/particle/README.md @@ -28,7 +28,7 @@ String data = String::format("{ \"tags\" : { Particle.publish("event_name", data, PRIVATE); ``` Escaping the "" is required in the source file on the Particle device. -The number of tag values and field values is not restricted so you can send as many values per webhook call as you'd like. +The number of tag values and field values is not restrictied so you can send as many values per webhook call as you'd like. From ae9c881d33c65748f4dfc663ba8906c7c3ed8b35 Mon Sep 17 00:00:00 2001 From: "David G. Simmons" Date: Fri, 3 Nov 2017 13:28:00 -0400 Subject: [PATCH 4/6] Revert "Update README.md" This reverts commit 8ed00af10a9a5950850f27a5c196dcc0245166b0. --- plugins/inputs/webhooks/particle/README.md | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/plugins/inputs/webhooks/particle/README.md b/plugins/inputs/webhooks/particle/README.md index d11b6f7fb..1212b742a 100644 --- a/plugins/inputs/webhooks/particle/README.md +++ b/plugins/inputs/webhooks/particle/README.md @@ -1,15 +1,6 @@ # particle webhooks -You should configure your Particle.io's Webhooks to point at the `webhooks` service. To do this go to `console.particle.io/` and click `Integrations > New Integration > Webhook`. In the resulting page set `URL` to `http://:1619/particle`, and under `Advanced Settings` click on `JSON` and add: - -``` -{ - "influx_db": "your_database_name" -} -``` - -If required, enter your username and password, etc. and then click `Save` - +You should configure your Rollbar's Webhooks to point at the `webhooks` service. To do this go to `particle.com/` and click `Settings > Notifications > Webhook`. In the resulting page set `URL` to `http://:1619/particle`, and click on `Enable Webhook Integration`. ## Events @@ -27,9 +18,9 @@ String data = String::format("{ \"tags\" : { ); Particle.publish("event_name", data, PRIVATE); ``` -Escaping the "" is required in the source file on the Particle device. +Escaping the "" is required in the source file. The number of tag values and field values is not restrictied so you can send as many values per webhook call as you'd like. - +You will need to enable JSON messages in the Webhooks setup of Particle.io See [webhook doc](https://docs.particle.io/reference/webhooks/) From 1b7a1d9228e3f32550f369c7bc3f3cfe1c8fc696 Mon Sep 17 00:00:00 2001 From: "David G. Simmons" Date: Fri, 3 Nov 2017 13:28:35 -0400 Subject: [PATCH 5/6] Revert "bug fixes and refactoring" This reverts commit 86961cc8143e3b2edfaabb97c639030754ea9edc. --- .../webhooks/particle/particle_webhooks.go | 59 +++++++----------- .../particle/particle_webhooks_events.go | 22 +++++++ .../particle_webhooks_events_json_test.go | 39 ++++++++++++ .../particle/particle_webhooks_test.go | 60 ++++--------------- 4 files changed, 91 insertions(+), 89 deletions(-) create mode 100644 plugins/inputs/webhooks/particle/particle_webhooks_events.go create mode 100644 plugins/inputs/webhooks/particle/particle_webhooks_events_json_test.go diff --git a/plugins/inputs/webhooks/particle/particle_webhooks.go b/plugins/inputs/webhooks/particle/particle_webhooks.go index 258619856..813bd0665 100644 --- a/plugins/inputs/webhooks/particle/particle_webhooks.go +++ b/plugins/inputs/webhooks/particle/particle_webhooks.go @@ -2,40 +2,14 @@ package particle import ( "encoding/json" + "github.com/gorilla/mux" + "github.com/influxdata/telegraf" + "io/ioutil" "log" "net/http" "time" - - "github.com/gorilla/mux" - "github.com/influxdata/telegraf" ) -type event struct { - Name string `json:"event"` - Data data `json:"data"` - TTL int `json:"ttl"` - PublishedAt string `json:"published_at"` - Database string `json:"influx_db"` -} - -type data struct { - Tags map[string]string `json:"tags"` - Fields map[string]interface{} `json:"values"` -} - -func newEvent() *event { - return &event{ - Data: data{ - Tags: make(map[string]string), - Fields: make(map[string]interface{}), - }, - } -} - -func (e *event) Time() (time.Time, error) { - return time.Parse("2006-01-02T15:04:05Z", e.PublishedAt) -} - type ParticleWebhook struct { Path string acc telegraf.Accumulator @@ -49,19 +23,26 @@ func (rb *ParticleWebhook) Register(router *mux.Router, acc telegraf.Accumulator func (rb *ParticleWebhook) eventHandler(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() - e := newEvent() - if err := json.NewDecoder(r.Body).Decode(e); err != nil { - log.Println(err) + data, err := ioutil.ReadAll(r.Body) + if err != nil { w.WriteHeader(http.StatusBadRequest) return } - - pTime, err := e.Time() - if err != nil { - pTime = time.Now() - log.Printf("error parsing particle event time: %s. Using telegraf host time instead: %s", e.PublishedAt, pTime) + dummy := &DummyData{} + if err := json.Unmarshal(data, dummy); err != nil { + w.WriteHeader(http.StatusBadRequest) + return } - - rb.acc.AddFields(e.Name, e.Data.Fields, e.Data.Tags, pTime) + pd := &ParticleData{} + if err := json.Unmarshal([]byte(dummy.Data), pd); err != nil { + w.WriteHeader(http.StatusBadRequest) + return + } + pTime, err := dummy.Time() + if err != nil { + log.Printf("Time Conversion Error") + pTime = time.Now() + } + rb.acc.AddFields(dummy.InfluxDB, pd.Fields, pd.Tags, pTime) w.WriteHeader(http.StatusOK) } diff --git a/plugins/inputs/webhooks/particle/particle_webhooks_events.go b/plugins/inputs/webhooks/particle/particle_webhooks_events.go new file mode 100644 index 000000000..089536525 --- /dev/null +++ b/plugins/inputs/webhooks/particle/particle_webhooks_events.go @@ -0,0 +1,22 @@ +package particle + +import ( + "time" +) + +type DummyData struct { + Event string `json:"event"` + Data string `json:"data"` + Ttl int `json:"ttl"` + PublishedAt string `json:"published_at"` + InfluxDB string `json:"influx_db"` +} +type ParticleData struct { + Event string `json:"event"` + Tags map[string]string `json:"tags"` + Fields map[string]interface{} `json:"values"` +} + +func (d *DummyData) Time() (time.Time, error) { + return time.Parse("2006-01-02T15:04:05Z", d.PublishedAt) +} diff --git a/plugins/inputs/webhooks/particle/particle_webhooks_events_json_test.go b/plugins/inputs/webhooks/particle/particle_webhooks_events_json_test.go new file mode 100644 index 000000000..aef0537e9 --- /dev/null +++ b/plugins/inputs/webhooks/particle/particle_webhooks_events_json_test.go @@ -0,0 +1,39 @@ +package particle + +func NewItemJSON() string { + return ` + { + "event": "temperature", + "data": "{ + "tags": { + "id": "230035001147343438323536", + "location": "TravelingWilbury" + }, + "values": { + "temp_c": 26.680000, + "temp_f": 80.024001, + "humidity": 44.937500, + "pressure": 998.998901, + "altitude": 119.331436, + "broadband": 1266, + "infrared": 528, + "lux": 0 + } + }", + "ttl": 60, + "published_at": "2017-09-28T21:54:10.897Z", + "coreid": "123456789938323536", + "userid": "1234ee123ac8e5ec1231a123d", + "version": 10, + "public": false, + "productID": 1234, + "name": "sensor" + "influx_db": "mydata" + }` +} +func UnknowJSON() string { + return ` + { + "event": "roger" + }` +} diff --git a/plugins/inputs/webhooks/particle/particle_webhooks_test.go b/plugins/inputs/webhooks/particle/particle_webhooks_test.go index eecf26e14..c62e0f0c8 100644 --- a/plugins/inputs/webhooks/particle/particle_webhooks_test.go +++ b/plugins/inputs/webhooks/particle/particle_webhooks_test.go @@ -1,16 +1,17 @@ package particle import ( + "github.com/influxdata/telegraf/testutil" + "log" "net/http" "net/http/httptest" "strings" "testing" - - "github.com/influxdata/telegraf/testutil" ) func postWebhooks(rb *ParticleWebhook, eventBody string) *httptest.ResponseRecorder { req, _ := http.NewRequest("POST", "/", strings.NewReader(eventBody)) + log.Printf("eventBody: %s\n", eventBody) w := httptest.NewRecorder() w.Code = 500 @@ -20,10 +21,10 @@ func postWebhooks(rb *ParticleWebhook, eventBody string) *httptest.ResponseRecor } func TestNewItem(t *testing.T) { - t.Parallel() var acc testutil.Accumulator rb := &ParticleWebhook{Path: "/particle", acc: &acc} resp := postWebhooks(rb, NewItemJSON()) + log.Printf("Respnse: %s\n", resp.Body) if resp.Code != http.StatusOK { t.Errorf("POST new_item returned HTTP status code %v.\nExpected %v", resp.Code, http.StatusOK) } @@ -31,12 +32,12 @@ func TestNewItem(t *testing.T) { fields := map[string]interface{}{ "temp_c": 26.680000, "temp_f": 80.024001, - "infrared": 528.0, - "lux": 0.0, "humidity": 44.937500, "pressure": 998.998901, "altitude": 119.331436, - "broadband": 1266.0, + "broadband": 1266, + "infrared": 528, + "lux": 0, } tags := map[string]string{ @@ -44,54 +45,13 @@ func TestNewItem(t *testing.T) { "location": "TravelingWilbury", } - acc.AssertContainsTaggedFields(t, "temperature", fields, tags) + acc.AssertContainsTaggedFields(t, "particle_webhooks", fields, tags) } - func TestUnknowItem(t *testing.T) { - t.Parallel() - var acc testutil.Accumulator - rb := &ParticleWebhook{Path: "/particle", acc: &acc} + rb := &ParticleWebhook{Path: "/particle"} resp := postWebhooks(rb, UnknowJSON()) + log.Printf("Response: %s\n", resp.Body) if resp.Code != http.StatusOK { t.Errorf("POST unknown returned HTTP status code %v.\nExpected %v", resp.Code, http.StatusOK) } } - -func NewItemJSON() string { - return ` - { - "event": "temperature", - "data": { - "tags": { - "id": "230035001147343438323536", - "location": "TravelingWilbury" - }, - "values": { - "temp_c": 26.680000, - "temp_f": 80.024001, - "humidity": 44.937500, - "pressure": 998.998901, - "altitude": 119.331436, - "broadband": 1266, - "infrared": 528, - "lux": 0 - } - }, - "ttl": 60, - "published_at": "2017-09-28T21:54:10.897Z", - "coreid": "123456789938323536", - "userid": "1234ee123ac8e5ec1231a123d", - "version": 10, - "public": false, - "productID": 1234, - "name": "sensor", - "influx_db": "mydata" - }` -} - -func UnknowJSON() string { - return ` - { - "event": "roger" - }` -} From 0e0e91ef1e3fe4a1321bad97ae6e73e95038b232 Mon Sep 17 00:00:00 2001 From: "David G. Simmons" Date: Fri, 3 Nov 2017 13:28:54 -0400 Subject: [PATCH 6/6] Revert "New Particle Plugin" This reverts commit ba462f5c9474407160123cda908db7fdb4bb1daa. --- .txt | 0 plugins/inputs/webhooks/particle/README.md | 26 --------- .../webhooks/particle/particle_webhooks.go | 48 ---------------- .../particle/particle_webhooks_events.go | 22 ------- .../particle_webhooks_events_json_test.go | 39 ------------- .../particle/particle_webhooks_test.go | 57 ------------------- plugins/inputs/webhooks/webhooks.go | 5 -- plugins/inputs/webhooks/webhooks_test.go | 6 -- 8 files changed, 203 deletions(-) delete mode 100644 .txt delete mode 100644 plugins/inputs/webhooks/particle/README.md delete mode 100644 plugins/inputs/webhooks/particle/particle_webhooks.go delete mode 100644 plugins/inputs/webhooks/particle/particle_webhooks_events.go delete mode 100644 plugins/inputs/webhooks/particle/particle_webhooks_events_json_test.go delete mode 100644 plugins/inputs/webhooks/particle/particle_webhooks_test.go diff --git a/.txt b/.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/plugins/inputs/webhooks/particle/README.md b/plugins/inputs/webhooks/particle/README.md deleted file mode 100644 index 1212b742a..000000000 --- a/plugins/inputs/webhooks/particle/README.md +++ /dev/null @@ -1,26 +0,0 @@ -# particle webhooks - -You should configure your Rollbar's Webhooks to point at the `webhooks` service. To do this go to `particle.com/` and click `Settings > Notifications > Webhook`. In the resulting page set `URL` to `http://:1619/particle`, and click on `Enable Webhook Integration`. - -## Events - -Your Particle device should publish an event that contains a JSON in the form of: -``` -String data = String::format("{ \"tags\" : { - \"tag_name\": \"tag_value\", - \"other_tag\": \"other_value\" - }, - \"values\": { - \"value_name\": %f, - \"other_value\": %f, - } - }", value_value, other_value - ); - Particle.publish("event_name", data, PRIVATE); -``` -Escaping the "" is required in the source file. -The number of tag values and field values is not restrictied so you can send as many values per webhook call as you'd like. - -You will need to enable JSON messages in the Webhooks setup of Particle.io - -See [webhook doc](https://docs.particle.io/reference/webhooks/) diff --git a/plugins/inputs/webhooks/particle/particle_webhooks.go b/plugins/inputs/webhooks/particle/particle_webhooks.go deleted file mode 100644 index 813bd0665..000000000 --- a/plugins/inputs/webhooks/particle/particle_webhooks.go +++ /dev/null @@ -1,48 +0,0 @@ -package particle - -import ( - "encoding/json" - "github.com/gorilla/mux" - "github.com/influxdata/telegraf" - "io/ioutil" - "log" - "net/http" - "time" -) - -type ParticleWebhook struct { - Path string - acc telegraf.Accumulator -} - -func (rb *ParticleWebhook) Register(router *mux.Router, acc telegraf.Accumulator) { - router.HandleFunc(rb.Path, rb.eventHandler).Methods("POST") - log.Printf("I! Started the webhooks_particle on %s\n", rb.Path) - rb.acc = acc -} - -func (rb *ParticleWebhook) eventHandler(w http.ResponseWriter, r *http.Request) { - defer r.Body.Close() - data, err := ioutil.ReadAll(r.Body) - if err != nil { - w.WriteHeader(http.StatusBadRequest) - return - } - dummy := &DummyData{} - if err := json.Unmarshal(data, dummy); err != nil { - w.WriteHeader(http.StatusBadRequest) - return - } - pd := &ParticleData{} - if err := json.Unmarshal([]byte(dummy.Data), pd); err != nil { - w.WriteHeader(http.StatusBadRequest) - return - } - pTime, err := dummy.Time() - if err != nil { - log.Printf("Time Conversion Error") - pTime = time.Now() - } - rb.acc.AddFields(dummy.InfluxDB, pd.Fields, pd.Tags, pTime) - w.WriteHeader(http.StatusOK) -} diff --git a/plugins/inputs/webhooks/particle/particle_webhooks_events.go b/plugins/inputs/webhooks/particle/particle_webhooks_events.go deleted file mode 100644 index 089536525..000000000 --- a/plugins/inputs/webhooks/particle/particle_webhooks_events.go +++ /dev/null @@ -1,22 +0,0 @@ -package particle - -import ( - "time" -) - -type DummyData struct { - Event string `json:"event"` - Data string `json:"data"` - Ttl int `json:"ttl"` - PublishedAt string `json:"published_at"` - InfluxDB string `json:"influx_db"` -} -type ParticleData struct { - Event string `json:"event"` - Tags map[string]string `json:"tags"` - Fields map[string]interface{} `json:"values"` -} - -func (d *DummyData) Time() (time.Time, error) { - return time.Parse("2006-01-02T15:04:05Z", d.PublishedAt) -} diff --git a/plugins/inputs/webhooks/particle/particle_webhooks_events_json_test.go b/plugins/inputs/webhooks/particle/particle_webhooks_events_json_test.go deleted file mode 100644 index aef0537e9..000000000 --- a/plugins/inputs/webhooks/particle/particle_webhooks_events_json_test.go +++ /dev/null @@ -1,39 +0,0 @@ -package particle - -func NewItemJSON() string { - return ` - { - "event": "temperature", - "data": "{ - "tags": { - "id": "230035001147343438323536", - "location": "TravelingWilbury" - }, - "values": { - "temp_c": 26.680000, - "temp_f": 80.024001, - "humidity": 44.937500, - "pressure": 998.998901, - "altitude": 119.331436, - "broadband": 1266, - "infrared": 528, - "lux": 0 - } - }", - "ttl": 60, - "published_at": "2017-09-28T21:54:10.897Z", - "coreid": "123456789938323536", - "userid": "1234ee123ac8e5ec1231a123d", - "version": 10, - "public": false, - "productID": 1234, - "name": "sensor" - "influx_db": "mydata" - }` -} -func UnknowJSON() string { - return ` - { - "event": "roger" - }` -} diff --git a/plugins/inputs/webhooks/particle/particle_webhooks_test.go b/plugins/inputs/webhooks/particle/particle_webhooks_test.go deleted file mode 100644 index c62e0f0c8..000000000 --- a/plugins/inputs/webhooks/particle/particle_webhooks_test.go +++ /dev/null @@ -1,57 +0,0 @@ -package particle - -import ( - "github.com/influxdata/telegraf/testutil" - "log" - "net/http" - "net/http/httptest" - "strings" - "testing" -) - -func postWebhooks(rb *ParticleWebhook, eventBody string) *httptest.ResponseRecorder { - req, _ := http.NewRequest("POST", "/", strings.NewReader(eventBody)) - log.Printf("eventBody: %s\n", eventBody) - w := httptest.NewRecorder() - w.Code = 500 - - rb.eventHandler(w, req) - - return w -} - -func TestNewItem(t *testing.T) { - var acc testutil.Accumulator - rb := &ParticleWebhook{Path: "/particle", acc: &acc} - resp := postWebhooks(rb, NewItemJSON()) - log.Printf("Respnse: %s\n", resp.Body) - if resp.Code != http.StatusOK { - t.Errorf("POST new_item returned HTTP status code %v.\nExpected %v", resp.Code, http.StatusOK) - } - - fields := map[string]interface{}{ - "temp_c": 26.680000, - "temp_f": 80.024001, - "humidity": 44.937500, - "pressure": 998.998901, - "altitude": 119.331436, - "broadband": 1266, - "infrared": 528, - "lux": 0, - } - - tags := map[string]string{ - "id": "230035001147343438323536", - "location": "TravelingWilbury", - } - - acc.AssertContainsTaggedFields(t, "particle_webhooks", fields, tags) -} -func TestUnknowItem(t *testing.T) { - rb := &ParticleWebhook{Path: "/particle"} - resp := postWebhooks(rb, UnknowJSON()) - log.Printf("Response: %s\n", resp.Body) - if resp.Code != http.StatusOK { - t.Errorf("POST unknown returned HTTP status code %v.\nExpected %v", resp.Code, http.StatusOK) - } -} diff --git a/plugins/inputs/webhooks/webhooks.go b/plugins/inputs/webhooks/webhooks.go index 794b55168..698cde159 100644 --- a/plugins/inputs/webhooks/webhooks.go +++ b/plugins/inputs/webhooks/webhooks.go @@ -15,7 +15,6 @@ import ( "github.com/influxdata/telegraf/plugins/inputs/webhooks/github" "github.com/influxdata/telegraf/plugins/inputs/webhooks/mandrill" "github.com/influxdata/telegraf/plugins/inputs/webhooks/papertrail" - "github.com/influxdata/telegraf/plugins/inputs/webhooks/particle" "github.com/influxdata/telegraf/plugins/inputs/webhooks/rollbar" ) @@ -35,7 +34,6 @@ type Webhooks struct { Mandrill *mandrill.MandrillWebhook Rollbar *rollbar.RollbarWebhook Papertrail *papertrail.PapertrailWebhook - Particle *particle.ParticleWebhook srv *http.Server } @@ -64,9 +62,6 @@ func (wb *Webhooks) SampleConfig() string { [inputs.webhooks.papertrail] path = "/papertrail" - - [inputs.webhooks.particle] - path = "/particle" ` } diff --git a/plugins/inputs/webhooks/webhooks_test.go b/plugins/inputs/webhooks/webhooks_test.go index 1a5fa4aa1..6d3448870 100644 --- a/plugins/inputs/webhooks/webhooks_test.go +++ b/plugins/inputs/webhooks/webhooks_test.go @@ -6,7 +6,6 @@ import ( "github.com/influxdata/telegraf/plugins/inputs/webhooks/github" "github.com/influxdata/telegraf/plugins/inputs/webhooks/papertrail" - "github.com/influxdata/telegraf/plugins/inputs/webhooks/particle" "github.com/influxdata/telegraf/plugins/inputs/webhooks/rollbar" ) @@ -34,9 +33,4 @@ func TestAvailableWebhooks(t *testing.T) { if !reflect.DeepEqual(wb.AvailableWebhooks(), expected) { t.Errorf("expected to be %v.\nGot %v", expected, wb.AvailableWebhooks()) } - wb.Particle = &particle.ParticleWebhook{Path: "/particle"} - expected = append(expected, wb.Particle) - if !reflect.DeepEqual(wb.AvailableWebhooks(), expected) { - t.Errorf("expected to be %v.\nGot %v", expected, wb.AvailableWebhooks()) - } }