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

lib: add tracing support for http2 #266

Closed
wants to merge 2 commits into from

Conversation

santigimeno
Copy link
Member

While also adding tracing channels to track http2 client and server streams lifetime.

@santigimeno santigimeno self-assigned this Feb 10, 2025
Copy link
Member

@RafaelGSS RafaelGSS left a comment

Choose a reason for hiding this comment

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

I don't have much context to review this in-depth, but it seems very well-tested. Just left a couple of questions, code LGTM.

@@ -199,6 +199,9 @@ const onServerStreamErrorChannel = dc.channel('http2.server.stream.error');
const onServerStreamFinishChannel = dc.channel('http2.server.stream.finish');
const onServerStreamCloseChannel = dc.channel('http2.server.stream.close');

const clientTracingChannels = dc.tracingChannel('http2.client');
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const clientTracingChannels = dc.tracingChannel('http2.client');
const clientTracingChannels = dc.tracingChannel('http2.client');

Should we have a http2.server.session too?

Copy link
Member Author

Choose a reason for hiding this comment

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

We could, but at the moment I'm only tracking streams (http transactions). We could of course add support for sessions (to track actual connections). We can add those later on. At least this way we have the same support as we have for http and fetch.

if (headers[HTTP2_HEADER_METHOD] === HTTP2_METHOD_HEAD) {
// For head requests, there must not be a body...
// end the writable side immediately.
stream.end();
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't it be inside an else if instead? What if we receive an endOfStream = true and HTTP2_HEADER_METHOD = head?

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe, to be honest I've just kept the same logic it was implemented before.

@santigimeno santigimeno force-pushed the santi/diag_http2_tracing branch from c554ce0 to abbaab0 Compare February 11, 2025 15:41
@santigimeno santigimeno changed the base branch from santi/diag_http2 to node-v22.x-nsolid-v5.x February 11, 2025 15:43
@santigimeno santigimeno force-pushed the santi/diag_http2_tracing branch from abbaab0 to c392d14 Compare February 11, 2025 19:58
@santigimeno santigimeno force-pushed the santi/diag_http2_tracing branch from c392d14 to 6e50225 Compare February 12, 2025 10:57
santigimeno added a commit that referenced this pull request Feb 12, 2025
PR-URL: #266
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
santigimeno added a commit that referenced this pull request Feb 12, 2025
PR-URL: #266
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
@santigimeno
Copy link
Member Author

Landed in 65430e7...ed8c4f9

@santigimeno santigimeno deleted the santi/diag_http2_tracing branch February 12, 2025 14:14
santigimeno added a commit that referenced this pull request Feb 12, 2025
PR-URL: #266
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
santigimeno added a commit that referenced this pull request Feb 12, 2025
PR-URL: #266
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
santigimeno added a commit that referenced this pull request Feb 14, 2025
PR-URL: #266
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
santigimeno added a commit that referenced this pull request Feb 14, 2025
PR-URL: #266
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
santigimeno added a commit that referenced this pull request Feb 14, 2025
PR-URL: #266
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
PR-URL: #268
santigimeno added a commit that referenced this pull request Feb 14, 2025
PR-URL: #266
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
PR-URL: #268
santigimeno added a commit that referenced this pull request Feb 14, 2025
PR-URL: #266
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
PR-URL: #269
santigimeno added a commit that referenced this pull request Feb 14, 2025
PR-URL: #266
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
PR-URL: #269
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

Successfully merging this pull request may close these issues.

3 participants