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

Cherry-pick #19531 to 7.x: Add docker logs support to the Elastic Log Driver #19808

Merged
merged 1 commit into from
Jul 9, 2020

Conversation

fearful-symmetry
Copy link
Contributor

@fearful-symmetry fearful-symmetry commented Jul 9, 2020

Cherry-pick of PR #19531 to 7.x branch. Original message:

What does this PR do?

See #19371 and #13990

This PR adds support for the docker logs command to the Elastic Log Driver. This basically re-implements the "default" log driver, using Docker's own libraries, inside the Elastic Log Driver. In theory this should be a simple addition, as we're just gluing existing libraries on top on what we already have.

There's still some oddities going on here:

  • We're getting interesting error messages if you run docker logs -f for an expended period of time without additional log lines: Error grabbing logs: error decoding log message: net/http: request canceled (Client.Timeout exceeded while reading body) This doesn't seem to be something in my library. Looks like it was due to this PR here: add a 10s timeout to the client object. docker/cli#1872

Why is it important?

This is a "must have" from the Cloud folks, and it's good to have in general. Also required for docker certification.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

How to test this PR locally

  1. build and install the plugin via mage buildAndInstall
  2. Checkout the main readme in dockerlogbeat for an example of how to run the plugin against a container
  3. Run the docker logs command against that container with various options, make sure everything works as expected.

* init commit of docker logs support

* remove vendor

* fix tests

* mage fmt

* code cleanup

* change logging directories around, add code to remove containers

* remove error message on EOF

* fix config, add docs

* more fixes, migrate to writing logs to docker's own location

* add changelog entry

* docs cleanup

(cherry picked from commit d53cd12)
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jul 9, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations (Team:Integrations)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jul 9, 2020
@fearful-symmetry fearful-symmetry requested a review from a team July 9, 2020 17:28
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Pull request #19808 opened]

  • Start Time: 2020-07-09T17:26:31.734+0000

  • Duration: 31 min 28 sec

Test stats 🧪

Test Results
Failed 0
Passed 3
Skipped 0
Total 3

Steps errors

Expand to view the steps failures

  • Name: Report to Codecov
    • Description: curl -sSLo codecov https://codecov.io/bash for i in auditbeat filebeat heartbeat libbeat metricbeat packetbeat winlogbeat journalbeat do FILE="${i}/build/coverage/full.cov" if [ -f "${FILE}" ]; then bash codecov -f "${FILE}" fi done

    • Duration: 2 min 22 sec

    • Start Time: 2020-07-09T17:55:10.969+0000

    • log

@fearful-symmetry fearful-symmetry merged commit e98544a into elastic:7.x Jul 9, 2020
@zube zube bot removed the [zube]: Done label Oct 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport Team:Integrations Label for the Integrations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants