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

Improve lacking documentation #62

Open
NickUfer opened this issue Oct 5, 2024 · 3 comments
Open

Improve lacking documentation #62

NickUfer opened this issue Oct 5, 2024 · 3 comments

Comments

@NickUfer
Copy link

NickUfer commented Oct 5, 2024

As a developer who wants to create filters using Proxy-WASM it is hard to understand the exact lifecycle of filters. It doesn't seem to be documented anywhere.

It would be great if this project had some page like Pingora's Life of a request which shows using a diagram the call tree of all methods:

 graph TD;
    start("new request")-->early_request_filter;
    early_request_filter-->request_filter;
    request_filter-->upstream_peer;

    upstream_peer-->Connect{{IO: connect to upstream}};

    Connect--connection success-->connected_to_upstream;
    Connect--connection failure-->fail_to_connect;

    connected_to_upstream-->upstream_request_filter;
    upstream_request_filter --> SendReq{{IO: send request to upstream}};
    SendReq-->RecvResp{{IO: read response from upstream}};
    RecvResp-->upstream_response_filter-->response_filter-->upstream_response_body_filter-->response_body_filter-->logging-->endreq("request done");

    fail_to_connect --can retry-->upstream_peer;
    fail_to_connect --can't retry-->fail_to_proxy--send error response-->logging;

    RecvResp--failure-->IOFailure;
    SendReq--failure-->IOFailure;
    error_while_proxy--can retry-->upstream_peer;
    error_while_proxy--can't retry-->fail_to_proxy;

    request_filter --send response-->logging


    Error>any response filter error]-->error_while_proxy
    IOFailure>IO error]-->error_while_proxy
Loading
@PiotrSikora
Copy link
Member

Patches welcome? Although, it's not clear to me whether this repo or specific host implementations would be the best place for documenting this.

cc @kyessenov

@NickUfer
Copy link
Author

NickUfer commented Oct 6, 2024

Well, I would contribute, if I knew how the lifecycle looks like in the first place. I think before I figure it out through trial and error, someone with knowledge about it would be faster with solving that.

@martijneken
Copy link

Thanks for the idea! Some existing docs from the plugin/filter/extension author perspective, covering root and stream contexts:

The host/proxy controls when a plugin/filter/extension is launched/evicted/restarted/etc so that may vary from deployment to deployment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants