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

(frontend)[Age 1181]: Traces with on single main span are not correctly rendered #2163

Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ import {Space, Tree, Typography} from "antd"
import React, {useEffect, useState} from "react"
import {createUseStyles} from "react-jss"
import AvatarTreeContent from "../components/AvatarTreeContent"
import {TraceTabTypes} from "@/pages/apps/[app_id]/observability"

interface TraceTreeProps {
activeTrace: _AgentaRootsResponse
selected: string
setSelected: React.Dispatch<React.SetStateAction<string>>
traceTabs: TraceTabTypes
}

interface NodeTreeChildren {
Expand Down Expand Up @@ -118,7 +120,7 @@ const buildTreeData = (spans: _AgentaRootsResponse[]): NodeTreeChildren[] => {
}))
}

const TraceTree = ({activeTrace, selected, setSelected}: TraceTreeProps) => {
const TraceTree = ({activeTrace, selected, setSelected, traceTabs}: TraceTreeProps) => {
const classes = useStyles()
const [expandedKeys, setExpandedKeys] = useState<React.Key[]>([])

Expand All @@ -138,7 +140,7 @@ const TraceTree = ({activeTrace, selected, setSelected}: TraceTreeProps) => {

return (
<Tree
showLine
showLine={traceTabs === "node" ? false : true}
selectedKeys={[selected]}
expandedKeys={expandedKeys}
onExpand={onExpand}
Expand Down
3 changes: 2 additions & 1 deletion agenta-web/src/pages/apps/[app_id]/observability/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const useStyles = createUseStyles((theme: JSSTheme) => ({

interface Props {}

type TraceTabTypes = "tree" | "node" | "chat"
export type TraceTabTypes = "tree" | "node" | "chat"

const ObservabilityDashboard = ({}: Props) => {
const {traces, isLoading, count, fetchTraces} = useObservabilityData()
Expand Down Expand Up @@ -618,6 +618,7 @@ const ObservabilityDashboard = ({}: Props) => {
activeTrace={activeTrace}
selected={selected}
setSelected={setSelected}
traceTabs={traceTabs}
/>
}
/>
Expand Down