Add metrics on yamux sessions and active AdminStreamReplicationMessages#97
Merged
temporal-nick merged 7 commits intomainfrom Jun 23, 2025
Merged
Add metrics on yamux sessions and active AdminStreamReplicationMessages#97temporal-nick merged 7 commits intomainfrom
temporal-nick merged 7 commits intomainfrom
Conversation
pglass
reviewed
Jun 23, 2025
pglass
reviewed
Jun 23, 2025
pglass
approved these changes
Jun 23, 2025
Comment on lines
+252
to
+256
| if session.IsClosed() { | ||
| metrics.MuxSessionOpen.WithLabelValues(labels...).Set(0) | ||
| metrics.MuxStreamsActive.WithLabelValues(labels...).Set(float64(0)) | ||
| return | ||
| } |
Contributor
There was a problem hiding this comment.
Do we still need this block? Or will the loop on L258 handle it correctly?
Collaborator
Author
There was a problem hiding this comment.
Nope, removed
hehaifengcn
reviewed
Jun 23, 2025
| } | ||
| defer func() { | ||
| // This is an async monitor. Don't let it crash the rest of the program if there's a problem | ||
| recover() |
Collaborator
There was a problem hiding this comment.
log the result of recover
hehaifengcn
reviewed
Jun 23, 2025
| // This is an async monitor. Don't let it crash the rest of the program if there's a problem | ||
| recover() | ||
| }() | ||
| labels := []string{session.LocalAddr().String(), |
Collaborator
There was a problem hiding this comment.
potentially session can be nil even with the check at line 237. Probably rare but maybe there is a better solution?
Collaborator
Author
There was a problem hiding this comment.
Double-checked https://github.com/hashicorp/yamux/blob/master/addr.go#L44, and these are guaranteed non-nil, so long as nothing deliberately deletes session. So I think this should be safe
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.
What was changed
Added some gauges to report the current state of the underlying yamux sessions and the application-level AdminStreamReplicationMessages connections. The gauges for the yamux session have labels for the config name, local and remote address, and session type.
Why?
This should help us validate that the proxy is alive and running correctly.
Checklist
Part of https://temporalio.atlassian.net/browse/CGS-839
How was this tested:
No unit tests yet. These changes should help improve observability in test while I backfill them.