feat(coderd): add DERP healthcheck (#6936)

This commit is contained in:
Colin Adler
2023-04-03 01:28:42 -05:00
committed by GitHub
parent f4d16a1ae5
commit 7738274b3e
14 changed files with 1925 additions and 5 deletions

222
coderd/apidoc/docs.go generated
View File

@ -359,6 +359,31 @@ const docTemplate = `{
}
}
},
"/debug/health": {
"get": {
"security": [
{
"CoderSessionToken": []
}
],
"produces": [
"application/json"
],
"tags": [
"Debug"
],
"summary": "Debug Info Deployment Health",
"operationId": "debug-info-deployment-health",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/healthcheck.Report"
}
}
}
}
},
"/deployment/config": {
"get": {
"security": [
@ -9487,6 +9512,203 @@ const docTemplate = `{
"ParameterSourceSchemeData"
]
},
"healthcheck.DERPNodeReport": {
"type": "object",
"properties": {
"can_exchange_messages": {
"type": "boolean"
},
"client_errs": {
"type": "array",
"items": {
"type": "array",
"items": {}
}
},
"client_logs": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "string"
}
}
},
"healthy": {
"type": "boolean"
},
"node": {
"$ref": "#/definitions/tailcfg.DERPNode"
},
"round_trip_ping": {
"type": "integer"
},
"stun": {
"$ref": "#/definitions/healthcheck.DERPStunReport"
},
"uses_websocket": {
"type": "boolean"
}
}
},
"healthcheck.DERPRegionReport": {
"type": "object",
"properties": {
"healthy": {
"type": "boolean"
},
"node_reports": {
"type": "array",
"items": {
"$ref": "#/definitions/healthcheck.DERPNodeReport"
}
},
"region": {
"$ref": "#/definitions/tailcfg.DERPRegion"
}
}
},
"healthcheck.DERPReport": {
"type": "object",
"properties": {
"healthy": {
"type": "boolean"
},
"netcheck": {
"$ref": "#/definitions/netcheck.Report"
},
"netcheck_logs": {
"type": "array",
"items": {
"type": "string"
}
},
"regions": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/healthcheck.DERPRegionReport"
}
}
}
},
"healthcheck.DERPStunReport": {
"type": "object",
"properties": {
"canSTUN": {
"type": "boolean"
},
"enabled": {
"type": "boolean"
},
"error": {}
}
},
"healthcheck.Report": {
"type": "object",
"properties": {
"derp": {
"$ref": "#/definitions/healthcheck.DERPReport"
},
"pass": {
"description": "Healthy is true if the report returns no errors.",
"type": "boolean"
},
"time": {
"description": "Time is the time the report was generated at.",
"type": "string"
}
}
},
"netcheck.Report": {
"type": "object",
"properties": {
"captivePortal": {
"description": "CaptivePortal is set when we think there's a captive portal that is\nintercepting HTTP traffic.",
"type": "string"
},
"globalV4": {
"description": "ip:port of global IPv4",
"type": "string"
},
"globalV6": {
"description": "[ip]:port of global IPv6",
"type": "string"
},
"hairPinning": {
"description": "HairPinning is whether the router supports communicating\nbetween two local devices through the NATted public IP address\n(on IPv4).",
"type": "string"
},
"icmpv4": {
"description": "an ICMPv4 round trip completed",
"type": "boolean"
},
"ipv4": {
"description": "an IPv4 STUN round trip completed",
"type": "boolean"
},
"ipv4CanSend": {
"description": "an IPv4 packet was able to be sent",
"type": "boolean"
},
"ipv6": {
"description": "an IPv6 STUN round trip completed",
"type": "boolean"
},
"ipv6CanSend": {
"description": "an IPv6 packet was able to be sent",
"type": "boolean"
},
"mappingVariesByDestIP": {
"description": "MappingVariesByDestIP is whether STUN results depend which\nSTUN server you're talking to (on IPv4).",
"type": "string"
},
"oshasIPv6": {
"description": "could bind a socket to ::1",
"type": "boolean"
},
"pcp": {
"description": "PCP is whether PCP appears present on the LAN.\nEmpty means not checked.",
"type": "string"
},
"pmp": {
"description": "PMP is whether NAT-PMP appears present on the LAN.\nEmpty means not checked.",
"type": "string"
},
"preferredDERP": {
"description": "or 0 for unknown",
"type": "integer"
},
"regionLatency": {
"description": "keyed by DERP Region ID",
"type": "object",
"additionalProperties": {
"type": "integer"
}
},
"regionV4Latency": {
"description": "keyed by DERP Region ID",
"type": "object",
"additionalProperties": {
"type": "integer"
}
},
"regionV6Latency": {
"description": "keyed by DERP Region ID",
"type": "object",
"additionalProperties": {
"type": "integer"
}
},
"udp": {
"description": "a UDP STUN round trip completed",
"type": "boolean"
},
"upnP": {
"description": "UPnP is whether UPnP appears present on the LAN.\nEmpty means not checked.",
"type": "string"
}
}
},
"parameter.ComputedValue": {
"type": "object",
"properties": {