feat(bindings): add support for metric aggregation#5709
Merged
Conversation
maddeleine
reviewed
Jan 26, 2026
bindings/rust/standard/s2n-metrics-subscriber/src/subscriber.rs
Outdated
Show resolved
Hide resolved
bindings/rust/standard/s2n-metrics-subscriber/src/subscriber.rs
Outdated
Show resolved
Hide resolved
kaukabrizvi
reviewed
Jan 26, 2026
bindings/rust/standard/s2n-metrics-subscriber/src/static_lists.rs
Outdated
Show resolved
Hide resolved
bindings/rust/standard/s2n-metrics-subscriber/src/subscriber.rs
Outdated
Show resolved
Hide resolved
bindings/rust/standard/s2n-metrics-subscriber/src/subscriber.rs
Outdated
Show resolved
Hide resolved
kaukabrizvi
approved these changes
Feb 3, 2026
maddeleine
reviewed
Feb 6, 2026
|
|
||
| /// The [`s2n_tls::events::EventSubscriber`] may be invoked concurrently, which | ||
| /// means that multiple threads might be incrementing the current record. To handle | ||
| /// this and ensure that the `HandshakeRecordInProgress` is never flushed while |
Contributor
There was a problem hiding this comment.
Stakes are very low even if you flush mid-update right? You just miss like one handshake event.
Contributor
Author
There was a problem hiding this comment.
On one hand yes, but it would be tricky because it would make it hard to determine that 100% of clients supported something.
maddeleine
approved these changes
Feb 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Goal
Add the ability to aggregate handshake events into a single metric record.
Why
This functionality will be used to emit EMF records to CloudWatch, giving s2n-tls application a much clearer few of their TLS stack.
How
We want to avoid any locks, so the aggregation is done using arrays of atomic integers.
At a high level, there is an "in-progress" record which may be access from multiple threads. This in-progress records has the counters. Then when the record is finished, we "freeze" it and export it.
Testing
I added unit tests.
Related
Depends on #5708
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.