-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[metricbeat] support basepath in beat module #28162
[metricbeat] support basepath in beat module #28162
Conversation
This pull request does not have a backport label. Could you fix it @stuartnelson3? 🙏
NOTE: |
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
💚 Flaky test reportTests succeeded. 🤖 GitHub commentsTo re-run your PR in the CI, just comment with:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - but let's wait for someone from the agent team to review.
Hi 🙂 This is a screencapture from Wireshark of Beat module in the current state (master) without PR. And this is my Beat config: # Module: beat
# Docs: https://www.elastic.co/guide/en/beats/metricbeat/master/metricbeat-module-beat.html
- module: beat
basepath: "/processes/metricbeat-default"
metricsets:
- stats
- state
period: 10s
hosts: ["http://localhost:5066"] Are we talking about the same thing? Because it seems to me that it's working as expected 🙂 |
That is what we're talking about, but it contradicts what I found when adding some logging (see #28159), and the tests I wrote confirm the original behavior strips the basepath, as well. Check your wireshark capture further, I'm guessing there are also requests sent to localhost:5066 and localhost:5066/state. Once I implemented my changes, it was successfully scraping the basepath and no longer 404'ing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jeeezzz I was getting crazy because I really couldn't see anything wrong on wireshark but I now have seen in the code a second call.
My test wasn't trying that call because I was already getting the 404 so the code-path was unreachable. Just because I was lazy to setup an nginx.
Good catch! Thank you for the explanation and the contribution. I leave you the "honor" of merging 😄
(cherry picked from commit dda5848) # Conflicts: # metricbeat/module/beat/beat_test.go
What does this PR do?
Support
basepath
in the beat module, as per the documentationWhy is it important?
This is expected behavior, and it's documented as being supported.
Checklist
- [ ] I have made corresponding changes to the documentation- [ ] I have made corresponding change to the default configuration filesCHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.How to test this PR locally
Related issues
basepath
ignored/erased inbeat
module #28159