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
commit dcdd8fb712
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 98 additions and 5 deletions

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"`
}