Skip to content

Commit

Permalink
VPN-2988 - Record events on controller error steps (#4594)
Browse files Browse the repository at this point in the history
  • Loading branch information
brizental authored and mozrokafor committed Oct 18, 2022
1 parent 6bdc871 commit 6444029
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
20 changes: 17 additions & 3 deletions glean/metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
$schema: moz://mozilla.org/schemas/glean/metrics/2-0-0

sample:

addon_state_changed:
type: event
lifetime: ping
Expand Down Expand Up @@ -71,7 +70,6 @@ sample:
Received, Notified, Read, or Dismissed
type: string


addon_cta_clicked:
type: event
lifetime: ping
Expand Down Expand Up @@ -566,7 +564,6 @@ sample:
- amarchesini@mozilla.com
expires: never


connection_health_no_signal:
type: event
lifetime: ping
Expand Down Expand Up @@ -1047,6 +1044,23 @@ sample:
description: The Host network type (i.e wifi or 4g)
type: string

server_unavailable_error:
type: event
lifetime: ping
send_in_pings:
- main
description: |
A "Server unavailable" error has occured.
bugs:
- https://github.com/mozilla-mobile/mozilla-vpn-client/issues/4589
data_reviews:
- https://github.com/mozilla-mobile/mozilla-vpn-client/pull/4594#issuecomment-1271601927
data_sensitivity:
- technical
notification_emails:
- brizental@mozilla.com
expires: never

app_step:
type: event
lifetime: ping
Expand Down
1 change: 1 addition & 0 deletions src/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,7 @@ bool Controller::processNextStep() {

if (nextStep == ServerUnavailable) {
logger.info() << "Server Unavailable - Ping succeeded: " << m_ping_received;

emit readyToServerUnavailable(m_ping_received);
return true;
}
Expand Down
7 changes: 7 additions & 0 deletions src/telemetry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@ void Telemetry::initialize() {
emit vpn->recordGleanEvent(GleanSample::controllerStateOff);
}
});

connect(controller, &Controller::readyToServerUnavailable, this, []() {
MozillaVPN* vpn = MozillaVPN::instance();
Q_ASSERT(vpn);

emit vpn->recordGleanEvent(GleanSample::serverUnavailableError);
});
}

void Telemetry::connectionStabilityEvent() {
Expand Down

0 comments on commit 6444029

Please sign in to comment.