feat: add agent stats for different connection types (#6412)

This allows us to track when our extensions are used, when the
web terminal is used, and average connection latency to the agent.
This commit is contained in:
Kyle Carberry
2023-03-02 08:06:00 -06:00
committed by GitHub
parent 537547fcc3
commit 2ff1c6d613
18 changed files with 412 additions and 131 deletions

30
coderd/apidoc/docs.go generated
View File

@ -5201,17 +5201,21 @@ const docTemplate = `{
"agentsdk.Stats": {
"type": "object",
"properties": {
"conns_by_proto": {
"connection_count": {
"description": "ConnectionCount is the number of connections received by an agent.",
"type": "integer"
},
"connection_median_latency_ms": {
"description": "ConnectionMedianLatencyMS is the median latency of all connections in milliseconds.",
"type": "number"
},
"connections_by_proto": {
"description": "ConnectionsByProto is a count of connections by protocol.",
"type": "object",
"additionalProperties": {
"type": "integer"
}
},
"num_comms": {
"description": "ConnectionCount is the number of connections received by an agent.",
"type": "integer"
},
"rx_bytes": {
"description": "RxBytes is the number of received bytes.",
"type": "integer"
@ -5220,6 +5224,22 @@ const docTemplate = `{
"description": "RxPackets is the number of received packets.",
"type": "integer"
},
"session_count_jetbrains": {
"description": "SessionCountJetBrains is the number of connections received by an agent\nthat are from our JetBrains extension.",
"type": "integer"
},
"session_count_reconnecting_pty": {
"description": "SessionCountReconnectingPTY is the number of connections received by an agent\nthat are from the reconnecting web terminal.",
"type": "integer"
},
"session_count_ssh": {
"description": "SessionCountSSH is the number of connections received by an agent\nthat are normal, non-tagged SSH sessions.",
"type": "integer"
},
"session_count_vscode": {
"description": "SessionCountVSCode is the number of connections received by an agent\nthat are from our VS Code extension.",
"type": "integer"
},
"tx_bytes": {
"description": "TxBytes is the number of transmitted bytes.",
"type": "integer"