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

Emqtt batch output #4094

Merged
merged 46 commits into from
May 19, 2018
Merged

Emqtt batch output #4094

merged 46 commits into from
May 19, 2018

Conversation

jvrahav
Copy link
Contributor

@jvrahav jvrahav commented May 3, 2018

Required for all PRs:

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

Copy link
Contributor

@danielnelson danielnelson left a comment

Choose a reason for hiding this comment

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

In addition to my comments below, can you update this PR to use the new SerializeBatch method that I added in #4107? This method will helps with outputting batches for formats that are not line oriented (currently JSON).

We will need to use the regular Serialize for non-batching mode to preserve backwards compatibility.

Lastly, can you fix the conflict caused by some unrelated changes on master.

@@ -543,6 +543,13 @@
# ## Use SSL but skip chain & host verification
Copy link
Contributor

Choose a reason for hiding this comment

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

Revert this file, I'll generate the telegraf.conf later from the sample configurations.

TopicPrefix string
QoS int `toml:"qos"`
ClientID string `toml:"client_id"`
BatchMessage bool `toml:"batch"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Add documentation for the new option into the SampleConfig(), then run telegraf -usage mqtt to get the output for updating the README.

@jvrahav
Copy link
Contributor Author

jvrahav commented May 11, 2018

using serializeBatch here does not help as we need to construct topic names based on each metric before serializing. Hence i believe we can retain serialize method for this plugin

@danielnelson
Copy link
Contributor

There will still be multiple telegraf.Metric going to a single topic though, if we send them together in a batch message we will need to use SerializeBatch in order to have the JSON data encode correctly. For influx and graphite output it will be the same, but for JSON the data shouldn't be line delimited because there are unicode characters that are newlines. Also, you can imagine serialization formats that cannot be delimited with newlines such as yaml/toml that we might want to support in the future.

@danielnelson danielnelson added the feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin label May 14, 2018
@jvrahav
Copy link
Contributor Author

jvrahav commented May 18, 2018

@danielnelson can you review the request. I wasnt able to remove the diff in telegraf conf file. I dont see any difference in my file locally.

@danielnelson danielnelson added this to the 1.7.0 milestone May 19, 2018
@danielnelson danielnelson merged commit 81f5a41 into influxdata:master May 19, 2018
@danielnelson
Copy link
Contributor

Thanks, this will be in 1.7.0.

leodido pushed a commit that referenced this pull request May 22, 2018
maxunt pushed a commit that referenced this pull request Jun 26, 2018
otherpirate pushed a commit to otherpirate/telegraf that referenced this pull request Mar 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants