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 per-host shard metrics if configured #3819

Merged

Conversation

grubernaut
Copy link
Contributor

@grubernaut grubernaut commented Feb 22, 2018

Allows users to get per-host shard metrics from shardConnPoolStats.

Since this adds additional measurement from the mongodb plugin, it is
configured via the telegraf configuration file.

Also adds unit test and documentation for the changeset.

Required for all PRs:

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

Allows users to get per-host shard metrics from `shardConnPoolStats`.

Since this adds additional measurement from the `mongodb` plugin, it is
configured via the telegraf configuration file.

Also adds unit test and documentation for the changeset.
@danielnelson
Copy link
Contributor

Since it doesn't take another request to get this data, I don't think we need an option to control it. Users can remove it using the normal measurement filtering options.

@danielnelson danielnelson added feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin area/mongodb labels Mar 5, 2018
@grubernaut
Copy link
Contributor Author

@danielnelson awesome, makes sense. Sorry for late reply, was on vacation, will fix and push an update by EOD.

Gather's per-host shard metrics by default, allowing users to opt-out if needed/wanted.
@grubernaut
Copy link
Contributor Author

AppVeyor seems to be failing from a non-related issue:

ERROR restoring some imports:
-   Error cloning repo at C:\gopath\src\github.com\stretchr\objx, exit status 128
-   Error cloning repo at C:\gopath\src\github.com\StackExchange\wmi, exit status 128
-   Error cloning repo at C:\gopath\src\github.com\streadway\amqp, exit status 128
-   Error cloning repo at C:\gopath\src\github.com\stretchr\testify, exit status 128
-   Error cloning repo at C:\gopath\src\github.com\tidwall\gjson, exit status 128
-   Error cloning repo at C:\gopath\src\github.com\yuin\gopher-lua, exit status 128
-   Error cloning repo at C:\gopath\src\github.com\vjeantet\grok, exit status 128
-   Error cloning repo at C:\gopath\src\github.com\tidwall\match, exit status 128
-   Error cloning repo at C:\gopath\src\github.com\wvanbergen\kafka, exit status 128
-   Error cloning repo at C:\gopath\src\github.com\wvanbergen\kazoo-go, exit status 128
Error cloning repo at C:\gopath\src\github.com\zensqlmonitor\go-mssqldb, exit status 128
make: *** [deps] Error 1

@danielnelson
Copy link
Contributor

Looks like a network issue, hopefully it will clear up soon and I'll try to run the build again periodically.

@danielnelson
Copy link
Contributor

Appveyor team helped me get the tests running again.

@grubernaut
Copy link
Contributor Author

@danielnelson, fixed merge conflicts, any target release to be able to include this? Thanks again! 🎉

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.

Looks good, just a few questions I had around naming. Also can you update the README changes since I modified the README style a bit recently.

@@ -179,4 +203,14 @@ func (d *MongodbData) flush(acc telegraf.Accumulator) {
)
db.Fields = make(map[string]interface{})
}
for _, host := range d.ShardHostData {
d.Tags["shard_host_name"] = host.Name
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be just hostname to match existing tags in other measurements?

for _, host := range d.ShardHostData {
d.Tags["shard_host_name"] = host.Name
acc.AddFields(
"mongodb_shard_host_stats",
Copy link
Contributor

Choose a reason for hiding this comment

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

Would this be better as mongodb_shard_stats since we have mongodb_db_stats?

@danielnelson danielnelson added this to the 1.7.0 milestone Apr 10, 2018
@grubernaut
Copy link
Contributor Author

@danielnelson updated! thanks for taking a look!

@danielnelson danielnelson merged commit 32f5614 into influxdata:master Apr 11, 2018
@danielnelson
Copy link
Contributor

Merged for 1.7, thanks!

@grubernaut grubernaut deleted the mongo-input-per-host-metrics branch April 11, 2018 03:54
@grubernaut
Copy link
Contributor Author

Awesome, thanks!

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
area/mongodb 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.

2 participants