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(insights): add eap to http landing page #81753

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

DominikB2014
Copy link
Contributor

Work for #81750

This PR adds the following to the http landing page

  1. Adds a selector to the top right that allows u to query for Non-eap, eap + snuba or eap + rpc (This selector is purely for dev/testing purposes and under a flag)
  2. Adds a associated hook to the previous selector to get the value
  3. Collect the currently available data from eap for all charts/tables.
image

@DominikB2014 DominikB2014 requested a review from a team December 5, 2024 19:35
@DominikB2014 DominikB2014 requested a review from a team as a code owner December 5, 2024 19:35
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Dec 5, 2024
Copy link

codecov bot commented Dec 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #81753      +/-   ##
==========================================
- Coverage   80.44%   80.44%   -0.01%     
==========================================
  Files        7250     7250              
  Lines      322048   322043       -5     
  Branches    20852    20851       -1     
==========================================
- Hits       259082   259077       -5     
  Misses      62572    62572              
  Partials      394      394              

Copy link

codecov bot commented Dec 5, 2024

Bundle Report

Changes will increase total bundle size by 18.86kB (0.06%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
app-webpack-bundle-array-push 31.99MB 18.86kB (0.06%) ⬆️

Copy link
Member

@gggritso gggritso left a comment

Choose a reason for hiding this comment

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

This makes sense overall, but it's a lot of work and a lot of UI code messiness just to investigate what's possible with EAP. Let's talk offline about some potential other approaches!

@@ -76,6 +81,8 @@ const useDiscover = <T extends Extract<keyof ResponseType, string>[], ResponseTy
dataset: DiscoverDatasets,
referrer: string
) => {
const {useRpc: useRpcFromQueryParam} = useEapOptions();
Copy link
Member

Choose a reason for hiding this comment

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

Why the rename to useRpcFromQueryParam?

Copy link
Member

Choose a reason for hiding this comment

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

EAP should be in all caps everywhere 🙏🏻 Same with RPC

Comment on lines +12 to +15
/**
* This selector allows us to with and without EAP enabled
* @returns
*/
Copy link
Member

Choose a reason for hiding this comment

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

This comment is ... incomplete?

Comment on lines +25 to +38
const options: Options = [
{
value: 'noEap',
label: "Don't use EAP",
},
{
value: 'useEap',
label: 'Use EAP',
},
{
value: 'useEapRpc',
label: 'Use RPC EAP',
},
];
Copy link
Member

Choose a reason for hiding this comment

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

These can be moved out of the component since they're static

Comment on lines +47 to +63
if (hasEAPFeature) {
return (
<CompactSelect
options={options}
value={value}
onChange={(selectedOption: SelectOption<EapOption>) =>
navigate({
...location,
query: {
...location.query,
eap_option: selectedOption.value,
},
})
}
/>
);
}
Copy link
Member

Choose a reason for hiding this comment

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

You can avoid this by returning undefined as soon as the feature is available at the top of the component

Copy link
Member

Choose a reason for hiding this comment

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

Also, isn't this redundant? useEapOptions already checks the feature flag

Comment on lines +85 to +86
default:
return {useEap: true, useRpc: false};
Copy link
Member

Choose a reason for hiding this comment

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

default case turning on EAP seems kind of aggressive, since this is feature flagged

Comment on lines +220 to +236
const domainsListResponse = useEap ? eapDomainListResponse : metricsDomainsListResponse;
const {
isPending: isDurationDataLoading,
data: durationData,
error: durationError,
} = useEap ? eapDurationDataResponse : durationDataResponse;
const {
isPending: isThroughputDataLoading,
data: throughputData,
error: throughputError,
} = useEap ? eapThroughputDataResponse : throughtputDataResponse;
const {
isPending: isResponseCodeDataLoading,
data: responseCodeData,
error: responseCodeError,
} = useEap ? eapResponseRateResponse : responseRateResponse;

Copy link
Member

Choose a reason for hiding this comment

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

This is a lot of duplication 🤔 this if every single page is going to require this much work, that won't look great in the code. Is it possible to tuck this away inside a hook?

@DominikB2014 DominikB2014 marked this pull request as draft December 10, 2024 15:34
@getsantry
Copy link
Contributor

getsantry bot commented Jan 1, 2025

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry getsantry bot added Stale and removed Stale labels Jan 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants