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

support HAR exporter (http) layer in rama #357

Open
GlenDC opened this issue Dec 4, 2024 · 2 comments
Open

support HAR exporter (http) layer in rama #357

GlenDC opened this issue Dec 4, 2024 · 2 comments
Labels
easy An easy issue to pick up for anyone. good first issue Good for newcomers mentor available A mentor is available to help you through the issue.
Milestone

Comments

@GlenDC
Copy link
Member

GlenDC commented Dec 4, 2024

HAR File wikipedia: https://en.wikipedia.org/wiki/HAR_(file_format)

Only official looking doc I could find was https://w3c.github.io/web-performance/specs/HAR/Overview.html

Goal of this issue is to support Recording and exporting of HAR files,
of course it doesn't have to be a file to which we export,
but in the most common use case it will be.

This feature can be used by:

  • any developer to help get insights in the traffic flowing through their rama-based client/server/proxy
  • some (UA emulation related) rama tests regarding http data preservation (e.g. header casing, order, pseudoheaders, cookies, ...)

Requirements

Both service and layer will take the following input:

  • a Trigger trait, for now probably only implemented for FnOnce + Clone? Used to create a future (signal) to toggle between record and stop, where on stop the data is exported

The service starts in stopped modus (== not active) and is to be activated once signal is true, this can be spawned (gracefully) as a task really where the service just keeps track of an AtomicBool. Important is that that background tasks does exit in case the context is cancelled.

When the service is in record mode it will need to buffer each incoming http request in a prepared manner, har-ready.

This data can be kept already in a custom struct format (with these structs being serde::Serialize+Deserialize).

When the toggle stops the record it will need to serialize the buffer as a json blob and write it to the Writer, which is basically just an ascyn io writer.

Required input for the Service/Layer:

  • Trigger object
  • Writer

Custom options for the service/layer:

  • meta information such as service info, author info, ...
  • custom comments

This feature should also be well unit tested.

We also require an Example file which inspects the har file exists and is valid (can be as basic as just verifying the default format, not need to have 100% fail proof test. If the file exists, and it is a valid json object, which contains the expected root object and entries, where one entry can be verified a bit more in depth, it is probably good enough for what that e2e example test is concerned.

@GlenDC GlenDC added good first issue Good for newcomers easy An easy issue to pick up for anyone. mentor available A mentor is available to help you through the issue. labels Dec 4, 2024
@GlenDC GlenDC modified the milestone: v0.2 Dec 4, 2024
@GlenDC GlenDC added this to the v0.2 milestone Dec 5, 2024
@hafihaf123
Copy link
Contributor

Hello,

I am very interested in contributing to this issue. Although I am new to Rust and this would be my first time contributing to open-source, I am eager to learn and would greatly appreciate any guidance to help me address this task. While I will do my best to make progress promptly, I may require additional time and support to ensure the solution meets the project’s standards.

Thank you for considering my request!

@GlenDC
Copy link
Member Author

GlenDC commented Dec 7, 2024

Hi @hafihaf123 this issue is still available, it might however be a bit much both in terms of complexity and the amount of work required if I read your self described background.

I just created a new ticket. Would you be interested in try that one (first)? It also has me as a mentor available.

#358

If you want to pick that one up you can let it be known in that issue.

Nice to meet you btw!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy An easy issue to pick up for anyone. good first issue Good for newcomers mentor available A mentor is available to help you through the issue.
Projects
None yet
Development

No branches or pull requests

2 participants