-
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 Kibana input plugin #4585
Add Kibana input plugin #4585
Conversation
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.
Looking good, any idea if we need to be concerned about elasticsearch version differences?
plugins/inputs/kibana/README.md
Outdated
```toml | ||
[[inputs.kibana]] | ||
## specify a list of one or more Kibana servers | ||
# you can add username and password to your url to use basic authentication: |
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.
Let's add a username
and password
option that will be shared among all servers. It also looks like this doesn't do basic authentication, we are just sending these in the userinfo section of the URL. Basic auth would be sending the data in the Authorization header https://tools.ietf.org/html/rfc7617.
I greatly prefer using basic auth instead, the userinfo section is deprecated: https://tools.ietf.org/html/rfc3986#section-3.2.1
plugins/inputs/kibana/README.md
Outdated
- name (Kibana reported name) | ||
- uuid (Kibana reported UUID) | ||
- version (Kibana version) | ||
- server (Kibana server hostname or IP) |
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.
Let's use the origin
style as described in #4413
plugins/inputs/kibana/kibana.go
Outdated
|
||
client *http.Client | ||
catMasterResponseTokens []string | ||
isMaster bool |
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 think we can remove isMaster
and catMasterResponseTokens
. It doesn't look like they are used.
plugins/inputs/kibana/kibana.go
Outdated
type Kibana struct { | ||
Local bool | ||
Servers []string | ||
HttpTimeout internal.Duration |
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.
Nitpick, HTTPTimeout or perhaps we just call it timeout.
plugins/inputs/kibana/kibana.go
Outdated
return nil, err | ||
} | ||
tr := &http.Transport{ | ||
ResponseHeaderTimeout: k.HttpTimeout.Duration, |
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 don't think we need this timeout, its covered by the client timeout.
plugins/inputs/kibana/kibana.go
Outdated
// NOTE: we are not going to read/discard r.Body under the assumption we'd prefer | ||
// to let the underlying transport close the connection and re-establish a new one for | ||
// future calls. | ||
return "", fmt.Errorf("kibana: API responded with status-code %d, expected %d", |
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.
It seems like the transport should handle any errors for us with dead connections, can we remove this?
plugins/inputs/kibana/README.md
Outdated
### Tags | ||
|
||
- name (Kibana reported name) | ||
- uuid (Kibana reported UUID) |
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.
UUID tags are always a little scary, when would this value change?
plugins/inputs/kibana/README.md
Outdated
### Measurements & Fields | ||
|
||
- kibana | ||
- status: string (green, yellow, red) |
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.
Let's do status as a tag? This would be our normal enum pattern as seen in http_response/net_response.
@danielnelson thanks for the review, it should be better now.
Yes, indeed this plugin will work on Kibana 6.x (tested from 6.0 to 6.4), but not on previous versions as the status API returns a different structure. For that I added a note in the doc, do you think that's enough? |
That should be good, thanks again! |
Implements #4576
I tried to keep it simple and only collecting the metrics related to Kibana itself.
Required for all PRs: