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

Adds performance monitoring triggers to v2 alerts #1223

Merged
merged 12 commits into from Sep 14, 2022

Conversation

colerogers
Copy link
Contributor

@colerogers colerogers commented Sep 6, 2022

Adds Firebase Performance Monitoring triggers for performance threshold alerts to the v2 namespace.

// listen on all apps in a project
export const fn = onThresholdAlertPublished((event: PerformanceEvent<ThresholdAlertPayload>) => { … });

// listen on a specific app with a supplied appId
export const fn2 = onThresholdAlertPublished("1234567", (event: PerformanceEvent<ThresholdAlertPayload>) => { … });

// listen on a all apps with an options object
export const fn3 = onThresholdAlertPublished(
  {
    region: "us-central1",
  },
  (event: PerformanceEvent<ThresholdAlertPayload>) => { … }
);

// listen on a specific app with a supplied appId in the options object
export const fn4 = onThresholdAlertPublished(
  {
    appId: "1234567",
    region: "us-central1",
  },
  (event: PerformanceEvent<ThresholdAlertPayload>) => { … }
);

@colerogers colerogers changed the base branch from master to launch.next September 6, 2022 22:06
@colerogers colerogers marked this pull request as ready for review September 8, 2022 15:15
Copy link
Contributor

@TheIronDev TheIronDev left a comment

Choose a reason for hiding this comment

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

LGTM

@colerogers colerogers changed the base branch from launch.next to master September 13, 2022 20:09
* Declares a function that can handle receiving performance threshold alerts.
* @param appIdOrOptsOrHandler - A specific application, options, or an event-handling function.
* @param handler - Event handler which is run every time a threshold alert is received.
* @returns A function that you can export and deploy.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit* I think we say "Cloud Function" instead of function in remote config. I think I prefer the former. wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh good catch, but I think that remote config should actually be changed. Looking at all the other alert functions (& most other v2 functions) we say 'A function...'.

I remember @egilmorez giving us guidance here a while back, but not sure which way

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@taeold I just look through my old PR's and confirmed the recommended writing is "A function ...", I opened up #1232 to fix the other occurrences.

@colerogers colerogers merged commit c18e832 into master Sep 14, 2022
@taeold taeold added this to the v4 milestone Oct 6, 2022
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.

None yet

3 participants