-
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
gather elasticsearch indices and shard stats #2872
gather elasticsearch indices and shard stats #2872
Conversation
@danielnelson Much easier with a new fork. I'd accumulated too much while the old one was open over the last 8 months. Thanks for your patience. |
@danielnelson The circle test failed, but unless I'm reading it incorrectly, its unrelated to any changes of mine. Specifically, the inputs/elasticsearch test did complete OK. The only error I noted was: --- FAIL: TestMemcachedGeneratesMetrics (0.00s) |
clusterFields := map[string]interface{}{ | ||
"cluster_name": healthStats.ClusterName, |
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.
If I understand correctly this is adding a new field named cluster_name
after having changed the previous tag cluster_name
to name
with the exact same information. Is there any reason for this?
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.
Presumably better to simply contain this information in the cluster_name tag.
indexFields := map[string]interface{}{ | ||
"index_name": 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.
any reason to have index_name
as field and as a tag at same time?
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.
I can get rid of the redundant (non-tag) index_name.
@mhohara I will try to test this soon, you need to update the README after the latest changes |
@lpic10 Readme updated. And thanks for looking at this. |
@mhohara @lpic10 any ETA for the indicestats feature? |
@lpic10 Any progress on your review? |
👍 |
@danielnelson @lpic10 Any progress here? I don't see much in the way of other updates to the ES plugin as of yet. |
Are you waiting for something from me on those two? |
No, but you are certainly welcome to give fixing #2650 a shot. |
@danielnelson I'm not sure I understand the issue in #2650 . Could the e.masterNodeId from the catmaster be compared to a cat/nodeattrs call to localhost:9200 to get the NodeId of the node its on, to see whether 'it' is the master? |
The problem is that there is a race condition, each server is collected concurrently via the anonymous goroutine in Gather, so the order in which e.isMaster is assigned too here is not defined. The isMaster value should probably not be a field on the plugin struct. |
In this PR's version of the code, the isMaster flag is only used in the Gather routine. Perhaps the necessary ES API calls to determine whether the node that telegraf is running on is the cluster master need to be put into the Gather routine? |
I remember the PR code did not fix the problem, the routine that determines master status is less important than not storing it on the struct where it will be available/overwritten by other routines. |
The flag was put in the struct because it is the only output of the gatherNodeStats routine which did the ES API calls to get the node information and hence could decide whether a node was master. So it seemed the best/only way to return the isMaster information back to the calling Gather routine. Moving |
Is this abandoned? Do you need help? I am interested in this feature. |
@hgfischer We need to address #2650 and #2711 before completing this issue. |
Closed in #6060 |
Required for all PRs: