-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Add per-host shard metrics if configured #3819
Conversation
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.
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 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.
AppVeyor seems to be failing from a non-related issue:
|
Looks like a network issue, hopefully it will clear up soon and I'll try to run the build again periodically. |
Appveyor team helped me get the tests running again. |
@danielnelson, fixed merge conflicts, any target release to be able to include this? Thanks again! 🎉 |
There was a problem hiding this 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 |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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
?
36ef4f8
to
398e443
Compare
@danielnelson updated! thanks for taking a look! |
Merged for 1.7, thanks! |
Awesome, thanks! |
Allows users to get per-host shard metrics from
shardConnPoolStats
.Since this adds additional measurement from the
mongodb
plugin, it isconfigured via the telegraf configuration file.
Also adds unit test and documentation for the changeset.
Required for all PRs: