Skip to content
This repository has been archived by the owner on Sep 21, 2023. It is now read-only.

POC for logstash output #210

Merged
merged 3 commits into from
Jan 17, 2023
Merged

Conversation

leehinman
Copy link
Contributor

@leehinman leehinman commented Jan 5, 2023

What does this PR do?

Adds initial support for logstash output

still to do:

  • run integration tests with mage test:integration
  • support async go-lumber client
  • support bulk_max_size
  • support windowing
  • support load balancing
  • support backoff
  • determine if codecs are needed

Why is it important?

logstash is required output for shipper

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 made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
    - [ ] I have added an entry in CHANGELOG.md or CHANGELOG-developer.md.

Author's Checklist

  • [ ]

How to test this PR locally

  1. Build test binary
      mage build:binary
    
  2. Start logstash
      cd testing/environments/logstash 
      LOGSTASH_IMAGE_REF=docker.elastic.co/logstash/logstash:8.7.0-SNAPSHOT docker-compose up
    
  3. Run integration tests
      cd integration
      INTEGRATION_TEST_BINARY=../build/binaries/elastic-agent-shipper-8.7.0-darwin-aarch64/elastic-agent-shipper go test -v -run="TestLogstash*" -tags=integration
    

Related issues

still to do:
- support async go-lumber client
- support bulk_max_size
- support windowing
- support load balancing
- support backoff
- determine if codecs are needed

Closes elastic#129
@leehinman leehinman requested a review from a team as a code owner January 5, 2023 20:18
@leehinman leehinman requested review from cmacknz and fearful-symmetry and removed request for a team January 5, 2023 20:18
@mergify
Copy link
Contributor

mergify bot commented Jan 5, 2023

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @leehinman? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v8./d.0 is the label to automatically backport to the 8./d branch. /d is the digit

@leehinman leehinman requested a review from faec January 5, 2023 20:20
@leehinman leehinman added enhancement New feature or request Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team labels Jan 5, 2023
@elasticmachine
Copy link
Collaborator

elasticmachine commented Jan 5, 2023

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2023-01-17T20:04:46.358+0000

  • Duration: 16 min 0 sec

❕ Flaky test report

No test was executed to be analysed.

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

Copy link
Contributor

@faec faec left a comment

Choose a reason for hiding this comment

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

lgtm!

"github.com/stretchr/testify/require"
)

type LogstashEventStats struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: can we make this private?

lc.logger.Errorf("error reconnecting to logstash host: %w", err)
continue
}
// reset window size on reconnect
Copy link
Contributor

Choose a reason for hiding this comment

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

is this comment still needed?

@leehinman leehinman merged commit 43c5f5a into elastic:main Jan 17, 2023
@leehinman leehinman deleted the 129_logstash_output branch February 22, 2023 15:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement the Logstash output
3 participants