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

add AVRO/Flume logger driver #26215

Closed
wants to merge 1 commit into from

Conversation

sebglon
Copy link

@sebglon sebglon commented Aug 31, 2016

- What I did
Adding ne logger plugin for Flume Avro protocol
- How I did it
#23978

Send log container message on Apache flume with Avro protocol
add new library sebglon/goavro and snappy library
- How to verify it
Run docker with new flume-avro logger
dockerd --log-driver=flume-avro --log-opt avro-host=<IP of flume> --log-opt avro-port=<flume port>
Run container
docker run --rm hello-world
And show log message on your flume

Example AvroFlumeEvent:

{ headers:{image_name=hello-world, container_name=/boring_heyrovsky, container_created=1472212849, daemon_name=docker, host=439c0ae46a3d, source=stdout, image_id=sha256:c54a2cc56cbb2f04003c1cd4507e118af7c0d340fe7e2720f70976c4b75237dc, partial=false, command=/hello, container_id=40682c62d234bf3b2218e5536973253afdbc68f06bcc5428e819a36e3bf8d015, timestamp=2016-08-26 12:00:49.935212928 +0000 UTC} body: 54 68 69 73 20 6D 65 73 73 61 67 65 20 73 68 6F This message sho }

- Description for the changelog

New logger driver for Apache Flume

@sebglon
Copy link
Author

sebglon commented Aug 31, 2016

@vdemeester, @cpuguy83 @LK4D4
Error to rebase branch on PR #26042

Issue for external logging plugin #18604

@sebglon sebglon force-pushed the 3978-avro_logger_driver branch 2 times, most recently from 1d28d1a to b5fb372 Compare August 31, 2016 21:08
@sebglon
Copy link
Author

sebglon commented Sep 4, 2016

@thaJeztah can you help pe to validate
ping @bfirsh @sirupsen

@sebglon sebglon force-pushed the 3978-avro_logger_driver branch 10 times, most recently from 86a375c to ab16a64 Compare September 8, 2016 14:23
update to goavro with tcp pool

Signed-off-by: Sébastien GLON <glon.sebastien@free.fr>
@sebglon
Copy link
Author

sebglon commented Sep 8, 2016

End of work;

@thaJeztah
Copy link
Member

ping @cpuguy83 @tiborvass WDYT?

@sebglon
Copy link
Author

sebglon commented Oct 10, 2016

What is the next step. How can i plan to use them on production?

@thaJeztah thaJeztah added the status/needs-attention Calls for a collective discussion during a review session label Oct 10, 2016
@thaJeztah
Copy link
Member

thaJeztah commented Oct 14, 2016

Thanks for being patient @sebglon. I brought this PR up in our maintainers meeting / review session. We are still looking for ways to make logging drivers "pluggable" so that we don't have to include all the dependencies in the main docker binary (which we will have to maintain).

Since I was not familiar with "Flume", and not sure how popular it is as a choice, I asked around, and was told that Flume also has an option to integrate with syslog; would that be an option?

In addition, I've understood that Flume is popular for Hadoop users, but Kafka is getting more and more the choice for those users.

/cc @nathanleclaire @justincormack @stevvooe wdyt?

@nathanleclaire
Copy link
Contributor

Thanks for the PR @sebglon . As Sebastiaan noted, why not use something like the approach here: http://blog.thilinamb.com/2014/06/how-to-pump-syslog-data-into-flume.html with Docker's syslog log driver to send the logs to Flume? The daemon already has quite a bit of complexity/dependencies, so if we can make your use case work without having to modify the code directly, that'd be ideal.

@sebglon
Copy link
Author

sebglon commented Oct 17, 2016

Kafka can use avro message to send or consule log
syslog has message length limit that is not compatible with Java, python or Javascript stack (rsyslog truncated at 2097 characters)

I think i can make an evolution to send on kafka data. But now this is not supported by docker

@sebglon
Copy link
Author

sebglon commented Oct 17, 2016

Avro is a message protocol that can be use to exchange formated data with consumer.
Now i have implemented transceiver for Flume/Netty Transceiver.

In a few time i can test to send on kafka without another dependencies

@sebglon sebglon changed the title add Flume logger driver add AVRO/Flume logger driver Oct 17, 2016
@sebglon
Copy link
Author

sebglon commented Oct 17, 2016

Fluentd, Flume, Kafka can consume Avro message
Apache Avro™ is a data serialization system.

My code has not dependency for flume or another consumer but only implement Avro message and protocol.

This can be a good solution to limit Custom logger and dependencies to use Avro



# Avro lig for logger
clone git github.com/sebglon/goavro FEAT-IPC
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to have this merged upstream if we decide to accept this PR

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, what exactly is in this fork?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stevvooe
Copy link
Contributor

stevvooe commented Oct 17, 2016

While I don't see anything wrong with adding a new log driver, I'd like to better understand the make up of the avro-flume ecosystem. Is this approach enough or are we going to add new protocols? Is the structure of this driver flexible enough to add these changes in the future or does this hit a single company's use case?

The other issue I see is that the goavro implementation is a significant fork from upstream (linkedin/goavro, as far as I can tell). The fork doesn't seemed to be pass golint or follow the Go styleguide. Why that is not a show stopper, is does make me concerned about adopting this as a dependency.

Also, into the future, who would maintain this integration? How can we ensure this tracks the upstream implementations to be sufficiently useful and relevant?

@sebglon
Copy link
Author

sebglon commented Oct 17, 2016

Avro protocol is a big protocol that can be used to send formated and serialized data in many consumer.
This implementation is a need of my company but my personal objectif is to extend this driver to many consumer that can accept Avro message.

I think this is a good choice to externalise logging without custom product library.

Avro start exchange by sending an handshake to validate exchange format. But for me docker can define this format and all consumer can deserialisze this and transformt then to their need.

Actualy my client work with Flume but many client company use another Log consumer that accept avro.

@thaJeztah
Copy link
Member

We discussed this in the maintainers meeting, and after further discussion, we don't think we're comfortable with adding this driver. There's a first PoC of having external plugins for logging drivers #28403. which would be a great option to implement this, once ready

Thanks for contributing!

@thaJeztah thaJeztah closed this Nov 17, 2016
@cpuguy83
Copy link
Member

Log plugin support is now merged and should be part of 17.05.
I do not think we'll be accepting any new built-in log drivers.

Closing this. Any new log drivers should be implemented as a plugin at this point. If anyone wants to discuss this feel free to ping me on Slack, or come see me @ DockerCon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/needs-attention Calls for a collective discussion during a review session status/1-design-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants