-
Notifications
You must be signed in to change notification settings - Fork 18.7k
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
fluentd logger: support all options besides Unix sockets #19439
fluentd logger: support all options besides Unix sockets #19439
Conversation
|
||
"github.com/Sirupsen/logrus" | ||
"github.com/docker/docker/daemon/logger" | ||
"github.com/docker/docker/daemon/logger/loggerutils" | ||
"github.com/fluent/fluent-logger-golang/fluent" | ||
"github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/units" |
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.
this import is strange, you made a lot of detours, and the pkg doesn't exist
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.
Sorry, my IDE did something weird. Fixed.
Small change, otherwise LGTM |
@calavera addressed, thanks. |
Ping @LK4D4! |
This needs a rebase 😭 |
AFAICT this is because of 3cf82ff, which tries to solve the same problem in what I'd say isn't as good a solution. My solution would be to revert it. |
f.conn, err = net.DialTimeout("tcp", f.Config.FluentHost+":"+strconv.Itoa(f.Config.FluentPort), f.Config.Timeout) | ||
switch f.Config.FluentNetwork { | ||
case "tcp": | ||
f.conn, err = net.DialTimeout(f.Config.FluentNetwork, f.Config.FluentHost+":"+strconv.Itoa(f.Config.FluentPort), f.Config.Timeout) |
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 we move this host/port vs sock path into a helper function?
This way connect is just a single case and can potentially support other formats easily as well (e.g. "unixgram")
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.
For that matter, seems like we should just store host/port as a single field anyway.
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.
This is a third-party library. I suppose we don't want to fork it.
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.
oh damn, didn't notice we were in vendor here.
|
||
defaultHost = "127.0.0.1" | ||
defaultPort = 24224 | ||
defaultBufferLimit = 8 * 1024 * 1024 |
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'd personally prefer to keep this @ a 1MB buffer.
Consider you have 100 containers (which is not much) each with an 8MB buffer
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.
This would be changing the current buffer size. Happy to adjust, if you confirm we don't want stable "defaults" (technically it wasn't a default, it was hardcoded...).
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.
Also note that the dehaviour when exceeding the buffer size is pretty damn aggressive: the whole buffer is discarded. Again, third-party library.
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 looks better to keep it as 1MB. Users can change it if they want.
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.
To be clear, the last docker release is at 8MB AFAICT. I'm OK going with 1MB if we want, but that would be a change AFAICT.
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.
That is already discussed on #18041.
Please respect previous commits.
ping @tagomoris |
@@ -114,8 +162,6 @@ func ValidateLogOpt(cfg map[string]string) error { | |||
case "tag": | |||
case "labels": | |||
case "env": | |||
case "fail-on-startup-error": | |||
case "buffer-limit": |
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 it ok to just remove these options, without adding options newly added? (fluentd-buffer-limit
, fluentd-retry-limit
and others).
I added some comments. |
@pcarrier feel free to update your PR. |
ping @pcarrier can you address the comments? Trying to move things forward here |
On it. |
test this please |
Ping @SvenDowideit. |
Sorry for the slow response, been busy with other tasks. On it. |
This reverts commit 3cf82ff. Signed-off-by: Pierre Carrier <[email protected]>
This version supports async connections. Signed-off-by: Pierre Carrier <[email protected]>
Please sign your commits following these rules: $ git clone -b "pcarrier/19438-async-connections-to-fluentd" [email protected]:pcarrier/docker.git somewhere
$ cd somewhere
$ git rebase -i HEAD~4
editor opens
change each 'pick' to 'edit'
save the file and quit
$ git commit --amend -s --no-edit
$ git rebase --continue # and repeat the amend for each commit
$ git push -f Ammending updates the existing PR. You DO NOT need to open a new one. |
I don't understand.
|
Sorry @pcarrier, the commit do indeed look signed, I don't understand why the CI job is complaining (cc @thaJeztah). I guess we could ignore? |
docs LGTM, can you squash the last two commits? |
windows hitting flaky test #20922, restarting |
Mostly useful for #19438. Signed-off-by: Pierre Carrier <[email protected]>
@thaJeztah done :) |
cool, thanks, and looks like the "dco" check now also passed LGTM ping @vdemeester PTAL |
LGTM 🐰 |
Hm documentation fail looks to be a known issue in Hugo, because;
|
retest this please |
gccgo is hitting #21365 😢 restarting |
…ons-to-fluentd fluentd logger: support all options besides Unix sockets
Mostly useful for #19438.