feat(oohelperd): add prometheus metrics (#897)

Closes https://github.com/ooni/probe/issues/2183

While there, avoid exposing nil values for optional fields of the
THResponse struct (i.e., "ip_info" and "tls_handshake").

While there, fix `measurexlite`'s `OperationLogger` test
and make it deterministic rather than racy.
This commit is contained in:
Simone Basso
2022-08-28 23:54:22 +02:00
committed by GitHub
parent 4241ee4bc1
commit dcdd8fb712
7 changed files with 98 additions and 5 deletions
+2 -2
View File
@@ -78,8 +78,8 @@ const (
// THResponse is the response from the control service.
type THResponse struct {
TCPConnect map[string]THTCPConnectResult `json:"tcp_connect"`
TLSHandshake map[string]THTLSHandshakeResult `json:"tls_handshake"`
TLSHandshake map[string]THTLSHandshakeResult `json:"tls_handshake,omitempty"`
HTTPRequest THHTTPRequestResult `json:"http_request"`
DNS THDNSResult `json:"dns"`
IPInfo map[string]*THIPInfo `json:"ip_info"`
IPInfo map[string]*THIPInfo `json:"ip_info,omitempty"`
}