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

[elasticsearch] support api_key #36274

Merged
merged 9 commits into from
Aug 11, 2023
Merged

Conversation

klacabane
Copy link
Contributor

@klacabane klacabane commented Aug 9, 2023

Summary

Adds support for api_key authentication in the elasticsearch module

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.

How to test this PR locally

  • create an api key and grab the beats format[1]
  • configure elasticsearch module to use that api_key:
metricbeat.modules:
  - module: elasticsearch
    xpack.enabled: true
    hosts: ["http://localhost:9200"]
    api_key: <key in beats format>
    period: 10s
  • elasticsearch metricsets are successfully collecting documents

[1]
Screenshot 2023-08-09 at 17 23 25

Related issues

Use cases

Screenshots

Logs

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Aug 9, 2023
@mergify
Copy link
Contributor

mergify bot commented Aug 9, 2023

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @klacabane? 🙏.
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

@klacabane klacabane added enhancement Team:Infra Monitoring UI - DEPRECATED Infrastructure Monitoring UI team - DEPRECATED - Use Team:Monitoring Module:elasticsearch Elasticsearch Beats modules v8.10.0 labels Aug 9, 2023
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Aug 9, 2023
@elasticmachine
Copy link
Collaborator

elasticmachine commented Aug 9, 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-08-11T13:50:27.417+0000

  • Duration: 56 min 1 sec

Test stats 🧪

Test Results
Failed 0
Passed 4464
Skipped 913
Total 5377

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

Expand to view the GitHub comments

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

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@klacabane klacabane marked this pull request as ready for review August 9, 2023 16:32
@klacabane klacabane requested review from a team as code owners August 9, 2023 16:32
@klacabane klacabane requested review from belimawr and rdner August 9, 2023 16:32
@mergify
Copy link
Contributor

mergify bot commented Aug 10, 2023

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 4949-es-api-key upstream/4949-es-api-key
git merge upstream/main
git push upstream 4949-es-api-key

@mohamedhamed-ahmed mohamedhamed-ahmed self-requested a review August 11, 2023 10:20
Copy link

@mohamedhamed-ahmed mohamedhamed-ahmed left a comment

Choose a reason for hiding this comment

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

LGTM!

Scholar-Li pushed a commit to Scholar-Li/beats that referenced this pull request Feb 5, 2024
* support api_key in es module

* changelog entry

* add unit test

* fix errorf call

* update documentation

* mage update

* x-pack mage update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Module:elasticsearch Elasticsearch Beats modules Team:Infra Monitoring UI - DEPRECATED Infrastructure Monitoring UI team - DEPRECATED - Use Team:Monitoring v8.10.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Stack Monitoring] Add missing metricbeat api_key configuration to elasticsearch integration module
4 participants