Closed Bug 1552798 Opened 5 years ago Closed 5 years ago

Metrics are not logged in the dashboard on first run

Categories

(Data Platform and Tools :: Glean: SDK, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: bsurd, Unassigned)

References

Details

Attachments

(2 files)

Metrics telemetry data is not logged properly in the dashboard. Doing any kind of actions that are categorized as metrics according to the metrics.yaml should be logged but are not available.

Metrics are sent if sending the app into the background and opening it up again. It would seem these are only affected for the first run of the app.

Bogdan, do you have a logcat for this? Can you also provide STR?

Flags: needinfo?(bogdan.surd)
Attached file log.txt

STR:

  1. Install Firefox Preview.
  2. Start Preview using glean with sendPing metrics.
  3. Do any action that should be logged in the metrics ping.

Expected:
The action is logged as a metrics ping.

Actual:
The action is not logged

Note:
Metrics are logged after the first start of the app.

Flags: needinfo?(bogdan.surd)

(In reply to Bogdan Surd, QA [:bsurd, NI] from comment #2)

STR:

  1. Install Firefox Preview.
  2. Start Preview using glean with sendPing metrics.

Can you please paste the command you're using?

  1. Do any action that should be logged in the metrics ping.

Can you please mention which action you tried?

Flags: needinfo?(bogdan.surd)

If using the sendPings command, in the order specified... wouldn't this send the metrics ping immediately on launch of the app and any additional metrics that were recorded after that would just be recorded and not sent until the next metrics ping?

(In reply to Travis Long from comment #4)

If using the sendPings command, in the order specified... wouldn't this send the metrics ping immediately on launch of the app and any additional metrics that were recorded after that would just be recorded and not sent until the next metrics ping?

Exactly, but it depends on whether or not Fenix sets something at startup. In that case, we'd race for it. That's why I asked for more details about the command and STR :)

Thanks for clarifying!

Can you please paste the command you're using?

Tried with a fresh install, and clearing the app data.

adb shell am start -n org.mozilla.fenix/mozilla.components.service.glean.debug.GleanDebugActivity --ez logPings true --es sendPing metrics --es tagPings bsurd-test-23

Can you please mention which action you tried?

For this scenario I've tried searching. I was expecting a metrics ping to be logged and would have looked for the search_count inside it. For others, I've also tried various bookmarking pings.

Flags: needinfo?(bogdan.surd)

Bogdan, would you kindly try the following STR?

STR:

  1. Install Firefox Preview.
  2. Start Preview from the phone (do NOT use glean with sendPing metrics).
  3. Do any action that should be logged in the metrics ping (e.g. perform a search).
  4. Trigger sending the 'metrics' ping with the following command:

adb shell am start -n org.mozilla.fenix/mozilla.components.service.glean.debug.GleanDebugActivity --ez logPings true --es sendPing metrics --es tagPings bsurd-test-metrics-1

Would you kindly provide a logcat trace in case this doesn't work?

Flags: needinfo?(bogdan.surd)

Doing it with these steps worked, but isn't this the same as opening the app a second time? Looking at the device it does do some sort of refresh for the app after sending the command.

This would still mean that no metrics are logged for the first run.

Flags: needinfo?(bogdan.surd)

(In reply to Bogdan Surd, QA [:bsurd, NI] from comment #9)

Doing it with these steps worked, but isn't this the same as opening the app a second time?

No, it uses the currently opened instance. The STR from comment 2 is slightly flawed:

  1. Install Firefox Preview.
  2. Start Preview using glean with sendPing metrics.

This will start Firefox but will also send the 'metrics' ping as soon as the application starts, before any interaction takes place (and potentially before any data is recorded). Please note that no ping is generated if no data is recorded.

  1. Do any action that should be logged in the metrics ping.

At this point we're actually accumulating data in the 'metrics' ping. But we tried to send the ping earlier than this. This data will live in the next ping that gets generated.

Looking at the device it does do some sort of refresh for the app after sending the command.

Can you be more specific about this? It should re-use the application instance that's already open. Are you seeing a different behaviour?

This would still mean that no metrics are logged for the first run.

Metrics are still being recorded, they are not being discarded. Is just that the ping is being sent too early at startup (as requested through adb). For checking the data, the ping should be triggered after some action that records data is performed.

Flags: needinfo?(bogdan.surd)
Attached video rec.mp4

This will start Firefox but will also send the 'metrics' ping as soon as the application starts, before any interaction takes place (and potentially before any data is recorded). Please note that no ping is generated if no data is recorded.

  1. Do any action that should be logged in the metrics ping.

At this point we're actually accumulating data in the 'metrics' ping. But we tried to send the ping earlier than this. This data will live in the next ping that gets generated.

This would still mean that no metrics are logged for the first run.

Metrics are still being recorded, they are not being discarded. Is just that the ping is being sent too early at startup (as requested through adb). For checking the data, the ping should be triggered after some action that records data is performed.

So the metrics ping is sent in a different way than the baseline and event pings? These are logged and appear in the dashboard only after sending the app into the background. It's a bit odd that it works differently from the rest.

Can you be more specific about this? It should re-use the application instance that's already open. Are you seeing a different behaviour?

Please see the attached video.

Flags: needinfo?(bogdan.surd)

Closing this as Alessio has clarified everything on slack.

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: