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 Particle Webhook Plugin #3477

Merged
merged 3 commits into from
Nov 17, 2017
Merged

Add Particle Webhook Plugin #3477

merged 3 commits into from
Nov 17, 2017

Conversation

davidgs
Copy link
Contributor

@davidgs davidgs commented Nov 16, 2017

A Webhook Plugin for the Partricle.io platform

Required for all PRs:

  • [X ] Signed CLA.
  • [X ] Associated README.md updated.
  • [X ] Has appropriate unit tests.

A Webhook Plugin for the Partricle.io platform
defer r.Body.Close()
e := newEvent()
if err := json.NewDecoder(r.Body).Decode(e); err != nil {
log.Println(err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use rb.acc.AddError( here, which will log the message with a message about which plugin generated it and increment the error counter for the internal plugin.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, sounds good.

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would probably use AddError here too, unless you think it is better to not increment the gather error count.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error here can probably just be removed. It's not really an error, probably, so much as a "didn't work, but we can go on".

@danielnelson danielnelson added this to the 1.5.0 milestone Nov 16, 2017
@danielnelson danielnelson merged commit b813e2e into influxdata:master Nov 17, 2017
@danielnelson danielnelson mentioned this pull request Nov 17, 2017
3 tasks
aromeyer pushed a commit to aromeyer/telegraf that referenced this pull request May 19, 2018
maxunt pushed a commit that referenced this pull request Jun 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants