Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Migrating to newer Glean Events API (introduced with Glean v39) #19967

Closed
badboy opened this issue Jun 11, 2021 · 4 comments · Fixed by #28587
Closed

Migrating to newer Glean Events API (introduced with Glean v39) #19967

badboy opened this issue Jun 11, 2021 · 4 comments · Fixed by #28587
Assignees
Labels
🐞 bug Crashes, Something isn't working, .. eng:health Improve code health eng:reopen-for-qa Reopens and tags the issue for QA needed when the issue is merged pin Issues, features, improvements that are still valid

Comments

@badboy
Copy link
Member

badboy commented Jun 11, 2021

API Reference for Events

Glean gained type annotations for extra keys, allowing for string, boolean and quantity (a numeric value).
This changes the calling API if specified.
Note: Data is still sent stringified.

Old metrics definition:

views:
  login_opened:
    type: event
    description: |
      Recorded when the login view is opened.
    extra_keys:
      source_of_login:
        description: The source
    ...

New metrics definition:

views:
  login_opened:
    type: event
    description: |
      Recorded when the login view is opened.
    extra_keys:
      source_of_login:
        type: string
        description: The source
    ...

Old calling API:

import org.mozilla.yourApplication.GleanMetrics.Views

Views.loginOpened.record(mapOf(Views.loginOpenedKeys.sourceOfLogin to "toolbar"))

New calling API:

import org.mozilla.yourApplication.GleanMetrics.Views

Views.loginOpened.record(Views.loginOpenedExtra(sourceOfLogin = "toolbar"))

The old calling API is deprecated as of Glean v39 (June 2021).
There are currently no plans for full removal of the deprecated API.
Any removal will only happen in another major version release and communicated accordingly.

┆Issue is synchronized with this Jira Task

@badboy badboy added the 🐞 bug Crashes, Something isn't working, .. label Jun 11, 2021
@github-actions github-actions bot added the needs:triage Issue needs triage label Jun 11, 2021
@csadilek csadilek added eng:health Improve code health and removed needs:triage Issue needs triage labels Jun 14, 2021
@csadilek csadilek added this to Technical Debt (top 10) in Android Team Backlog Staging Board Jun 14, 2021
@mcomella
Copy link
Contributor

I imagine adding the types might make the current wrapper around glean difficult to refactor. It could be a good opportunity to move towards the recommended model for glean where we call the probes directly where they're recorded rather than moving through a wrapper.

@stale
Copy link

stale bot commented Dec 22, 2021

See: #17373 This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Dec 22, 2021
@stale stale bot closed this as completed Dec 29, 2021
@mcarare mcarare reopened this Mar 1, 2022
@stale stale bot removed the wontfix label Mar 1, 2022
@mcarare mcarare added the pin Issues, features, improvements that are still valid label Mar 1, 2022
@mcarare mcarare self-assigned this Mar 3, 2022
@mcarare
Copy link
Contributor

mcarare commented Apr 6, 2022

This will be handled in parallel with the removal of the wrapper in #21292. The new calls will also take into consideration this issue. I am leaving it open tough, to check that all calls follow the new calling API.

@mcarare
Copy link
Contributor

mcarare commented Apr 21, 2022

Closing as all telemetry using old metrics definitions has been migrated.

@mcarare mcarare closed this as completed Apr 21, 2022
@github-actions github-actions bot added the eng:reopen-for-qa Reopens and tags the issue for QA needed when the issue is merged label Jan 19, 2023
badboy added a commit to badboy/fenix that referenced this issue Jan 19, 2023
badboy added a commit to badboy/fenix that referenced this issue Jan 19, 2023
@github-actions github-actions bot removed the eng:reopen-for-qa Reopens and tags the issue for QA needed when the issue is merged label Jan 19, 2023
mergify bot pushed a commit that referenced this issue Jan 19, 2023
Required for Glean v52.0.0

Ref #19967
t-p-white pushed a commit to t-p-white/fenix that referenced this issue Jan 20, 2023
t-p-white pushed a commit to t-p-white/fenix that referenced this issue Jan 20, 2023
@github-actions github-actions bot added the eng:reopen-for-qa Reopens and tags the issue for QA needed when the issue is merged label Jan 20, 2023
JohanLorenzo pushed a commit to mozilla-releng/staging-firefox-android that referenced this issue Jan 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐞 bug Crashes, Something isn't working, .. eng:health Improve code health eng:reopen-for-qa Reopens and tags the issue for QA needed when the issue is merged pin Issues, features, improvements that are still valid
Projects
No open projects
Android Team Backlog Staging Board
Technical Debt (top 10)
4 participants