@psymoon Thank you for filing. Is there a Fire TV issue for that too? I'm curious what the priority is (cc @athomasmoz).
@Sdaswani In a mail thread you mentioned that you are interested in starting to use glean in FFTV in Q1. Do we still need this new ping in the old telemetry library?
@pocmo I'm indeed interested but haven't made any firm plans. It may not happen until late Q1, or maybe pushed to Q2. In any case we wouldn't be using it for production data analysis given the pipeline won't be signed off for use until Q3.
Alright, sounds like we need this in service-telemetry then. I added the a-c label to the FFTV issue. Since the AC team has a lot on its plate I wonder if the FFTV team would like to pick this up? I can provide some hints what needs to be done here.
@pocmo yes, I would gladly work on this!
Great!
To add a new ping type we need to implement a new TelemetryPingBuilder.
An example is the mobile-event ping. You posted a schema for your ping above. This is the schema for the mobile-event ping:
https://github.com/mozilla-services/mozilla-pipeline-schemas/blob/dc458113a7a523e60a9ba50e1174a3b1e0cfdc24/schemas/telemetry/mobile-event/mobile-event.1.schema.json
And implemented in the telemetry this is here in TelemetryMobileEventPingBuilder:
https://github.com/mozilla-mobile/android-components/blob/master/components/service/telemetry/src/main/java/org/mozilla/telemetry/ping/TelemetryMobileEventPingBuilder.java
Following this pattern you'll need to implement some kind of TelemetryFireTVEventPingBuilder class where you translate the fields in the schema to "measurements" in the ping builder. You may find some of them already implemented here (e.g. "os" or "osversion"):
https://github.com/mozilla-mobile/android-components/tree/master/components/service/telemetry/src/main/java/org/mozilla/telemetry/measurement
Add new ones as you need them.
Note that the base class (TelemetryPingBuilder) already adds the version and client id:
https://github.com/mozilla-mobile/android-components/blob/master/components/service/telemetry/src/main/java/org/mozilla/telemetry/ping/TelemetryPingBuilder.java
Your schema seems to deliberately not send the client id. That's a special case we didn't have before, so you'll need to workaround that.
In Fire TV you'll find code that adds the ping builders to the telemetry library and schedules pings. That's something you'd need to add after the release. However make sure your ping builder exposes access to measurements where the app needs to set values (unlike "os" where the measurement can figure out the value on its own). For example the core ping builder exposes some measurements here that the app will set itself: https://github.com/mozilla-mobile/android-components/blob/master/components/service/telemetry/src/main/java/org/mozilla/telemetry/ping/TelemetryCorePingBuilder.java#L60-L78
Most measurement implementations fall in one of those three categories:
For testing:
DebugLogClient to log pings to logcat instead of uploading themThe telemetry library was written in Java before we started to use Kotlin. However feel free to use Kotlin for new code. I'd suggest not migrating any existing code at this time though (because of risk and since the library will go away eventually anyways) - unless really needed.
Ping me if you need any help!
Most helpful comment
Great!
To add a new ping type we need to implement a new
TelemetryPingBuilder.An example is the
mobile-eventping. You posted a schema for your ping above. This is the schema for themobile-eventping:https://github.com/mozilla-services/mozilla-pipeline-schemas/blob/dc458113a7a523e60a9ba50e1174a3b1e0cfdc24/schemas/telemetry/mobile-event/mobile-event.1.schema.json
And implemented in the telemetry this is here in
TelemetryMobileEventPingBuilder:https://github.com/mozilla-mobile/android-components/blob/master/components/service/telemetry/src/main/java/org/mozilla/telemetry/ping/TelemetryMobileEventPingBuilder.java
Following this pattern you'll need to implement some kind of
TelemetryFireTVEventPingBuilderclass where you translate the fields in the schema to "measurements" in the ping builder. You may find some of them already implemented here (e.g. "os" or "osversion"):https://github.com/mozilla-mobile/android-components/tree/master/components/service/telemetry/src/main/java/org/mozilla/telemetry/measurement
Add new ones as you need them.
Note that the base class (
TelemetryPingBuilder) already adds the version and client id:https://github.com/mozilla-mobile/android-components/blob/master/components/service/telemetry/src/main/java/org/mozilla/telemetry/ping/TelemetryPingBuilder.java
Your schema seems to deliberately not send the client id. That's a special case we didn't have before, so you'll need to workaround that.
In Fire TV you'll find code that adds the ping builders to the telemetry library and schedules pings. That's something you'd need to add after the release. However make sure your ping builder exposes access to measurements where the app needs to set values (unlike "os" where the measurement can figure out the value on its own). For example the core ping builder exposes some measurements here that the app will set itself: https://github.com/mozilla-mobile/android-components/blob/master/components/service/telemetry/src/main/java/org/mozilla/telemetry/ping/TelemetryCorePingBuilder.java#L60-L78
Most measurement implementations fall in one of those three categories:
For testing:
DebugLogClientto log pings to logcat instead of uploading themThe telemetry library was written in Java before we started to use Kotlin. However feel free to use Kotlin for new code. I'd suggest not migrating any existing code at this time though (because of risk and since the library will go away eventually anyways) - unless really needed.
Ping me if you need any help!