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

[Enhancement] add output kafka support for zstd #40880

Merged
merged 19 commits into from
Oct 23, 2024

Conversation

gwy1995
Copy link
Contributor

@gwy1995 gwy1995 commented Sep 18, 2024

Proposed commit message

add output kafka support for zstd

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.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Disruptive User Impact

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Use cases

Screenshots

Logs

@gwy1995 gwy1995 requested review from a team as code owners September 18, 2024 10:11
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Sep 18, 2024
Copy link

cla-checker-service bot commented Sep 18, 2024

💚 CLA has been signed

Copy link
Contributor

mergify bot commented Sep 18, 2024

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @gwy1995? 🙏.
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-8./d is the label to automatically backport to the 8./d branch. /d is the digit

Copy link
Contributor

mergify bot commented Sep 18, 2024

backport-8.x has been added to help with the transition to the new branch 8.x.
If you don't need it please use backport-skip label and remove the backport-8.x label.

@mergify mergify bot added the backport-8.x Automated backport to the 8.x branch with mergify label Sep 18, 2024
@pierrehilbert pierrehilbert added the Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team label Sep 18, 2024
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Sep 18, 2024
@elasticmachine
Copy link
Collaborator

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

@pierrehilbert pierrehilbert requested review from faec and leehinman and removed request for khushijain21 and VihasMakwana September 18, 2024 11:39
@pierrehilbert
Copy link
Collaborator

Hello @gwy1995
Thanks for your contribution.
Could you please sign our CLA?

@gwy1995
Copy link
Contributor Author

gwy1995 commented Sep 19, 2024

Hello @gwy1995 Thanks for your contribution. Could you please sign our CLA?

I have signed it for three times , but it still shows as unsigned in this issue. What should I do ?

@pierrehilbert
Copy link
Collaborator

Did you sign it with the same email than your github account?

@gwy1995
Copy link
Contributor Author

gwy1995 commented Sep 20, 2024

Did you sign it with the same email than your github account?

yes, I have sign it today and yesterday for more than three times.

@faec
Copy link
Contributor

faec commented Sep 20, 2024

Hi @gwy1995, we can try figuring out where the CLA checker is having trouble, but another issue I notice is that you removed Elastic's sarama fork and replaced it with an older (downgraded) upstream version. (See the readme in the fork for details.) The fork includes fixes for serious issues, so any changes to the sarama version should either update the fork's base version, or update to a mainline version that includes the fixes we need.

@gwy1995
Copy link
Contributor Author

gwy1995 commented Sep 23, 2024

Hi @gwy1995, we can try figuring out where the CLA checker is having trouble, but another issue I notice is that you removed Elastic's sarama fork and replaced it with an older (downgraded) upstream version. (See the readme in the fork for details.) The fork includes fixes for serious issues, so any changes to the sarama version should either update the fork's base version, or update to a mainline version that includes the fixes we need.

Thanks for reminding me of this. I have rolled back the sarama version.
I found that the elastic version of sarama has merged the changes required by zstd, so just add one line of configuration. I wrote the details in the comments.Please take another look

@leehinman
Copy link
Contributor

looks good. Any chance you could add a test case to

func TestKafkaPublish(t *testing.T) {
?

@gwy1995
Copy link
Contributor Author

gwy1995 commented Sep 24, 2024

looks good. Any chance you could add a test case to

func TestKafkaPublish(t *testing.T) {

?

I add a test case. But I don't know why it didn't pass CI. I have tested it in the local environment.

@pierrehilbert
Copy link
Collaborator

/test

Copy link
Contributor

mergify bot commented Oct 17, 2024

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b feature/kafka_add_zstd upstream/feature/kafka_add_zstd
git merge upstream/main
git push upstream feature/kafka_add_zstd

@leehinman
Copy link
Contributor

/test

@pierrehilbert
Copy link
Collaborator

/test

@pierrehilbert
Copy link
Collaborator

@gwy1995 Could you please retry to sign the CLA?
This is a mandatory step to be able to merge your PR.

@gwy1995
Copy link
Contributor Author

gwy1995 commented Oct 21, 2024

@gwy1995 Could you please retry to sign the CLA? This is a mandatory step to be able to merge your PR.

hi, I finally successfully signed the CLA

@pierrehilbert
Copy link
Collaborator

/test

@pierrehilbert
Copy link
Collaborator

We have a failing test @gwy1995

=== Failed
--
  | === FAIL: libbeat/outputs/kafka TestKafkaPublish/run_test(13):_publish_message_with_zstd_compression_to_test_topic (0.00s)
  | kafka_integration_test.go:278: unknown/unsupported kafka version '2.2.2' accessing 'version'

@gwy1995
Copy link
Contributor Author

gwy1995 commented Oct 22, 2024

We have a failing test @gwy1995

=== Failed
--
  | === FAIL: libbeat/outputs/kafka TestKafkaPublish/run_test(13):_publish_message_with_zstd_compression_to_test_topic (0.00s)
  | kafka_integration_test.go:278: unknown/unsupported kafka version '2.2.2' accessing 'version'

I have changed version, could you please test again

@pierrehilbert
Copy link
Collaborator

/test

@pierrehilbert
Copy link
Collaborator

/test

@gwy1995
Copy link
Contributor Author

gwy1995 commented Oct 23, 2024

We have a failing test @gwy1995

=== Failed
--
  | === FAIL: libbeat/outputs/kafka TestKafkaPublish/run_test(13):_publish_message_with_zstd_compression_to_test_topic (0.00s)
  | kafka_integration_test.go:278: unknown/unsupported kafka version '2.2.2' accessing 'version'

I have changed version, could you please test again

tests are passed?

@pierrehilbert
Copy link
Collaborator

run docs-build

@pierrehilbert
Copy link
Collaborator

Looks good to go!
Thanks for your contribution

@pierrehilbert pierrehilbert merged commit 77e7d80 into elastic:main Oct 23, 2024
142 checks passed
mergify bot pushed a commit that referenced this pull request Oct 23, 2024
* add output kafka support for zstd

* add docs

* add docs

* revert go mod

* add more comments

* add kafka_integration_test

* modify test

* modify test

* modify test

* modify test

* add test

* fixes for linter

* change comment

* change version

* change version

---------

Co-authored-by: weiye.gong <weiye.gong@garena.com>
Co-authored-by: Lee E. Hinman <lee.e.hinman@elastic.co>
Co-authored-by: Pierre HILBERT <pierre.hilbert@elastic.co>
(cherry picked from commit 77e7d80)
pierrehilbert pushed a commit that referenced this pull request Oct 23, 2024
* add output kafka support for zstd

* add docs

* add docs

* revert go mod

* add more comments

* add kafka_integration_test

* modify test

* modify test

* modify test

* modify test

* add test

* fixes for linter

* change comment

* change version

* change version

---------

Co-authored-by: weiye.gong <weiye.gong@garena.com>
Co-authored-by: Lee E. Hinman <lee.e.hinman@elastic.co>
Co-authored-by: Pierre HILBERT <pierre.hilbert@elastic.co>
(cherry picked from commit 77e7d80)

Co-authored-by: zero <164434719@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-8.x Automated backport to the 8.x branch with mergify 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.

6 participants