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

Update HTTP server ebpf - add status code #428

Merged
merged 8 commits into from
Oct 30, 2023

Conversation

RonFed
Copy link
Contributor

@RonFed RonFed commented Oct 28, 2023

The main goal of this PR is to prepare an easier way to collect HTTP server related fields by eBPF.

  • Instead of collecting the data at the entry uprobe, collect it at the exit one. This makes sense since all the relevant fields are set at the end of the handling and we can read them.
  • In order to read the desired fields in the return probe, we must save the pointer to the relevant struct in the entry probe. This is because registers are not guaranteed to keep their value through the function.
  • We save a pointer to a net/http.(*response) struct at the entry probe.
  • I added the net/http.response struct to the offsets being tracked (currently the req and status fields of that struct are being tracked, and we'll add more in the future to support more attributes).
  • Adding the above field required changing the template file for generating the dummy HTTP application for the offset calculations, since the current one didn't include the symbol for the field.
  • Moving the attributes collection to the exit probe is probably relevant to all the instrumentations. This will make the UPROBE_RETURN macro not so usable, but for now, we should keep it until those changes are made.

@RonFed RonFed changed the title Update server http bpf - add status code (WIP) Update server http ebpf - add status code (WIP) Oct 28, 2023
@RonFed RonFed changed the title Update server http ebpf - add status code (WIP) Update server http ebpf - add status code Oct 29, 2023
@RonFed RonFed marked this pull request as ready for review October 29, 2023 12:12
@RonFed RonFed requested a review from a team October 29, 2023 12:12
@RonFed RonFed changed the title Update server http ebpf - add status code Update HTTP server ebpf - add status code Oct 29, 2023
Copy link
Contributor

@edeNFed edeNFed left a comment

Choose a reason for hiding this comment

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

looks great

@edeNFed edeNFed merged commit a3680df into open-telemetry:main Oct 30, 2023
13 of 14 checks passed
pellared added a commit to pellared/opentelemetry-go-instrumentation that referenced this pull request Oct 30, 2023
MrAlias pushed a commit that referenced this pull request Oct 30, 2023
@MrAlias MrAlias added this to the v0.8.0-alpha milestone Nov 14, 2023
@MrAlias MrAlias mentioned this pull request Nov 14, 2023
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.

4 participants