Skip to content

Set x-elastic-product-origin header for ES requests #211

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

Conversation

donoghuc
Copy link
Contributor

@donoghuc donoghuc commented Nov 11, 2024

This commit updates the Elasticsearch::Client used to make requests to ES to send along a header identifying the request as originating from an internal component.

Closes #212

@@ -271,6 +271,8 @@ class LogStash::Inputs::Elasticsearch < LogStash::Inputs::Base

BUILD_FLAVOR_SERVERLESS = 'serverless'.freeze
DEFAULT_EAV_HEADER = { "Elastic-Api-Version" => "2023-10-31" }.freeze
# CODEREVIEW: What should the value be here? Logstash? Logstash-plugin?
INTERNAL_ORIGIN_HEADER = { 'x-elastic-internal-origin' => 'logstash-input-elasticsearch'}.freeze
Copy link
Contributor Author

Choose a reason for hiding this comment

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

What should the value be for plugins? Do we want it to be unique for each plugin? Do we want to indicate the request is coming from a plugin at all? Should it just be something even more generic like "logstash"?

@donoghuc donoghuc changed the title Set x-elastic-internal-origin header for ES requests Set x-elastic-product-origin header for ES requests Nov 12, 2024
@donoghuc donoghuc force-pushed the ID-4384-x-elastic-internal-origin-header branch 2 times, most recently from 1c54650 to 9fce225 Compare November 12, 2024 21:53
@donoghuc
Copy link
Contributor Author

donoghuc commented Dec 2, 2024

This should be ready for review. As far as release strategy... Is this something that we need to ensure goes in to a 4 series before releasing a new major version? If so, should i prepare a release as such?

@robbavey
Copy link
Contributor

robbavey commented Dec 3, 2024

This should be ready for review. As far as release strategy... Is this something that we need to ensure goes in to a 4 series before releasing a new major version? If so, should i prepare a release as such?

This one should be released on a new version on the 4.x branch. We need this for 8.x versions of Logstash.

Please update the version, and create a new minor.

This commit updates the `Elasticsearch::Client` used to make requests to ES to
send along a header identifying the request as originating from an internal
component.
Update version and add CHANGELOG entry.
@donoghuc donoghuc force-pushed the ID-4384-x-elastic-internal-origin-header branch from 9fce225 to a2e4241 Compare December 3, 2024 19:02
@donoghuc
Copy link
Contributor Author

donoghuc commented Dec 3, 2024

OK, Added a release prep commit. Once this is merged and tagged I can create a 4.x branch :)

Copy link
Contributor

@robbavey robbavey left a comment

Choose a reason for hiding this comment

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

LGTM!

@donoghuc
Copy link
Contributor Author

donoghuc commented Dec 5, 2024

@robbavey Shall I merge and release 4.20.5? I'm actually not 100% sure what all is involved in a plugin release. Maybe I can pair with @mashhurs on that.

@robbavey
Copy link
Contributor

robbavey commented Dec 5, 2024

@donoghuc Yes, please - go ahead, and squash and merge the commit.

The plugin publish github action is how we publish plugins, but please feel free to reach out to @mashhurs or any of us on any pointers on how to do so

@donoghuc donoghuc merged commit f49b710 into logstash-plugins:main Dec 5, 2024
1 of 2 checks passed
@robbavey
Copy link
Contributor

robbavey commented Dec 5, 2024

Perfect! Thank you!

Copy link
Contributor

@mashhurs mashhurs left a comment

Choose a reason for hiding this comment

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

Late to party but LGTM and well released.

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.

Add x-elastic-product-origin header to all places that make requests to Elasticsearch
3 participants