[beatreceiver] - Add status reporting#44782
Conversation
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
|
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
f6e8835 to
a296731
Compare
a296731 to
f9b2f46
Compare
|
Quite an elegant solution for this problem! |
bae3a80 to
344bbce
Compare
|
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane) |
|
This pull request is now in conflicts. Could you fix it? 🙏 |
|
@mauri870 @khushijain21 I've added new test cases and have made changes to benchmark modules for testing. We can now make benchmark module return error if we want, to test status reporting. |
df815c3 to
c400227
Compare
cmacknz
left a comment
There was a problem hiding this comment.
This LGTM, my only remaining comment is that seeing the FactoryWrapper methods outside of the context of this PR makes it quite hard to figure out what they do.
Could we rename them to have OtelStatus (or Otel or similar) in the name so we know what they are injecting when we read them?
Alternatively, can you add comments to all of them if you want to leave the names alone?
* initial commit * todo * implment reporter for mbreceiver * notice and lint * mbreceiver * lint * comments * notice * errors * optimization * add test case suite * fix benchmark and tests * rename to otel specific * test log (cherry picked from commit d71266c) # Conflicts: # NOTICE.txt # filebeat/beater/filebeat.go # go.mod # metricbeat/beater/metricbeat.go # metricbeat/mb/module/factory.go # x-pack/filebeat/fbreceiver/receiver_test.go # x-pack/filebeat/input/benchmark/input.go
* initial commit * todo * implment reporter for mbreceiver * notice and lint * mbreceiver * lint * comments * notice * errors * optimization * add test case suite * fix benchmark and tests * rename to otel specific * test log (cherry picked from commit d71266c)
* initial commit * todo * implment reporter for mbreceiver * notice and lint * mbreceiver * lint * comments * notice * errors * optimization * add test case suite * fix benchmark and tests * rename to otel specific * test log
* initial commit * todo * implment reporter for mbreceiver * notice and lint * mbreceiver * lint * comments * notice * errors * optimization * add test case suite * fix benchmark and tests * rename to otel specific * test log
* [beatreceiver] - Add status reporting (#44782) * initial commit * todo * implment reporter for mbreceiver * notice and lint * mbreceiver * lint * comments * notice * errors * optimization * add test case suite * fix benchmark and tests * rename to otel specific * test log (cherry picked from commit d71266c) # Conflicts: # NOTICE.txt # filebeat/beater/filebeat.go # go.mod # metricbeat/beater/metricbeat.go # metricbeat/mb/module/factory.go # x-pack/filebeat/fbreceiver/receiver_test.go # x-pack/filebeat/input/benchmark/input.go * [beatreceiver] - Add status reporting (#44782) * initial commit * todo * implment reporter for mbreceiver * notice and lint * mbreceiver * lint * comments * notice * errors * optimization * add test case suite * fix benchmark and tests * rename to otel specific * test log * use ct --------- Co-authored-by: Vihas Makwana <121151420+VihasMakwana@users.noreply.github.com> Co-authored-by: Vihas Makwana <vihas.makwana@elastic.co>
* [beatreceiver] - Add status reporting (#44782) * initial commit * todo * implment reporter for mbreceiver * notice and lint * mbreceiver * lint * comments * notice * errors * optimization * add test case suite * fix benchmark and tests * rename to otel specific * test log (cherry picked from commit d71266c) * use ct --------- Co-authored-by: Vihas Makwana <121151420+VihasMakwana@users.noreply.github.com> Co-authored-by: Vihas Makwana <vihas.makwana@elastic.co>
Proposed commit message
This PR adds status reporting for beatreceivers. The status reporting is added while creating the runners. The first PR (#44528) was quite "hacky" and it had go deep down to inject status reporters.
This PR adds a runner factory wrapper that will:
The code responsible for doing the above tasks will live in
libbeatand we will only enable it for beatreceivers. From an the beat receiver high level, it will do following:createReceiverbeats/x-pack/libbeat/cmd/instance/receiver.go
Lines 80 to 83 in 344bbce
beats/x-pack/libbeat/cmd/instance/receiver.go
Lines 76 to 81 in 6286492
Note:
To accomplish the above steps, it is essential that we create the runners in
beater.Run(...). Currently, metricbeat creates runners during the beater creation phase and starts them inbeater.Run(...). This PR moves the runner creation code inbeater.Run(...)to closely align with filebeat's implementation.Checklist
CHANGELOG.next.asciidocorCHANGELOG-developer.next.asciidoc.Related issues
Screenshots
Output
Here's output of running two streams (degraded) together:
Testing
elastic-agentand follow this guide to test local beats changesmage packageCloses elastic/elastic-agent#8210