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(ui): tracing getting started button #4067

Merged
merged 3 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions app/src/pages/project/ProjectTableEmpty.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import React, { ReactNode, useState } from "react";
import { css } from "@emotion/react";

import {
Button,
Dialog,
DialogContainer,
Flex,
Icon,
Icons,
View,
} from "@arizeai/components";

import { ExternalLink } from "@phoenix/components";

export function ProjectTableEmpty() {
const [dialog, setDialog] = useState<ReactNode>(null);
const onGettingStartedClick = () => {
setDialog(
<Dialog title="Getting Started with Traces" isDismissable>
<View padding="size-200">
<p
css={css`
margin: 0 0 var(--ac-global-dimension-size-100) 0;
`}
>
To get started with traces, you will need to setup tracing in your
application. Phoenix uses OpenTelemetry to collect traces and has
various integrations with orchestration frameworks, SDKs, and
languages. To get started, consult the documentation.
</p>
<ExternalLink href="https://docs.arize.com/phoenix/tracing/how-to-tracing">
View tracing documentation
</ExternalLink>
</View>
</Dialog>
);
};
return (
<tbody className="is-empty">
<tr>
<td
colSpan={100}
css={(theme) => css`
text-align: center;
padding: ${theme.spacing.margin24}px ${theme.spacing.margin24}px !important;
`}
>
<Flex direction="column" gap="size-200" alignItems="center">
No traces found for this project
<Button
variant="default"
icon={<Icon svg={<Icons.PlayCircleOutline />} />}
onClick={onGettingStartedClick}
>
Get Started
</Button>
</Flex>
</td>
</tr>
<DialogContainer onDismiss={() => setDialog(null)}>
{dialog}
</DialogContainer>
</tbody>
);
}
3 changes: 2 additions & 1 deletion app/src/pages/project/SpansTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import {
} from "./__generated__/SpansTable_spans.graphql";
import { SpansTableSpansQuery } from "./__generated__/SpansTableSpansQuery.graphql";
import { EvaluationLabel } from "./EvaluationLabel";
import { ProjectTableEmpty } from "./ProjectTableEmpty";
import { RetrievalEvaluationLabel } from "./RetrievalEvaluationLabel";
import { SpanColumnSelector } from "./SpanColumnSelector";
import { SpanFilterConditionField } from "./SpanFilterConditionField";
Expand Down Expand Up @@ -462,7 +463,7 @@ export function SpansTable(props: SpansTableProps) {
))}
</thead>
{isEmpty ? (
<TableEmpty />
<ProjectTableEmpty />
) : (
<tbody>
{rows.map((row) => {
Expand Down
4 changes: 2 additions & 2 deletions app/src/pages/project/TracesTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import { Link } from "@phoenix/components/Link";
import { TextCell } from "@phoenix/components/table";
import { IndeterminateCheckboxCell } from "@phoenix/components/table/IndeterminateCheckboxCell";
import { selectableTableCSS } from "@phoenix/components/table/styles";
import { TableEmpty } from "@phoenix/components/table/TableEmpty";
import { TableExpandButton } from "@phoenix/components/table/TableExpandButton";
import { TimestampCell } from "@phoenix/components/table/TimestampCell";
import { LatencyText } from "@phoenix/components/trace/LatencyText";
Expand All @@ -45,6 +44,7 @@ import {
} from "./__generated__/TracesTable_spans.graphql";
import { TracesTableQuery } from "./__generated__/TracesTableQuery.graphql";
import { EvaluationLabel } from "./EvaluationLabel";
import { ProjectTableEmpty } from "./ProjectTableEmpty";
import { RetrievalEvaluationLabel } from "./RetrievalEvaluationLabel";
import { SpanColumnSelector } from "./SpanColumnSelector";
import { SpanFilterConditionField } from "./SpanFilterConditionField";
Expand Down Expand Up @@ -582,7 +582,7 @@ export function TracesTable(props: TracesTableProps) {
))}
</thead>
{isEmpty ? (
<TableEmpty />
<ProjectTableEmpty />
) : (
<tbody>
{rows.map((row) => {
Expand Down
Loading