-
Notifications
You must be signed in to change notification settings - Fork 5k
[BeatReceivers] setup http monitoring during receiver creation #44231
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
Currently, beats receivers http monitoring is started on the call to receiver Start. On the OTel collector pipeline, the receiver is first instanciated via the CreateLogs factory, and only then started. This commit moves the http monitoring to the receiver creation, ensuring the monitoring endpoints are available as soon as possible during the collector startup.
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane) |
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.
Looks great. would just like to add checking /inputs
as well if we can since that was what let us find this.
6773d2f
to
9dfbe3c
Compare
/test |
9c4672f
to
4b00271
Compare
18839da
to
1c87be2
Compare
Okay, CI is definitely not happy with my changes. The test TestInputMetricsFromPipeline is constantly failing for agentbeat and filebeat integration tests. I don't see any relation with the code I added here, but there must be something interfering with these tests. I'll look into it. In the meantime, if anyone has an idea what that could be I appreciate any insights. |
67e9fb3
to
3544c05
Compare
@AndersonQ I’m seeing a failure in the TestInputMetricsFromPipeline test you added a month ago: I’m having trouble understanding why it’s failing now. Sure, my changes touch input metrics but it only applies to beats receivers and not plain filebeat. Would you mind taking a quick look to see if you have any insights? Thanks! |
@mauri870, I've run it several times on my machine and checked the CI runs on main. All passing. It might be flaky and I haven't caught it yet. It might be the registry you're passing to the inputs handler. I'm fixing another thing right now. But I can try to help you later with it. |
Thanks for looking into it! I'll do some additional testing to make sure I pinpoint the reason, I suspect it is the addition of the inputs route that is breaking the test. |
6c92c49
to
58e2fe8
Compare
I refactored the test code to ensure it returns the correct data for the inputs and stats endpoints. Here are a few things I encountered:
|
I'm pretty sure the problem is that the filebeat beater is created, and that already attaches metricbeat is still using the global registry. So I'm thinking metricbeat is "working" because it happens to be using the global namespace. |
Closing, superseded by #44438. |
Proposed commit message
Currently, beats receivers http monitoring is started on the call to receiver Start. On the OTel collector pipeline, the receiver is first instanciated via the CreateLogs factory, and only then started. This commit moves the http monitoring to the receiver creation, ensuring the monitoring endpoints are available as soon as possible during the collector startup.
Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.How to test
go test -v ./x-pack/filebeat/fbreceiver ./x-pack/metricbeat/mbreceiver
Related issues