Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(next): glean emit view event #17627

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

StaberindeZA
Copy link
Contributor

@StaberindeZA StaberindeZA commented Sep 17, 2024

Because

  • Record SubPlat P1 metric view event using glean

This pull request

  • Adds payments-metrics library
  • Adds PaymentsGleanManager to format events data and CMS data into the required format for Glean events recording.
  • Adds PaymentsGleanService to handle metrics events emitted by Next.js
  • Adds the manager and service to the NestApp
  • Adds new config values to payments-next for Glean reporting
  • Emit view event from Checkout start page

Issue that this pull request solves

Closes: #FXA-10087

Checklist

Put an x in the boxes that apply

  • My commit is GPG signed.
  • If applicable, I have modified or added tests which pass locally.
  • I have added necessary documentation (if appropriate).
  • I have verified that my changes render correctly in RTL (if appropriate).

@StaberindeZA StaberindeZA requested a review from a team as a code owner September 17, 2024 17:48
@StaberindeZA StaberindeZA force-pushed the fxa-10087-next-glean-view branch 6 times, most recently from 6681864 to e83637e Compare September 18, 2024 13:28
@@ -75,6 +75,12 @@ STATS_D_CONFIG__HOST=
STATS_D_CONFIG__PORT=
STATS_D_CONFIG__PREFIX=

# Glean Config
GLEAN_CONFIG__APPLICATION_ID=
# GLEAN_CONFIG__VERSION= # Set in next.config.js
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this not be written as follows instead?:

# Set in next.config.js
GLEAN_CONFIG__VERSION=

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The intention here is to show the developer that this config value exists, but that it's not set in any .env file, but instead is set in next.config.js. Leaving the comment on the same line as the config var, IMO more clearly indicates that the comment only applies to this line.

apps/payments/next/lib/metrics/glean/server_events.ts

# payments-metrics
libs/payments/metrics/src/lib/glean/__generated__/server_events.ts
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apps/payments/next/lib/metrics/glean/server_events.ts auto-generated when I pulled down the branch.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apps/payments/next/lib/metrics/glean/server_events.ts was the original location of server_events.ts so it might just be an artifact from before this PR.

If you delete the folder apps/payments/next/lib/metrics it should not be automatically created again.

Copy link
Contributor

@xlisachan xlisachan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was able to start the stack and saw the event logged in payments-next.

I left a comment about a file that auto-generated and not listed in .gitignore and there are copyright header/import lines that are out of order in a few files. Otherwise, LGTM - thanks Reino!

Because:

- Record SubPlat P1 metric view event using glean

This commit:

- Adds payments-metrics library
- Adds PaymentsGleanManager to format events data and CMS data into the
  required format for Glean events recording.
- Adds PaymentsGleanService to handle metrics events emitted by Next.js
- Adds the manager and service to the NestApp
- Adds new config values to payments-next for Glean reporting
- Emit view event from Checkout start page

Closes #FXA-10087
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants