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(weave): adding charts to the traces page #2745

Merged
merged 59 commits into from
Oct 29, 2024

Conversation

mbarrramsey
Copy link
Contributor

@mbarrramsey mbarrramsey commented Oct 21, 2024

Description

See example page, https://beta.wandb.ai/vanpelt/openui-hosted/weave/calls?betaVersion=9b2425666fb0efa1f67f98cc8b55e84b00ea06d0

Adds charts for Latency, Errors, and Requests to the top of the Weave traces page. Based on figma: https://www.figma.com/design/mSF3IydmSfbUAVLCi2YlNZ/Weave-charts(hack)?node-id=65-10462&node-type=frame&t=VN4fvFeQ9QDXa3mV-0

Screen.Recording.2024-10-29.at.2.51.00.PM.mov

I would recommend moving to a different plotting library if we must support more custom tooltip styling or x axis date formatting since Plotly has limited capabilities for this.

Testing

How was this PR tested?

@circle-job-mirror
Copy link

circle-job-mirror bot commented Oct 21, 2024

Copy link

socket-security bot commented Oct 28, 2024

New dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@types/[email protected] None 0 51.4 kB types

View full report↗︎

@mbarrramsey mbarrramsey marked this pull request as ready for review October 28, 2024 20:38
@mbarrramsey mbarrramsey requested review from a team as code owners October 28, 2024 20:39
@@ -58,7 +58,7 @@ export const SimplePageLayout: FC<{
flexDirection: 'column',
flexGrow: 1,
height: '100%',
overflow: 'hidden',
overflow: 'hidden', // here
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Leaving this comment in for now -- these are the two places that cause the issues with padding in CallsCharts. Looks like other existing margins are also not getting applied evenly
Screenshot 2024-10-28 at 6 38 26 PM

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure I understand the //here comment. Can we just remove and we will revisit? Or maybe describe this more?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, was just leaving for the review -- this is referencing why we need the width param at https://github.com/wandb/weave/pull/2745/files#diff-01f203878a299e8d4c183ae5ef8703a4f3cd98dd7d2ba18cf733c73ddd3a78e5R122. Will remove now!

@@ -131,6 +131,59 @@ export const useCallsForQuery = (
}, [callResults, calls.loading, total, costs.loading, costResults, refetch]);
};

export const useCallsForQueryCharts = (
Copy link
Collaborator

Choose a reason for hiding this comment

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

this does not have anything "Charts" specific, it is more of a refactor of the first section of useCallsForQuery. I'd recommend renaming this and adding a comment that it should be merged with useCallsForQuery (assuming you don't want to do that (: )

Copy link
Collaborator

@tssweeney tssweeney left a comment

Choose a reason for hiding this comment

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

Approving with comments

@@ -0,0 +1,24 @@
import {Switch} from '@wandb/weave/components';
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: given that this is specifically used in the calls table and not really a general component, i would co-locate it in the page/CallsPage dir

gridPage?: GridPaginationModel,
expandedColumns?: Set<string>,
columns?: string[],
offset?: number,
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: i don't prefer having parameters that override other parameters. I think you can just pass in a GridPaginationModel confirming payload. Where pageSize = limit and page = offset // limit

export interface GridPaginationModel {
    /**
     * Set the number of rows in one page.
     * If some of the rows have children (for instance in the tree data), this number represents the amount of top level rows wanted on each page.
     * @default 100
     */
    pageSize: number;
    /**
     * The zero-based index of the current page.
     * @default 0
     */
    page: number;
}

@@ -168,7 +170,8 @@ export const CallsTable: FC<{
allowedColumnPatterns,
}) => {
const {loading: loadingUserInfo, userInfo} = useViewerInfo();

const [isMetricsChecked, setMetricsChecked] = useState(false);
console.log(isMetricsChecked);
Copy link
Collaborator

Choose a reason for hiding this comment

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

dev tracks

@mbarrramsey mbarrramsey merged commit 8a79528 into master Oct 29, 2024
108 of 110 checks passed
@mbarrramsey mbarrramsey deleted the mbarrramsey/trace_charts branch October 29, 2024 23:37
@github-actions github-actions bot locked and limited conversation to collaborators Oct 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants