-
Notifications
You must be signed in to change notification settings - Fork 894
feat: Collect agent SSH metrics #7584
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
092e1d0
feat: Collect agent SSH metrics
mtojek 0c0df91
more metrics
mtojek 84b59ea
err
mtojek 000586a
session metrics
mtojek 11fb056
session error
mtojek 07b2b0e
fix
mtojek e38a7be
fmt
mtojek ba4bb4d
WIP
mtojek 0d0f300
Refactored to client_golang/prometheus
mtojek 315b5ce
fix
mtojek 43d5d40
fix
mtojek 85f8860
refactor
mtojek 7b26267
Merge branch 'main' into 6724-ssh-metrics
mtojek 34f07fc
refactor
mtojek 59fd585
fix test
mtojek 8cd927c
fix
mtojek 6eec4d7
fix
mtojek a059edf
fix
mtojek c004c04
fix
mtojek 9b0e31a
Address PR comments
mtojek 7d4ccce
x11HostnameError
mtojek 90b351d
Remove callbacks
mtojek 1773c24
failedConnectionsTotal
mtojek 5ac27b7
connectionsTotal
mtojek 6eb1a95
sftpConnectionsTotal
mtojek e3d7493
sessionError
mtojek 9620452
sftpServerErrors
mtojek f05466c
remove handlerError
mtojek 5887ee8
WIP
mtojek bb3602b
WIP
mtojek 27fc9a0
WIP
mtojek 3f4696b
Finish impl
mtojek 8cd07f2
Aggregator: labels
mtojek a51cde9
Merge branch 'main' into 6724-ssh-metrics
mtojek 389dd9f
TestAgent_Metrics_SSH
mtojek 8e10d6d
Address PR comments
mtojek 1858dc2
use labelIndex
mtojek 8dde9f9
Merge branch 'main' into 6724-ssh-metrics
mtojek db725a3
Merge branch 'main' into 6724-ssh-metrics
mtojek f416287
PR comments part 1
mtojek 4daf37d
PR comments part 2
mtojek d9203b8
PR comments part 3
mtojek File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
session error
- Loading branch information
commit 11fb0568ae71bcc0f922d132cb3f2cb547a3270e
There are no files selected for viewing
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This construction where we increment error metrics both here and down the stack where they occur means that we count the same error in more than one metric. This makes sums over the error metrics very misleading.
A better design is to only increment the metrics here in this function by selecting on the type of
error
returned bys.sessionStart
.You could create an error wrapper e.g.
Then use
xerrrors.As
to check for this type and increment accordingly. If we forget to wrap some errors, we can have an "unknown" error type that we increment in this case, which could signal us to go back and wrap the missing error.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I shall disagree, as having a generic metric to indicate that a session error happened is much easier to set up alarming. You don't need to watch every single metric and eventually miss newly added ones, but just have one to depend on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In prometheus it's easy to query for the sum across the label of error metrics. No chance of missing one if more label values are added later.