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(LabelsView): update main time series when a "group by" label is selected #341

Merged
merged 45 commits into from
Jan 31, 2025

Conversation

grafakus
Copy link
Contributor

@grafakus grafakus commented Jan 22, 2025

✨ Description

Related issue(s): resolves #197, is blocked by #219

This PR makes the main time series in the Labels view responsive to "group by" changes, for example:

image

And after interacting with the "Include"/"Exclude" buttons (including 3 out of the 52 nodes available):

image

📖 Summary of the changes

General overview:

  • The drawer component has been lifted up to SceneExploreServiceLabels
  • SceneMainServiceTimeseries reacts to the groupBy variable changes by updating the item stored in SceneLabelValuesTimeseries's state
  • SceneLabelValuesTimeseries run new queries whenever the item's queryRunnerParams.groupBy value changes
  • The height of the timeseries in both the Labels view and the Flame graph view has been increased from 200px to 240px (this required to update the E2E screenshots)
  • New E2E tests have been added to verify that the main timeseries is reset properly when selecing a different service/profile type

See diff tab for specific comments.

🧪 How to test?

grafakus and others added 18 commits October 10, 2024 12:35
# Conflicts:
#	src/pages/ProfilesExplorerView/components/SceneExploreServiceLabels/components/SceneGroupByLabels/components/SceneLabelValuesGrid/SceneLabelValuesGrid.tsx
# Conflicts:
#	src/pages/ProfilesExplorerView/domain/actions/SelectAction.tsx
# Conflicts:
#	docker-compose.e2e.yaml
#	docker-compose.local.yaml
#	docker-compose.remote.yaml
#	docker-compose.yaml
#	package.json
#	src/pages/ProfilesExplorerView/components/SceneLabelValuesTimeseries/SceneLabelValuesTimeseries.tsx
#	src/plugin.json
#	src/shared/infrastructure/tracking/faro/__tests__/faro.spec.ts
#	yarn.lock
# Conflicts:
#	package.json
#	yarn.lock
@grafakus grafakus self-assigned this Jan 22, 2025
@github-actions github-actions bot added the feat label Jan 22, 2025
@grafakus grafakus changed the base branch from main to perf/limit-series-breakdown-charts January 22, 2025 19:31
@@ -66,6 +74,32 @@ export class GroupByVariable extends QueryVariable {
this.changeValueTo(newValue);
};

findCurrentOption(): OptionWithIndex {
Copy link
Contributor Author

@grafakus grafakus Jan 22, 2025

Choose a reason for hiding this comment

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

Added this new method to DRY in SceneGroupByLabels and SceneMainServiceTimeseries

.map(({ value, text }, index) => {
return {
// TODO: check if there's a better way
value: JSON.stringify({ ...value, index }),
Copy link
Contributor Author

@grafakus grafakus Jan 22, 2025

Choose a reason for hiding this comment

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

Adding the index (after sorting) is the reason behind this change

@grafakus grafakus added the 🚫 blocked Blocked by another issue/PR label Jan 22, 2025
@CLAassistant
Copy link

CLAassistant commented Jan 23, 2025

CLA assistant check
All committers have signed the CLA.

@grafakus grafakus marked this pull request as ready for review January 23, 2025 17:59
@grafakus grafakus removed the 🚫 blocked Blocked by another issue/PR label Jan 30, 2025
@grafakus grafakus marked this pull request as draft January 31, 2025 09:20
@grafakus grafakus marked this pull request as ready for review January 31, 2025 09:41
ifrost
ifrost previously approved these changes Jan 31, 2025
LabelsDataSource.MAX_TIMESERIES_LABEL_VALUES
).state;

const queryRunner = body.state.$data?.state.$data as SceneQueryRunner;
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to drill down to children props? Could we have the runner at SceneLabelValuesTimeseries/SceneLabelValuesTimeseries. The viz should to pull it as the closest anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a good idea. We'd also have to change some code in SceneComparePanel but it will simplify the access to the query runner. Let's do this in a future refactoring PR.

ifrost
ifrost previously approved these changes Jan 31, 2025
@grafakus grafakus merged commit 775b37d into main Jan 31, 2025
4 of 5 checks passed
@grafakus grafakus deleted the grafakus/labels-main-timeseries-groupby branch January 31, 2025 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants