Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

New date picker for analytics (#327)

Max Deichmann85744b54490d
diff --git a/src/components/date-picker.tsx b/src/components/date-picker.tsx
index f0e74d5045..8245257b44 100644
--- a/src/components/date-picker.tsx
+++ b/src/components/date-picker.tsx
@@ -1,9 +1,7 @@
"use client";
import * as React from "react";
-import { format } from "date-fns";
import { Calendar as CalendarIcon } from "lucide-react";
-
import { Button } from "@/src/components/ui/button";
import { Calendar } from "@/src/components/ui/calendar";
import {
@@ -12,6 +10,23 @@ import {
PopoverTrigger,
} from "@/src/components/ui/popover";
import { cn } from "@/src/utils/tailwind";
+import { type DateRange } from "react-day-picker";
+import { addMinutes, format } from "date-fns";
+import {
+ Select,
+ SelectContent,
+ SelectItem,
+ SelectTrigger,
+ SelectValue,
+} from "@/src/components/ui/select";
+import { useState } from "react";
+import {
+ type DateTimeAggregationOption,
+ findClosestInterval,
+ dateTimeAggregationSettings,
+ dateTimeAggregationOptions,
+} from "@/src/features/dashboard/lib/timeseries-aggregation";
+import { getCurrentBreakpoint } from "@/src/features/dashboard/components/hooks";
export function DatePicker({
date,
@@ -48,3 +63,111 @@ export function DatePicker({
</Popover>
);
}
+
+export type DatePickerWithRangeProps = {
+ dateRange?: DateRange;
+ setDateRange: (date?: DateRange) => void;
+ className?: string;
+ setAgg: (agg: DateTimeAggregationOption) => void;
+};
+
+export function DatePickerWithRange({
+ className,
+ dateRange,
+ setDateRange,
+ setAgg,
+}: DatePickerWithRangeProps) {
+ const [selectedOption, setSelectedOption] = useState<
+ DateTimeAggregationOption | "Select date"
+ >("Select date");
+
+ function isValidOption(value: unknown): value is DateTimeAggregationOption {
+ return (
+ typeof value === "string" &&
+ dateTimeAggregationOptions.includes(value as DateTimeAggregationOption)
+ );
+ }
+
+ const closestInterval = dateRange
+ ? findClosestInterval(dateRange)
+ : undefined;
+
+ closestInterval ? setAgg(closestInterval) : null;
+
+ const onDropDownSelection = (value: string) => {
+ if (isValidOption(value)) {
+ const setting = dateTimeAggregationSettings[value];
+ const fromDate = addMinutes(new Date(), -1 * setting.minutes);
+
+ setDateRange({ from: fromDate, to: new Date() });
+ setSelectedOption(value);
+ } else {
+ setSelectedOption("Select date");
+ }
+ };
+
+ const onCalendarSelection = (range?: DateRange) => {
+ setDateRange(range);
+ setSelectedOption("Select date");
+ };
+
+ const breakpoint = getCurrentBreakpoint();
+
+ return (
+ <div
+ className={cn("my-3 flex flex-col-reverse gap-2 md:flex-row", className)}
+ >
+ <Popover>
+ <PopoverTrigger asChild>
+ <Button
+ id="date"
+ variant={"outline"}
+ className={cn(
+ "w-[350px] justify-start text-left font-normal",
+ !dateRange && "text-muted-foreground",
+ )}
+ >
+ <CalendarIcon className="mr-2 h-4 w-4" />
+ {dateRange?.from ? (
+ dateRange.to ? (
+ <>
+ {format(dateRange.from, "LLL dd, y : hh:mm")} -{" "}
+ {format(dateRange.to, "LLL dd, y : hh:mm")}
+ </>
+ ) : (
+ format(dateRange.from, "LLL dd, y")
+ )
+ ) : (
+ <span>Pick a date</span>
+ )}
+ </Button>
+ </PopoverTrigger>
+ <PopoverContent className="w-auto p-0" align="start">
+ <Calendar
+ initialFocus={true}
+ mode="range"
+ defaultMonth={dateRange?.from}
+ selected={dateRange}
+ onSelect={onCalendarSelection}
+ numberOfMonths={!breakpoint || breakpoint == "sm" ? 1 : 2} // TODO: make this configurable to screen size
+ />
+ </PopoverContent>
+ </Popover>
+ <Select value={selectedOption} onValueChange={onDropDownSelection}>
+ <SelectTrigger className="w-40 hover:bg-accent hover:text-accent-foreground focus:ring-0 focus:ring-offset-0">
+ <SelectValue placeholder="Select" />
+ </SelectTrigger>
+ <SelectContent position="popper" defaultValue={60}>
+ <SelectItem key={"Select date"} value={"Select date"}>
+ {"Select date"}
+ </SelectItem>
+ {dateTimeAggregationOptions.toReversed().map((item) => (
+ <SelectItem key={item} value={`${item}`}>
+ {item}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ </div>
+ );
+}
diff --git a/src/components/table/use-cases/traces.tsx b/src/components/table/use-cases/traces.tsx
index e193bcba92..240f71283c 100644
--- a/src/components/table/use-cases/traces.tsx
+++ b/src/components/table/use-cases/traces.tsx
@@ -96,7 +96,6 @@ export default function TracesTable({
const totalCount = traces.data?.slice(1)[0]?.totalCount ?? 0;
useEffect(() => {
if (traces.isSuccess && traces.data) {
- console.log("setting detail page list");
setDetailPageList(
"traces",
traces.data.map((t) => t.id),
diff --git a/src/features/dashboard/components/ChartScores.tsx b/src/features/dashboard/components/ChartScores.tsx
index c2b2bd8cec..74a9af3720 100644
--- a/src/features/dashboard/components/ChartScores.tsx
+++ b/src/features/dashboard/components/ChartScores.tsx
@@ -1,28 +1,64 @@
import { api } from "@/src/utils/api";
-import { type DateTimeAggregationOption } from "@/src/features/dashboard/lib/timeseries-aggregation";
+import {
+ dateTimeAggregationSettings,
+ type DateTimeAggregationOption,
+} from "@/src/features/dashboard/lib/timeseries-aggregation";
import { BaseTimeSeriesChart } from "@/src/features/dashboard/components/BaseTimeSeriesChart";
import { DashboardCard } from "@/src/features/dashboard/components/cards/DashboardCard";
+import { type FilterState } from "@/src/features/filters/types";
+import {
+ extractTimeSeriesData,
+ fillMissingValuesAndTransform,
+} from "@/src/features/dashboard/components/hooks";
export function ChartScores(props: {
className?: string;
agg: DateTimeAggregationOption;
+ globalFilterState: FilterState;
projectId: string;
}) {
- const data = api.dashboard.scores.useQuery({
- agg: props.agg,
+ const scores = api.dashboard.chart.useQuery({
projectId: props.projectId,
+ from: "traces_scores",
+ select: [{ column: "scoreName" }, { column: "value", agg: "AVG" }],
+ filter:
+ props.globalFilterState.map((f) =>
+ f.type === "datetime" ? { ...f, column: "timestamp" } : f,
+ ) ?? [],
+ groupBy: [
+ {
+ type: "datetime",
+ column: "timestamp",
+ temporalUnit: dateTimeAggregationSettings[props.agg].date_trunc,
+ },
+ {
+ type: "string",
+ column: "scoreName",
+ },
+ ],
});
+ const extractedScores = scores.data
+ ? fillMissingValuesAndTransform(
+ extractTimeSeriesData(scores.data, "timestamp", [
+ {
+ labelColumn: "scoreName",
+ valueColumn: "avgValue",
+ },
+ ]),
+ )
+ : [];
+
return (
<DashboardCard
className={props.className}
title="Scores"
description="Average"
- isLoading={data.isLoading}
+ isLoading={scores.isLoading}
>
<BaseTimeSeriesChart
agg={props.agg}
- data={data.data ?? []}
+ data={extractedScores ?? []}
connectNulls
/>
</DashboardCard>
diff --git a/src/features/dashboard/components/LatencyChart.tsx b/src/features/dashboard/components/LatencyChart.tsx
index a2c201d1ca..13327b6f17 100644
--- a/src/features/dashboard/components/LatencyChart.tsx
+++ b/src/features/dashboard/components/LatencyChart.tsx
@@ -6,8 +6,8 @@ import {
import { type FilterState } from "@/src/features/filters/types";
import {
getAllModels,
- reduceData,
- transformMapAndFillZeroValues,
+ extractTimeSeriesData,
+ fillMissingValuesAndTransform,
} from "@/src/features/dashboard/components/hooks";
import { DashboardCard } from "@/src/features/dashboard/components/cards/DashboardCard";
import { BaseTimeSeriesChart } from "@/src/features/dashboard/components/BaseTimeSeriesChart";
@@ -46,8 +46,10 @@ export const LatencyChart = ({
const transformedData =
data.data && allModels
- ? transformMapAndFillZeroValues(
- reduceData(data.data, "avgDuration"),
+ ? fillMissingValuesAndTransform(
+ extractTimeSeriesData(data.data, "startTime", [
+ { labelColumn: "model", valueColumn: "avgDuration" },
+ ]),
allModels,
)
: [];
diff --git a/src/features/dashboard/components/MetricTable.tsx b/src/features/dashboard/components/MetricTable.tsx
index 98872f9d39..4d8b8ba990 100644
--- a/src/features/dashboard/components/MetricTable.tsx
+++ b/src/features/dashboard/components/MetricTable.tsx
@@ -66,8 +66,8 @@ export const MetricTable = ({
<DashboardTable
headers={[
"Model",
- <RightAlignedCell key={1}>Total tokens</RightAlignedCell>,
- <RightAlignedCell key={1}>Total cost</RightAlignedCell>,
+ <RightAlignedCell key={0}>Total tokens</RightAlignedCell>,
+ <RightAlignedCell key={0}>Total cost</RightAlignedCell>,
]}
rows={metricsData}
collapse={{ collapsed: 5, expanded: 20 }}
diff --git a/src/features/dashboard/components/ModelUsageChart.tsx b/src/features/dashboard/components/ModelUsageChart.tsx
index bb7cd61919..762d5c6f27 100644
--- a/src/features/dashboard/components/ModelUsageChart.tsx
+++ b/src/features/dashboard/components/ModelUsageChart.tsx
@@ -8,8 +8,8 @@ import { type FilterState } from "@/src/features/filters/types";
import {
getAllModels,
- reduceData,
- transformMapAndFillZeroValues,
+ extractTimeSeriesData,
+ fillMissingValuesAndTransform,
} from "@/src/features/dashboard/components/hooks";
import { DashboardCard } from "@/src/features/dashboard/components/cards/DashboardCard";
import { numberFormatter, usdFormatter } from "@/src/utils/numbers";
@@ -55,16 +55,20 @@ export const ModelUsageChart = ({
const transformedTotalTokens =
tokens.data && allModels
- ? transformMapAndFillZeroValues(
- reduceData(tokens.data, "sumTotalTokens"),
+ ? fillMissingValuesAndTransform(
+ extractTimeSeriesData(tokens.data, "startTime", [
+ { labelColumn: "model", valueColumn: "sumTotalTokens" },
+ ]),
allModels,
)
: [];
const transformedModelCost =
tokens.data && allModels
- ? transformMapAndFillZeroValues(
- reduceData(tokens.data, "totalTokenCost"),
+ ? fillMissingValuesAndTransform(
+ extractTimeSeriesData(tokens.data, "startTime", [
+ { labelColumn: "model", valueColumn: "totalTokenCost" },
+ ]),
allModels,
)
: [];
diff --git a/src/features/dashboard/components/RightAlignedCell.tsx b/src/features/dashboard/components/RightAlignedCell.tsx
index 02fc9e3c52..70c8076d0d 100644
--- a/src/features/dashboard/components/RightAlignedCell.tsx
+++ b/src/features/dashboard/components/RightAlignedCell.tsx
@@ -1,4 +1,4 @@
-import { type ReactNode } from "react";
+import { type Key, type ReactNode } from "react";
import { cn } from "@/src/utils/tailwind";
export const RightAlignedCell = ({
@@ -8,7 +8,7 @@ export const RightAlignedCell = ({
}: {
children: ReactNode;
className?: string;
- key: number;
+ key?: Key;
}) => {
return (
<div className={cn("text-right", className)} key={key}>
diff --git a/src/features/dashboard/components/ScoresTable.tsx b/src/features/dashboard/components/ScoresTable.tsx
index ab1d72466e..14c405daa2 100644
--- a/src/features/dashboard/components/ScoresTable.tsx
+++ b/src/features/dashboard/components/ScoresTable.tsx
@@ -110,10 +110,10 @@ export const ScoresTable = ({
<DashboardTable
headers={[
"Name",
- <RightAlignedCell key={1}>Count</RightAlignedCell>,
- <RightAlignedCell key={1}>Average</RightAlignedCell>,
- <RightAlignedCell key={1}>0</RightAlignedCell>,
- <RightAlignedCell key={1}>1</RightAlignedCell>,
+ <RightAlignedCell key={0}>Count</RightAlignedCell>,
+ <RightAlignedCell key={0}>Average</RightAlignedCell>,
+ <RightAlignedCell key={0}>0</RightAlignedCell>,
+ <RightAlignedCell key={0}>1</RightAlignedCell>,
]}
rows={
data.map((item, i) => [
diff --git a/src/features/dashboard/components/hooks.ts b/src/features/dashboard/components/hooks.ts
index 8012690016..0cafb1362e 100644
--- a/src/features/dashboard/components/hooks.ts
+++ b/src/features/dashboard/components/hooks.ts
@@ -28,59 +28,100 @@ const extractAllModels = (data: DatabaseRow[]): string[] => {
.map((item) => item.model as string);
};
-type Field = string;
-
type ChartData = {
- model: string;
+ label: string;
value?: number;
};
-export function reduceData(
+// we get data for time series in the following format:
+// ts: 123, label1: 1, label2: 2
+// ts: 456, label1: 5, label2: 9
+// This needs to be mapped to the following format:
+// [{ts: 123, values: [{label1: 1, label2: 2}]}, {ts: 456, values: [{label1: 5, label2: 9}]]
+
+type FieldMappingItem = {
+ labelColumn: string;
+ valueColumn: string;
+};
+
+export function extractTimeSeriesData(
data: DatabaseRow[],
- field: Field,
+ timeColumn: string,
+ mapping: FieldMappingItem[],
): Map<number, ChartData[]> {
return data.reduce((acc: Map<number, ChartData[]>, curr: DatabaseRow) => {
- const date = new Date(curr.startTime as Date).getTime();
+ const date = new Date(curr[timeColumn] as Date).getTime();
- const reducedData: ChartData | undefined = curr.model
- ? {
- model: curr.model as string,
- value: typeof curr[field] === "number" ? (curr[field] as number) : 0,
- }
- : undefined;
+ const reducedData: ChartData[] = [];
+ // Map the desired fields from the DatabaseRow to the ChartData based on the mapping provided
+ mapping.forEach((mapItem) => {
+ const labelValue = curr[mapItem.labelColumn] as string;
+ const columnValue = curr[mapItem.valueColumn];
+ if (
+ labelValue &&
+ columnValue !== undefined &&
+ typeof labelValue === "string"
+ ) {
+ reducedData.push({
+ label: labelValue,
+ value: columnValue ? (columnValue as number) : 0,
+ });
+ }
+ });
- if (acc.has(date)) {
- reducedData ? acc.get(date)!.push(reducedData) : null;
+ const existingData = acc.get(date);
+ if (existingData) {
+ existingData.push(...reducedData);
} else {
- acc.set(date, reducedData ? [reducedData] : []);
+ acc.set(date, reducedData);
}
return acc;
}, new Map<number, ChartData[]>());
}
-export function transformMapAndFillZeroValues(
- map: Map<number, ChartData[]>,
- allModels: string[],
+export function fillMissingValuesAndTransform(
+ inputMap: Map<number, ChartData[]>,
+ labelsToAdd: string[] = [],
): TimeSeriesChartDataPoint[] {
const result: TimeSeriesChartDataPoint[] = [];
- for (const [date, items] of map) {
- const values = items.map((item) => ({
- label: item.model,
- value: item.value,
- }));
+ inputMap.forEach((chartDataArray, timestamp) => {
+ const existingLabels = chartDataArray.map((value) => value.label);
- for (const model of allModels) {
- if (!values.find((value) => value.label === model)) {
- values.push({ label: model, value: 0 });
+ // For each label in labelsToAdd, add a default value of 0
+ labelsToAdd.forEach((label) => {
+ if (!existingLabels.includes(label)) {
+ chartDataArray.push({ label: label, value: 0 });
}
- }
+ });
+
result.push({
- ts: date,
- values: values,
+ ts: timestamp,
+ values: chartDataArray,
});
- }
+ });
return result;
}
+
+export type Breakpoint = "sm" | "md" | "lg" | "xl" | "2xl" | null;
+
+// TODO: adjust breakpoints to match tailwind and make responsive
+export function getCurrentBreakpoint(): Breakpoint {
+ const width = window.innerWidth;
+
+ if (width >= 1536) {
+ return "2xl";
+ } else if (width >= 1280) {
+ return "xl";
+ } else if (width >= 1024) {
+ return "lg";
+ } else if (width >= 768) {
+ return "md";
+ } else if (width >= 640) {
+ return "sm";
+ } else {
+ return null;
+ }
+}
diff --git a/src/features/dashboard/lib/timeseries-aggregation.ts b/src/features/dashboard/lib/timeseries-aggregation.ts
index 0e7fbe67a4..fcbcffdddc 100644
--- a/src/features/dashboard/lib/timeseries-aggregation.ts
+++ b/src/features/dashboard/lib/timeseries-aggregation.ts
@@ -1,3 +1,5 @@
+import { type DateRange } from "react-day-picker";
+
export const dateTimeAggregationOptions = [
"1 year",
"3 months",
@@ -16,41 +18,72 @@ export const dateTimeAggregationSettings: Record<
{
date_trunc: "year" | "month" | "week" | "day" | "hour" | "minute";
date_formatter: (date: Date) => string;
+ minutes: number;
}
> = {
"1 year": {
date_trunc: "month",
date_formatter: (date) =>
date.toLocaleDateString("en-US", { year: "2-digit", month: "short" }),
+ minutes: 365 * 24 * 60,
},
"3 months": {
date_trunc: "day",
date_formatter: (date) =>
date.toLocaleDateString("en-US", { month: "short", day: "numeric" }),
+ minutes: 3 * 30 * 24 * 60,
},
"1 month": {
date_trunc: "day",
date_formatter: (date) =>
date.toLocaleDateString("en-US", { month: "short", day: "numeric" }),
+ minutes: 30 * 24 * 60,
},
"7 days": {
date_trunc: "day",
date_formatter: (date) =>
date.toLocaleDateString("en-US", { month: "short", day: "numeric" }),
+ minutes: 7 * 24 * 60,
},
"24 hours": {
date_trunc: "hour",
date_formatter: (date) =>
date.toLocaleTimeString("en-US", { hour: "numeric" }),
+ minutes: 24 * 60,
},
"1 hour": {
date_trunc: "minute",
date_formatter: (date) =>
date.toLocaleTimeString("en-US", { hour: "numeric", minute: "numeric" }),
+ minutes: 60,
},
"30 minutes": {
date_trunc: "minute",
date_formatter: (date) =>
date.toLocaleTimeString("en-US", { hour: "numeric", minute: "numeric" }),
+ minutes: 30,
},
};
+
+export const findClosestInterval = (
+ dateRange: DateRange,
+): DateTimeAggregationOption | undefined => {
+ // Check for valid date range
+ if (!dateRange.from || !dateRange.to) return undefined;
+
+ const duration = dateRange.to.getTime() - dateRange.from.getTime();
+
+ // Map intervals to their difference from the given duration
+ const diffs = dateTimeAggregationOptions.map((interval) => {
+ const { minutes } = dateTimeAggregationSettings[interval];
+ return {
+ interval: interval,
+ diff: Math.abs(duration - minutes * 60 * 1000),
+ };
+ });
+
+ // Sort by difference and pick the first one
+ diffs.sort((a, b) => a.diff - b.diff);
+
+ return diffs[0]?.interval;
+};
diff --git a/src/features/dashboard/server/dashboard-router.ts b/src/features/dashboard/server/dashboard-router.ts
index cdab057223..fa61e0c27a 100644
--- a/src/features/dashboard/server/dashboard-router.ts
+++ b/src/features/dashboard/server/dashboard-router.ts
@@ -15,6 +15,7 @@ export const dashboardRouter = createTRPCRouter({
chart: protectedProjectProcedure
.input(sqlInterface.extend({ projectId: z.string() }))
.query(async ({ input, ctx }) => {
+ console.log(`Trying to fetch chart data`);
return await executeQuery(ctx.prisma, input.projectId, input);
}),
diff --git a/src/pages/project/[projectId]/index.tsx b/src/pages/project/[projectId]/index.tsx
index 8be3eaba63..ab44b13f18 100644
--- a/src/pages/project/[projectId]/index.tsx
+++ b/src/pages/project/[projectId]/index.tsx
@@ -1,10 +1,6 @@
import { useState } from "react";
import Header from "@/src/components/layouts/header";
-import { Tabs, TabsList, TabsTrigger } from "@/src/components/ui/tabs";
-import {
- dateTimeAggregationOptions,
- type DateTimeAggregationOption,
-} from "@/src/features/dashboard/lib/timeseries-aggregation";
+import { type DateTimeAggregationOption } from "@/src/features/dashboard/lib/timeseries-aggregation";
import { useRouter } from "next/router";
import { LatencyChart } from "@/src/features/dashboard/components/LatencyChart";
import { ChartScores } from "@/src/features/dashboard/components/ChartScores";
@@ -14,195 +10,92 @@ import { ScoresTable } from "@/src/features/dashboard/components/ScoresTable";
import { ModelUsageChart } from "@/src/features/dashboard/components/ModelUsageChart";
import { TracesTimeSeriesChart } from "@/src/features/dashboard/components/TracesTimeSeriesChart";
import { UserChart } from "@/src/features/dashboard/components/UserChart";
+import { DatePickerWithRange } from "@/src/components/date-picker";
+import { type DateRange } from "react-day-picker";
+import { addDays } from "date-fns";
export default function Start() {
const [agg, setAgg] = useState<DateTimeAggregationOption>("7 days");
const router = useRouter();
const projectId = router.query.projectId as string;
- const convertAggToDateTime = (agg: DateTimeAggregationOption) => {
- const [num, unit] = agg.split(" ");
+ const [dateRange, setDateRange] = useState<DateRange | undefined>({
+ from: addDays(new Date(), -30),
+ to: new Date(),
+ });
- if (!num || !unit) throw new Error("Invalid agg");
- const now = new Date();
- switch (unit) {
- case "minutes":
- case "minute":
- return new Date(now.getTime() - parseInt(num) * 60 * 1000);
- case "hours":
- case "hour":
- return new Date(now.getTime() - parseInt(num) * 60 * 60 * 1000);
- case "days":
- return new Date(now.getTime() - parseInt(num) * 24 * 60 * 60 * 1000);
- case "weeks":
- return new Date(
- now.getTime() - parseInt(num) * 7 * 24 * 60 * 60 * 1000,
- );
- case "months":
- case "month":
- return new Date(
- now.getTime() - parseInt(num) * 30 * 24 * 60 * 60 * 1000,
- );
- case "year":
- case "years":
- return new Date(
- now.getTime() - parseInt(num) * 365 * 24 * 60 * 60 * 1000,
- );
- }
- throw new Error("Invalid agg");
- };
+ const globalFilterState =
+ dateRange && dateRange.from && dateRange.to
+ ? [
+ {
+ type: "datetime" as const,
+ column: "startTime",
+ operator: ">" as const,
+ value: dateRange.from,
+ },
+ {
+ type: "datetime" as const,
+ column: "startTime",
+ operator: "<" as const,
+ value: dateRange.to,
+ },
+ ]
+ : [];
return (
<div className="md:container">
<Header title="Dashboard" />
- <Tabs
- value={agg}
- onValueChange={(value) => setAgg(value as DateTimeAggregationOption)}
- className="mb-4 max-w-full overflow-x-auto"
- >
- <TabsList>
- {dateTimeAggregationOptions.map((option) => (
- <TabsTrigger key={option} value={option}>
- {option}
- </TabsTrigger>
- ))}
- </TabsList>
- </Tabs>
+ <DatePickerWithRange
+ dateRange={dateRange}
+ setDateRange={setDateRange}
+ setAgg={setAgg}
+ className=" max-w-full overflow-x-auto"
+ />
<div className="grid w-full grid-cols-1 gap-4 overflow-hidden lg:grid-cols-2 xl:grid-cols-6">
<TracesBarListChart
className="col-span-1 xl:col-span-2 "
projectId={projectId}
- globalFilterState={[
- {
- column: "startTime",
- operator: ">",
- type: "datetime",
- value: convertAggToDateTime(agg),
- },
- {
- column: "startTime",
- operator: "<",
- type: "datetime",
- value: new Date(),
- },
- ]}
+ globalFilterState={globalFilterState}
/>
<MetricTable
className="col-span-1 xl:col-span-2"
projectId={projectId}
- globalFilterState={[
- {
- column: "startTime",
- operator: ">",
- type: "datetime",
- value: convertAggToDateTime(agg),
- },
- {
- column: "startTime",
- operator: "<",
- type: "datetime",
- value: new Date(),
- },
- ]}
+ globalFilterState={globalFilterState}
/>
<ScoresTable
className="col-span-1 xl:col-span-2"
projectId={projectId}
- globalFilterState={[
- {
- column: "startTime",
- operator: ">",
- type: "datetime",
- value: convertAggToDateTime(agg),
- },
- {
- column: "startTime",
- operator: "<",
- type: "datetime",
- value: new Date(),
- },
- ]}
+ globalFilterState={globalFilterState}
/>
<TracesTimeSeriesChart
className="col-span-1 xl:col-span-3"
projectId={projectId}
- globalFilterState={[
- {
- column: "startTime",
- operator: ">",
- type: "datetime",
- value: convertAggToDateTime(agg),
- },
- {
- column: "startTime",
- operator: "<",
- type: "datetime",
- value: new Date(),
- },
- ]}
+ globalFilterState={globalFilterState}
agg={agg}
/>
<ModelUsageChart
className="min-h-24 col-span-1 xl:col-span-3"
projectId={projectId}
- globalFilterState={[
- {
- column: "startTime",
- operator: ">",
- type: "datetime",
- value: convertAggToDateTime(agg),
- },
- {
- column: "startTime",
- operator: "<",
- type: "datetime",
- value: new Date(),
- },
- ]}
+ globalFilterState={globalFilterState}
agg={agg}
/>
<UserChart
className="col-span-1 xl:col-span-3"
projectId={projectId}
- globalFilterState={[
- {
- column: "startTime",
- operator: ">",
- type: "datetime",
- value: convertAggToDateTime(agg),
- },
- {
- column: "startTime",
- operator: "<",
- type: "datetime",
- value: new Date(),
- },
- ]}
+ globalFilterState={globalFilterState}
agg={agg}
/>
<ChartScores
className="col-span-1 xl:col-span-3"
agg={agg}
projectId={projectId}
+ globalFilterState={globalFilterState}
/>
<LatencyChart
className="col-span-1 flex-auto justify-between xl:col-span-full"
projectId={projectId}
agg={agg}
- globalFilterState={[
- {
- column: "startTime",
- operator: ">",
- type: "datetime",
- value: convertAggToDateTime(agg),
- },
- {
- column: "startTime",
- operator: "<",
- type: "datetime",
- value: new Date(),
- },
- ]}
+ globalFilterState={globalFilterState}
/>
</div>
</div>