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

[Issue #3764] add search query params to new relic #4039

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

doug-s-nava
Copy link
Collaborator

@doug-s-nava doug-s-nava commented Feb 27, 2025

Summary

Fixes #3764

Time to review: 15 mins

Changes proposed

  • sends search page query params to new relic. This data is not collected out of the box by new relic because of security concerns.
  • adds a typing package for the new relic client side object
  • some moving around of new relic and query param related typing
  • enables new relic in staging

Context for reviewers

Note that custom attributes are being cleared when navigating away from the search page, but not quickly enough for them to not show up on the route transition events on navigation. Not sure if this is a deal breaker.

Also note that I've discovered that trying to run the app with new relic enabled but without an app name or license key results in the application hanging indefinitely. We should fix this in a future ticket.

Further note that given the somewhat vague requirements in the ticket I've just tried to make sure here that all the necessary data is making it into new relic, as much as possible. I created a basic dashboard view of a query to show the new parameters, but anything other work on this should probably go in another ticket. I attempted to make the query more flexible, by querying for all attributes with the search_param prefix, so far with no luck;.

Documentation updates are in order, but need to wait for #4005 with larger documentation updates to come in first

Related docs

Test steps

  1. start a server on this branch with npm run build -- --no-lint && NEW_RELIC_APP_NAME="Simpler Grants Next DEV" NEW_RELIC_LICENSE_KEY="<license key from 1password>" npm run start:nr
  2. load the app and navigate to the search page
  3. click around to select filters, enter a search term, change sort options, and navigate between pages
  4. visit the Search Parameters dashboard in the new relic ui https://one.newrelic.com/dashboards/detail/NTI0OTgwOXxWSVp8REFTSEJPQVJEfGRhOjgyNTU5NDg?account=5249809&state=90941f99-7f84-52ed-7197-f4fa625e85ab
  5. VERIFY: your interactions show up in the table

Additional information

Screenshot 2025-02-27 at 10 12 21 AM

@doug-s-nava doug-s-nava force-pushed the dschrashun/3764-new-relic-query-params branch from 2fda842 to a807453 Compare February 27, 2025 20:21
export const metadata: Metadata = {
icons: [`${environment.NEXT_PUBLIC_BASE_PATH}/img/favicon.ico`],
};

type NRType = typeof newrelic;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

moved this stuff to a types file

@@ -64,16 +64,19 @@ export interface SearchAPIResponse extends APIResponse {
fieldChanged?: string;
}

export const validSearchQueryParamKeys = [
Copy link
Collaborator Author

@doug-s-nava doug-s-nava Feb 27, 2025

Choose a reason for hiding this comment

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

wanted to be able to use these values for whitelisting / iteration, so switched up a bit of the typing here

@@ -66,6 +66,7 @@
"@types/js-cookie": "^3.0.6",
"@types/lodash": "^4.17.13",
"@types/newrelic": "^9.14.6",
"@types/new-relic-browser": "^1.230.5",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

used implicitly to provide a type for window.newrelic

@doug-s-nava doug-s-nava changed the title Dschrashun/3764 new relic query params [Issue #3764] add search query params to new relic Feb 27, 2025
@doug-s-nava doug-s-nava marked this pull request as ready for review February 27, 2025 20:42
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.

Send search params to New Relic
1 participant