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

qlog: add support for alpn_information event #4216

Merged
merged 3 commits into from
Dec 26, 2023

Conversation

birneee
Copy link
Contributor

@birneee birneee commented Dec 21, 2023

Split up from #4201

Copy link

codecov bot commented Dec 21, 2023

Codecov Report

Attention: 15 lines in your changes are missing coverage. Please review.

Comparison is base (2243fde) 83.64% compared to head (499324b) 83.65%.

Files Patch % Lines
logging/connection_tracer.go 0.00% 5 Missing ⚠️
qlog/event.go 0.00% 5 Missing ⚠️
qlog/qlog.go 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4216      +/-   ##
==========================================
+ Coverage   83.64%   83.65%   +0.01%     
==========================================
  Files         147      150       +3     
  Lines       15167    15500     +333     
==========================================
+ Hits        12685    12965     +280     
- Misses       2000     2036      +36     
- Partials      482      499      +17     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@marten-seemann marten-seemann left a comment

Choose a reason for hiding this comment

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

Thanks for splitting this out of the other PR!

@@ -34,6 +34,7 @@ type ConnectionTracer struct {
LossTimerExpired func(TimerType, EncryptionLevel)
LossTimerCanceled func()
ECNStateUpdated func(state ECNState, trigger ECNStateTrigger)
ChoseAlpn func(protocol string)
Copy link
Member

Choose a reason for hiding this comment

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

I think Go naming conventions would tell us to write it this way:

Suggested change
ChoseAlpn func(protocol string)
ChoseALPN func(protocol string)

qlog/event.go Outdated
func (e eventAlpnInformation) IsNil() bool { return false }

func (e eventAlpnInformation) MarshalJSONObject(enc *gojay.Encoder) {
enc.StringKeyOmitEmpty("chosen_alpn", e.chosenAlpn)
Copy link
Member

Choose a reason for hiding this comment

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

Let's not omit the empty value.

Suggested change
enc.StringKeyOmitEmpty("chosen_alpn", e.chosenAlpn)
enc.StringKey"chosen_alpn", e.chosenAlpn)

qlog/event.go Outdated Show resolved Hide resolved
connection.go Outdated
@@ -778,6 +778,12 @@ func (s *connection) handleHandshakeConfirmed() error {
}
s.mtuDiscoverer.Start(utils.Min(maxPacketSize, protocol.MaxPacketBufferSize))
}

// do not log earlier to not apply additional pressure on the handshake mutex
if s.tracer != nil && s.tracer.ChoseAlpn != nil {
Copy link
Member

Choose a reason for hiding this comment

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

We should be able to log this earlier, at the very latest on handshake completion.

qlog/event.go Outdated Show resolved Hide resolved
qlog/event.go Outdated Show resolved Hide resolved
qlog/qlog.go Outdated Show resolved Hide resolved
@marten-seemann marten-seemann changed the title Qlog chosen ALPN qlog: add support for alpn_information event Dec 26, 2023
@marten-seemann marten-seemann added this to the v0.41 milestone Dec 26, 2023
@marten-seemann marten-seemann merged commit 31a677c into quic-go:master Dec 26, 2023
19 checks passed
nanokatze pushed a commit to nanokatze/quic-go that referenced this pull request Feb 1, 2024
* qlog chosen alpn

* qlog chosen alpn

* qlog: fix capitalization of ALPN

---------

Co-authored-by: Marten Seemann <[email protected]>
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.

None yet

2 participants