Skip to content
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

Merged
merged 3 commits into from Mar 21, 2016
Merged

fluentd logger: support all options besides Unix sockets #19439

merged 3 commits into from Mar 21, 2016

Conversation

pcarrier
Copy link
Contributor

Mostly useful for #19438.

@pcarrier pcarrier changed the title fluentd lgoger: support all options besides Unix sockets fluentd logger: support all options besides Unix sockets Jan 19, 2016

"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"
Copy link
Contributor

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

Copy link
Contributor Author

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.

@calavera
Copy link
Contributor

Small change, otherwise LGTM

@pcarrier
Copy link
Contributor Author

@calavera addressed, thanks.

@icecrime
Copy link
Contributor

Ping @LK4D4!

@calavera
Copy link
Contributor

This needs a rebase 😭

@pcarrier
Copy link
Contributor Author

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.

@GordonTheTurtle GordonTheTurtle added dco/no Automatically set by a bot when one of the commits lacks proper signature and removed dco/no Automatically set by a bot when one of the commits lacks proper signature labels Jan 30, 2016
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)
Copy link
Member

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")

Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

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.

@pcarrier
Copy link
Contributor Author

pcarrier commented Feb 2, 2016

@calavera @icecrime @LK4D4 what next?


defaultHost = "127.0.0.1"
defaultPort = 24224
defaultBufferLimit = 8 * 1024 * 1024
Copy link
Member

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

Copy link
Contributor Author

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...).

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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.

@LK4D4
Copy link
Contributor

LK4D4 commented Feb 2, 2016

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":
Copy link
Contributor

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).

@tagomoris
Copy link
Contributor

I added some comments.
And I've just released fluent-logger-golang v1.1.0 with async connect and unix domain support options. It may be better version to be vendored.

@LK4D4
Copy link
Contributor

LK4D4 commented Feb 10, 2016

@pcarrier feel free to update your PR.

@thaJeztah
Copy link
Member

ping @pcarrier can you address the comments? Trying to move things forward here

@pcarrier
Copy link
Contributor Author

On it.

@GordonTheTurtle GordonTheTurtle added dco/no Automatically set by a bot when one of the commits lacks proper signature and removed dco/no Automatically set by a bot when one of the commits lacks proper signature labels Feb 15, 2016
@thaJeztah
Copy link
Member

ping @cpuguy83 @LK4D4 PR's was updated, PTAL

@pcarrier will update the fluentd.md file with the new options during docs-review

(Thanks for updating @pcarrier!)

@icecrime
Copy link
Contributor

test this please

@icecrime
Copy link
Contributor

Ping @SvenDowideit.

@icecrime icecrime added the status/failing-ci Indicates that the PR in its current state fails the test suite label Feb 29, 2016
@pcarrier
Copy link
Contributor Author

Sorry for the slow response, been busy with other tasks. On it.

Pierre Carrier added 2 commits March 20, 2016 16:22
This reverts commit 3cf82ff.

Signed-off-by: Pierre Carrier <pierre@meteor.com>
This version supports async connections.

Signed-off-by: Pierre Carrier <pierre@meteor.com>
@GordonTheTurtle GordonTheTurtle added the dco/no Automatically set by a bot when one of the commits lacks proper signature label Mar 20, 2016
@GordonTheTurtle
Copy link

Please sign your commits following these rules:
https://github.com/docker/docker/blob/master/CONTRIBUTING.md#sign-your-work
The easiest way to do this is to amend the last commit:

$ git clone -b "pcarrier/19438-async-connections-to-fluentd" git@github.com: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.

@GordonTheTurtle GordonTheTurtle added the dco/no Automatically set by a bot when one of the commits lacks proper signature label Mar 20, 2016
@pcarrier
Copy link
Contributor Author

I don't understand.

% git log origin/master..pcarrier/19438-async-connections-to-fluentd
commit 7a29366b075f3b3cd7bc955a08afea2a6918c79c
Author: Pierre Carrier <pierre@meteor.com>
Date:   2016-03-20 16:30:46 +0000

    docs: fluentd-async-connect option

    Signed-off-by: Pierre Carrier <pierre@meteor.com>

commit d48eab75110f580022ff6af308241b4ce19957d1
Author: Pierre Carrier <pierre@meteor.com>
Date:   2016-01-24 05:51:03 -0800

    fluentd logger: support all options besides Unix sockets

    Mostly useful for docker/docker#19438.

    Signed-off-by: Pierre Carrier <pierre@meteor.com>

commit 9c2a0739fb9c5e3636425d669f0ab860ea1bfbae
Author: Pierre Carrier <pierre@meteor.com>
Date:   2016-01-19 00:07:13 -0800

    bump fluent-logger-golang version

    This version supports async connections.

    Signed-off-by: Pierre Carrier <pierre@meteor.com>

commit d89dae6e4becc16e80e3781ac68b9fbb855947b3
Author: Pierre Carrier <pierre@meteor.com>
Date:   2016-01-29 16:05:46 -0800

    Revert "Added flag to ignore fluentd connect error on container start"

    This reverts commit 3cf82ff1ab14e1ddd2b629524e894ac359168388.

    Signed-off-by: Pierre Carrier <pierre@meteor.com>

@icecrime
Copy link
Contributor

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?

@thaJeztah
Copy link
Member

docs LGTM, can you squash the last two commits?

@thaJeztah
Copy link
Member

windows hitting flaky test #20922, restarting

Mostly useful for #19438.

Signed-off-by: Pierre Carrier <pierre@meteor.com>
@GordonTheTurtle GordonTheTurtle removed the dco/no Automatically set by a bot when one of the commits lacks proper signature label Mar 21, 2016
@pcarrier
Copy link
Contributor Author

@thaJeztah done :)

@thaJeztah
Copy link
Member

cool, thanks, and looks like the "dco" check now also passed

LGTM

ping @vdemeester PTAL

@vdemeester
Copy link
Member

LGTM 🐰

@thaJeztah
Copy link
Member

Hm documentation fail looks to be a known issue in Hugo, because;

Found: 1119 files
Found: 0 errors

@thaJeztah
Copy link
Member

retest this please

@thaJeztah thaJeztah added this to the 1.11.0 milestone Mar 21, 2016
@thaJeztah
Copy link
Member

gccgo is hitting #21365 😢 restarting

vdemeester added a commit that referenced this pull request Mar 21, 2016
…ons-to-fluentd

fluentd logger: support all options besides Unix sockets
@vdemeester vdemeester merged commit d82ad12 into moby:master Mar 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet