-
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
Burrow input plugin #3489
Burrow input plugin #3489
Conversation
062a456
to
1a863dc
Compare
aff0fec
to
c721b8d
Compare
We are using this plugin (and custom build of telegraf) for about 5 days, and now plugin is feature complete and considered stable. |
Thanks @arkady-emelyanov, we will make sure to consider this in our planning. |
Any ETA on a potential merge? |
Burrow stable release update. Minimal supported version - Burrow v1.0.0 Changes:
|
aa62064
to
1f85c0e
Compare
plugins/inputs/burrow/README.md
Outdated
### Configuration | ||
|
||
``` | ||
## Burrow endpoints in format "sheme://[user:password@]host:port" |
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.
schema
?
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.
Yeah, typo. Fixed.
8740260
to
63ba09d
Compare
PR has been rebased to resolve conflicts, but now, circle-ci fails with
Which have no relations with plugin implementation, any thoughts? |
@arkady-emelyanov This is fixed now but you may need to rebase. |
63ba09d
to
aa683ed
Compare
@danielnelson now failure in statsd. Ok, i'll just wait for a few days and then do rebase again. |
aa683ed
to
6ad8772
Compare
@danielnelson still no ETA? :( |
Sorry about the delay, I'll schedule a review for 1.7 |
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.
@arkady-emelyanov I'm really impressed with how detailed you were with pr. However, I don't understand why we need to use channels for processing and returning values. From what I can see there are no long running requests so it would be much simpler to remove the channels. I think the only channel we need is for the connection semaphore.
plugins/inputs/burrow/README.md
Outdated
## e.g. | ||
## servers = ["http://localhost:8080"] | ||
## servers = ["https://example.com:8000"] | ||
## servers = ["http://user:[email protected]:8000"] |
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 suggest we remove support for the userinfo section of the URL. My experience with it in other plugins is that the escaping passwords is tricky for users and causes confusion about where the credentials end up being passed. I realize that this allows per server credentials but it may be better to require multiple plugin instantiations for this unless we expect this to be very common.
How about only using the username and password fields below?
plugins/inputs/burrow/README.md
Outdated
servers = [ "http://127.0.0.1:8000" ] | ||
|
||
## Prefix all HTTP API requests. | ||
#api_prefix = "/v3/kafka" |
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'm guessing this is so you can use the plugin with v2 or future versions? Can you add a list of versions that the plugin has been tested against.
plugins/inputs/burrow/README.md
Outdated
#topics = ["topicA"] | ||
|
||
## Concurrent connections limit (per server), default is 4. | ||
#max_concurrent_connections = 10 |
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.
Use default:
#max_concurrent_connections = 4
Or perhaps 10 is the actual default, in which case update the comment.
plugins/inputs/burrow/burrow.go
Outdated
func (b *burrow) Gather(acc telegraf.Accumulator) error { | ||
var workers sync.WaitGroup | ||
|
||
errorChan := b.getErrorChannel(acc) |
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.
Just pass in the Accumulator to avoid channels
plugins/inputs/burrow/burrow.go
Outdated
|
||
errorChan := b.getErrorChannel(acc) | ||
for _, addr := range b.Servers { | ||
c, err := b.getClient(acc, addr, errorChan) |
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.
Make the clients once on first run, guarded so it only runs once.
plugins/inputs/burrow/burrow.go
Outdated
} | ||
|
||
// enable SSL configuration (if provided by configuration) | ||
tlsCfg, err := internal.GetTLSConfig(b.SSLCert, b.SSLKey, b.SSLCA, b.InsecureSkipVerify) |
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.
Run once and share for all servers.
plugins/inputs/burrow/burrow.go
Outdated
// construct client | ||
c = apiClient{ | ||
client: http.Client{ | ||
Transport: &http.Transport{ |
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.
Use the same transport across plugin.
plugins/inputs/burrow/README.md
Outdated
#debug = false | ||
|
||
## Disable burrow_group measurement, default is false | ||
#disable_groups = false |
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.
Is this option related to the groups
option above? If so what we usually do is add an include/exclude option pair like in the docker input, these support globs:
groups_include = []
groups_exclude = []
plugins/inputs/burrow/README.md
Outdated
#worker_queue_length = 5 | ||
|
||
## Log requests and response codes, default is false | ||
#debug = false |
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.
Remove this option, you can just log at debug level D!
.
for _, cluster := range clusterList { | ||
escaped := url.PathEscape(cluster) | ||
producerChan <- apiCall{ | ||
URI: fmt.Sprintf("%s/%s/consumer", api.apiPrefix, escaped), |
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 suggest using the url package for creating urls.
6ad8772
to
6061716
Compare
ca5801d
to
6061716
Compare
b12eaf2
to
de39ff9
Compare
@danielnelson sorry for delay. Well, i made full rewrite of code, hope now, it feels in harmony with the rest of the plugins. Could you please take a look again? |
plugins/inputs/burrow/burrow.go
Outdated
var err error | ||
|
||
// compile glob patterns | ||
b.gClusters, err = makeGlobs(b.Clusters) |
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.
You can use filter.Compile(
for the globs, I believe it works in the same manner.
plugins/inputs/burrow/README.md
Outdated
|
||
## Filter out clusters by providing list of glob patterns. | ||
## Default is no filtering. | ||
# clusters = [] |
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.
Rename to clusters_exclude
so that in the future you can add cluster_include
, or add them both now and you can use filters.NewIncludeExcludeFilter(
. Also applies to groups
and topics
.
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.
Thanks, totally missed that filter
package is already present and very useful. I did include
/exclude
separation and replaced glob
with filter
.
"group": "", | ||
"topic": "" | ||
} | ||
} |
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.
Can you add a newline at the end of these json files?
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.
Done.
* newlines for json * use filter package * include/exclude options for clusters, groups and topics
68ba41c
to
091f728
Compare
Thanks @arkady-emelyanov, merged for 1.7! |
@danielnelson indeed. my longest PR ever :) |
Yeah, sorry about that. Hoping to add another maintainer soon. |
Required for all PRs:
This is another implementation of Burrow input plugin, completely rewritten and fully tested version of #2485
Besides, it supports Basic HTTP auth and SSL.
Burrow is a monitoring companion for Apache Kafka that provides consumer lag and topic offset checking.