Skip to content

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

feat: add nudging for empty states tracing (#10832)

Lotte Verheyden4b91c51fe567
diff --git a/web/src/components/layouts/doc-popup.tsx b/web/src/components/layouts/doc-popup.tsx
index 1966174e8a..2cde952b60 100644
--- a/web/src/components/layouts/doc-popup.tsx
+++ b/web/src/components/layouts/doc-popup.tsx
@@ -55,18 +55,14 @@ export default function DocPopup({
</HoverCardTrigger>
<Portal>
<HoverCardContent>
- {typeof description === "string" ? (
- <div
- className={cn(
- "whitespace-break-spaces text-xs font-normal text-primary sm:pl-0",
- className,
- )}
- >
- {description}
- </div>
- ) : (
- description
- )}
+ <div
+ className={cn(
+ "whitespace-break-spaces text-xs font-normal text-primary sm:pl-0",
+ className,
+ )}
+ >
+ {description}
+ </div>
</HoverCardContent>
</Portal>
</HoverCard>
@@ -85,13 +81,9 @@ export function Popup({ triggerContent, description }: PopupProps) {
<div>{triggerContent}</div>
</HoverCardTrigger>
<HoverCardContent>
- {typeof description === "string" ? (
- <div className="whitespace-break-spaces text-xs font-normal text-primary sm:pl-0">
- {description}
- </div>
- ) : (
- description
- )}
+ <div className="whitespace-break-spaces text-xs font-normal text-primary sm:pl-0">
+ {description}
+ </div>
</HoverCardContent>
</HoverCard>
);
diff --git a/web/src/components/layouts/page-header.tsx b/web/src/components/layouts/page-header.tsx
index 59ebbb4cd3..37039462ae 100644
--- a/web/src/components/layouts/page-header.tsx
+++ b/web/src/components/layouts/page-header.tsx
@@ -38,7 +38,7 @@ export type PageHeaderProps = {
breadcrumb?: { name: string; href?: string }[];
actionButtonsLeft?: React.ReactNode; // Right-side actions (buttons, etc.)
actionButtonsRight?: React.ReactNode; // Right-side actions (buttons, etc.)
- help?: { description: string; href?: string; className?: string };
+ help?: { description: React.ReactNode; href?: string; className?: string };
titleTooltip?: string;
itemType?: LangfuseItemType;
container?: boolean;
diff --git a/web/src/components/onboarding/SessionsOnboarding.tsx b/web/src/components/onboarding/SessionsOnboarding.tsx
index ad3e893a9c..2fb838a2ca 100644
--- a/web/src/components/onboarding/SessionsOnboarding.tsx
+++ b/web/src/components/onboarding/SessionsOnboarding.tsx
@@ -1,56 +1,27 @@
import React from "react";
-import {
- SplashScreen,
- type ValueProposition,
-} from "@/src/components/ui/splash-screen";
-import { BarChart4, GitMerge, MessageSquare, Users } from "lucide-react";
-import Link from "next/link";
+import { SplashScreen } from "@/src/components/ui/splash-screen";
+import { ActionButton } from "@/src/components/ActionButton";
export function SessionsOnboarding() {
- const valuePropositions: ValueProposition[] = [
- {
- title: "Group related traces",
- description:
- "Sessions allow you to group related traces, such as a conversation or thread, for better organization and analysis",
- icon: <MessageSquare className="h-4 w-4" />,
- },
- {
- title: "Track user interactions",
- description: "Monitor how users interact with your application over time",
- icon: <Users className="h-4 w-4" />,
- },
- {
- title: "Analyze conversation flows",
- description: "Understand the complete flow of multi-turn conversations",
- icon: <GitMerge className="h-4 w-4" />,
- },
- {
- title: "Session-level metrics",
- description:
- "Get aggregated metrics for entire sessions, including costs and token usage",
- icon: <BarChart4 className="h-4 w-4" />,
- },
- ];
-
return (
<SplashScreen
- title="Get Started with Sessions"
- description="Sessions allow you to group related traces together, such as a conversation or thread. Use sessions to track interactions over time and analyze conversation/thread flows."
- valuePropositions={valuePropositions}
- gettingStarted={
- <span>
- To start using sessions, you need to add a `sessionId` to your traces.
- See{" "}
- <Link
- href="https://langfuse.com/docs/observability/features/sessions"
- className="underline"
- >
- documentation
- </Link>{" "}
- for more details.
- </span>
- }
+ title="You aren't using sessions yet"
+ description="Sessions let you group traces that belong to the same workflow, or conversation."
videoSrc="https://static.langfuse.com/prod-assets/onboarding/sessions-overview-v1.mp4"
- />
+ >
+ <div className="mt-8">
+ <h3 className="mb-4 text-2xl font-semibold">Start using sessions</h3>
+ <p className="mb-4 text-sm text-muted-foreground">
+ To start using sessions, you need to add a <code>sessionId</code> to
+ your traces.
+ </p>
+ <ActionButton
+ href="https://langfuse.com/docs/observability/features/sessions"
+ variant="default"
+ >
+ Read the docs
+ </ActionButton>
+ </div>
+ </SplashScreen>
);
}
diff --git a/web/src/components/onboarding/TracesOnboarding.tsx b/web/src/components/onboarding/TracesOnboarding.tsx
index 73f01884bb..94ac18e315 100644
--- a/web/src/components/onboarding/TracesOnboarding.tsx
+++ b/web/src/components/onboarding/TracesOnboarding.tsx
@@ -1,56 +1,22 @@
import React from "react";
-import {
- SplashScreen,
- type ValueProposition,
-} from "@/src/components/ui/splash-screen";
-import { setupTracingRoute } from "@/src/features/setup/setupRoutes";
-import { BarChart4, GitMerge, Search, Zap } from "lucide-react";
+import { SplashScreen } from "@/src/components/ui/splash-screen";
+import { TracingSetup } from "@/src/pages/project/[projectId]/traces/setup";
interface TracesOnboardingProps {
projectId: string;
}
export function TracesOnboarding({ projectId }: TracesOnboardingProps) {
- const valuePropositions: ValueProposition[] = [
- {
- title: "Full context capture",
- description:
- "Track the complete execution flow including API calls, context, prompts, parallelism and more",
- icon: <GitMerge className="h-4 w-4" />,
- },
- {
- title: "Cost monitoring",
- description: "Track model usage and costs across your application",
- icon: <BarChart4 className="h-4 w-4" />,
- },
- {
- title: "Basis for evaluation",
- description:
- "Add evaluation scores to identify issues and track metrics over time",
- icon: <Search className="h-4 w-4" />,
- },
- {
- title: "Open and Multi-modal",
- description:
- "Langfuse traces can include images, audio, and other modalities. You can fully customize them to fit your needs",
- icon: <Zap className="h-4 w-4" />,
- },
- ];
-
return (
<SplashScreen
- title="Get Started with LLM Tracing"
- description="Traces allow you to track every LLM call and other relevant logic in your app/agent. Nested traces in Langfuse help to understand what is happening and identify the root cause of problems."
- valuePropositions={valuePropositions}
- primaryAction={{
- label: "Configure Tracing",
- href: setupTracingRoute(projectId),
- }}
- secondaryAction={{
- label: "View Documentation",
- href: "https://langfuse.com/docs/observability/overview",
- }}
+ title="You don't have any traces yet"
+ description="Traces show you how your LLM calls behave in your application: what they cost, how they perform, and where things go wrong. It's the first step towards improving the behavior of your app."
videoSrc="https://static.langfuse.com/prod-assets/onboarding/tracing-overview-v1.mp4"
- />
+ >
+ <div className="mt-8">
+ <h3 className="mb-8 text-2xl font-semibold">Get started</h3>
+ <TracingSetup projectId={projectId} hasTracingConfigured={false} />
+ </div>
+ </SplashScreen>
);
}
diff --git a/web/src/components/onboarding/UsersOnboarding.tsx b/web/src/components/onboarding/UsersOnboarding.tsx
index c13b9ac86c..55b2ec8a12 100644
--- a/web/src/components/onboarding/UsersOnboarding.tsx
+++ b/web/src/components/onboarding/UsersOnboarding.tsx
@@ -1,57 +1,27 @@
import React from "react";
-import {
- SplashScreen,
- type ValueProposition,
-} from "@/src/components/ui/splash-screen";
-import { Users, LineChart, Filter, BarChart4 } from "lucide-react";
-import Link from "next/link";
-export function UsersOnboarding() {
- const valuePropositions: ValueProposition[] = [
- {
- title: "Track user interactions",
- description:
- "Attribute data in Langfuse to specific users by adding a userId to your traces",
- icon: <Users className="h-4 w-4" />,
- },
- {
- title: "Analyze user behavior",
- description:
- "Understand how different users interact with your LLM applications",
- icon: <LineChart className="h-4 w-4" />,
- },
- {
- title: "Filter by user segments",
- description:
- "Compare performance across different user segments to identify patterns",
- icon: <Filter className="h-4 w-4" />,
- },
- {
- title: "Monitor usage metrics",
- description:
- "Track token usage, costs, and other metrics on a per-user basis",
- icon: <BarChart4 className="h-4 w-4" />,
- },
- ];
+import { SplashScreen } from "@/src/components/ui/splash-screen";
+import { ActionButton } from "@/src/components/ActionButton";
+export function UsersOnboarding() {
return (
<SplashScreen
- title="Get Started with User Tracking"
- description="Correlate costs, evaluations and other LLM Application metrics to specific users. Start tracking users to better understand how they interact with your LLM applications."
- valuePropositions={valuePropositions}
- gettingStarted={
- <span>
- To start tracking users, you need to add a `userId` to your traces.
- See{" "}
- <Link
- href="https://langfuse.com/docs/observability/features/users"
- className="underline"
- >
- documentation
- </Link>{" "}
- for more details.
- </span>
- }
+ title="You aren't tracking users yet"
+ description="Once you add a user ID to your traces, you can correlate costs, evaluations and other LLM Application metrics to better understand how they interact with your LLM applications."
videoSrc="https://static.langfuse.com/prod-assets/onboarding/users-overview-v1.mp4"
- />
+ >
+ <div className="mt-8">
+ <h3 className="mb-4 text-2xl font-semibold">Start tracking users</h3>
+ <p className="mb-4 text-sm text-muted-foreground">
+ To start tracking users, you need to add a <code>userId</code> to your
+ traces.
+ </p>
+ <ActionButton
+ href="https://langfuse.com/docs/observability/features/users"
+ variant="default"
+ >
+ Read the docs
+ </ActionButton>
+ </div>
+ </SplashScreen>
);
}
diff --git a/web/src/components/table/data-table-controls.tsx b/web/src/components/table/data-table-controls.tsx
index d73b24dcb3..8b6579e59e 100644
--- a/web/src/components/table/data-table-controls.tsx
+++ b/web/src/components/table/data-table-controls.tsx
@@ -608,8 +608,40 @@ export function CategoricalFacet({
))}
</>
) : options.length === 0 ? (
- <div className="py-1 text-center text-xs text-muted-foreground">
- No options found
+ <div className="py-1 text-xs text-muted-foreground">
+ {filterKey === "sessionId" ? (
+ <span>
+ Sessions group traces together, which is useful for tracing
+ multi-step workflows.{" "}
+ <a
+ href="https://langfuse.com/docs/observability/features/sessions"
+ target="_blank"
+ rel="noopener noreferrer"
+ className="underline hover:text-foreground"
+ >
+ See docs
+ </a>{" "}
+ to learn how to add sessions to your traces.
+ </span>
+ ) : filterKey === "name" ? (
+ <span>No trace names found in the given time range.</span>
+ ) : filterKey === "tags" ? (
+ <span>
+ Tags let you filter traces according to custom categories
+ (e.g. feature flags).{" "}
+ <a
+ href="https://langfuse.com/docs/observability/features/tags"
+ target="_blank"
+ rel="noopener noreferrer"
+ className="underline hover:text-foreground"
+ >
+ See docs
+ </a>{" "}
+ to learn how to add tags to your traces.
+ </span>
+ ) : (
+ "No options found"
+ )}
</div>
) : (
<>
@@ -668,6 +700,23 @@ export function CategoricalFacet({
)}
</>
)}
+ {filterKey === "environment" &&
+ options.length === 1 &&
+ options[0]?.toLowerCase() === "default" ? (
+ <div className="mt-2 px-2 text-xs text-muted-foreground">
+ Environments help you separate traces from different
+ contexts (e.g. production, staging).{" "}
+ <a
+ href="https://langfuse.com/docs/observability/features/environments"
+ target="_blank"
+ rel="noopener noreferrer"
+ className="underline hover:text-foreground"
+ >
+ See docs
+ </a>{" "}
+ on how to add environments to your traces.
+ </div>
+ ) : null}
</>
)}
</div>
diff --git a/web/src/components/table/types.ts b/web/src/components/table/types.ts
index 601e27c6f4..ada3c2234e 100644
--- a/web/src/components/table/types.ts
+++ b/web/src/components/table/types.ts
@@ -13,7 +13,7 @@ type ExtendedColumnDef<TData extends RowData, TValue = unknown> = ColumnDef<
> & {
defaultHidden?: boolean;
headerTooltip?: {
- description: string;
+ description: React.ReactNode;
href?: string;
};
isFixedPosition?: boolean; // if true, column cannot be reordered
diff --git a/web/src/components/table/use-cases/traces.tsx b/web/src/components/table/use-cases/traces.tsx
index fcbacb74e2..55b577e32e 100644
--- a/web/src/components/table/use-cases/traces.tsx
+++ b/web/src/components/table/use-cases/traces.tsx
@@ -759,7 +759,21 @@ export default function TracesTable({
header: "Tags",
size: 150,
headerTooltip: {
- description: "Group traces with tags.",
+ description: (
+ <>
+ Group traces with tags. Read more about implementing tags{" "}
+ <a
+ href="https://langfuse.com/docs/observability/features/tags"
+ target="_blank"
+ rel="noopener noreferrer"
+ className="underline decoration-primary/30 hover:decoration-primary"
+ onClick={(e) => e.stopPropagation()}
+ >
+ here
+ </a>
+ .
+ </>
+ ),
href: "https://langfuse.com/docs/observability/features/tags",
},
cell: ({ row }) => {
@@ -784,7 +798,22 @@ export default function TracesTable({
header: "Metadata",
size: 400,
headerTooltip: {
- description: "Add metadata to traces to track additional information.",
+ description: (
+ <>
+ Add metadata to traces to track additional information. Read more
+ about adding metadata{" "}
+ <a
+ href="https://langfuse.com/docs/observability/features/metadata"
+ target="_blank"
+ rel="noopener noreferrer"
+ className="underline decoration-primary/30 hover:decoration-primary"
+ onClick={(e) => e.stopPropagation()}
+ >
+ here
+ </a>
+ .
+ </>
+ ),
href: "https://langfuse.com/docs/observability/features/metadata",
},
cell: ({ row }) => {
@@ -827,7 +856,22 @@ export default function TracesTable({
header: "Session",
size: 150,
headerTooltip: {
- description: "Add `sessionId` to traces to track sessions.",
+ description: (
+ <>
+ Group traces into sessions to track longer conversations/workflows.
+ Read more about sessions{" "}
+ <a
+ href="https://langfuse.com/docs/observability/features/sessions"
+ target="_blank"
+ rel="noopener noreferrer"
+ className="underline decoration-primary/30 hover:decoration-primary"
+ onClick={(e) => e.stopPropagation()}
+ >
+ here
+ </a>
+ .
+ </>
+ ),
href: "https://langfuse.com/docs/observability/features/sessions",
},
cell: ({ row }) => {
@@ -846,7 +890,22 @@ export default function TracesTable({
id: "userId",
size: 150,
headerTooltip: {
- description: "Add `userId` to traces to track users.",
+ description: (
+ <>
+ Add <code>userId</code> to traces to track users. Read more about
+ user tracking{" "}
+ <a
+ href="https://langfuse.com/docs/observability/features/users"
+ target="_blank"
+ rel="noopener noreferrer"
+ className="underline decoration-primary/30 hover:decoration-primary"
+ onClick={(e) => e.stopPropagation()}
+ >
+ here
+ </a>
+ .
+ </>
+ ),
href: "https://langfuse.com/docs/observability/features/users",
},
cell: ({ row }) => {
@@ -908,7 +967,21 @@ export default function TracesTable({
header: "Version",
size: 100,
headerTooltip: {
- description: "Track changes via the version tag.",
+ description: (
+ <>
+ Track changes via the version tag. Read more about versions{" "}
+ <a
+ href="https://langfuse.com/docs/observability/features/releases-and-versioning"
+ target="_blank"
+ rel="noopener noreferrer"
+ className="underline decoration-primary/30 hover:decoration-primary"
+ onClick={(e) => e.stopPropagation()}
+ >
+ here
+ </a>
+ .
+ </>
+ ),
href: "https://langfuse.com/docs/observability/features/releases-and-versioning",
},
defaultHidden: true,
@@ -921,7 +994,22 @@ export default function TracesTable({
header: "Release",
size: 100,
headerTooltip: {
- description: "Track changes to your application via the release tag.",
+ description: (
+ <>
+ Track changes to your application via the release tag. Read more
+ about the release tag{" "}
+ <a
+ href="https://langfuse.com/docs/observability/features/releases-and-versioning"
+ target="_blank"
+ rel="noopener noreferrer"
+ className="underline decoration-primary/30 hover:decoration-primary"
+ onClick={(e) => e.stopPropagation()}
+ >
+ here
+ </a>
+ .
+ </>
+ ),
href: "https://langfuse.com/docs/observability/features/releases-and-versioning",
},
defaultHidden: true,
diff --git a/web/src/pages/project/[projectId]/sessions.tsx b/web/src/pages/project/[projectId]/sessions.tsx
index f9c659befa..1fb05fb420 100644
--- a/web/src/pages/project/[projectId]/sessions.tsx
+++ b/web/src/pages/project/[projectId]/sessions.tsx
@@ -47,8 +47,23 @@ export default function Sessions() {
headerProps={{
title: "Sessions",
help: {
- description:
- "A session is a collection of related traces, such as a conversation or thread. To begin, add a sessionId to the trace.",
+ description: (
+ <>
+ A session is a collection of related traces, such as a
+ conversation or thread. To begin, add a sessionId to the trace.
+ See{" "}
+ <a
+ href="https://langfuse.com/docs/observability/features/sessions"
+ target="_blank"
+ rel="noopener noreferrer"
+ className="underline decoration-primary/30 hover:decoration-primary"
+ onClick={(e) => e.stopPropagation()}
+ >
+ docs
+ </a>{" "}
+ to learn more.
+ </>
+ ),
href: "https://langfuse.com/docs/observability/features/sessions",
},
}}
diff --git a/web/src/pages/project/[projectId]/traces.tsx b/web/src/pages/project/[projectId]/traces.tsx
index fb415bc952..ca2c412058 100644
--- a/web/src/pages/project/[projectId]/traces.tsx
+++ b/web/src/pages/project/[projectId]/traces.tsx
@@ -49,7 +49,7 @@ export default function Traces() {
title: "Tracing",
help: {
description:
- "A trace represents a single function/api invocation. Traces contain observations. See docs to learn more.",
+ "A trace represents a single function/api invocation. Traces contain observations. See [docs](https://langfuse.com/docs/observability/data-model) to learn more.",
href: "https://langfuse.com/docs/observability/data-model",
},
}}
@@ -65,8 +65,22 @@ export default function Traces() {
headerProps={{
title: "Tracing",
help: {
- description:
- "A trace represents a single function/api invocation. Traces contain observations. See docs to learn more.",
+ description: (
+ <>
+ A trace represents a single function/api invocation. Traces
+ contain observations. See{" "}
+ <a
+ href="https://langfuse.com/docs/observability/data-model"
+ target="_blank"
+ rel="noopener noreferrer"
+ className="underline decoration-primary/30 hover:decoration-primary"
+ onClick={(e) => e.stopPropagation()}
+ >
+ docs
+ </a>{" "}
+ to learn more.
+ </>
+ ),
href: "https://langfuse.com/docs/observability/data-model",
},
tabsProps: isBetaEnabled
diff --git a/web/src/pages/project/[projectId]/traces/setup.tsx b/web/src/pages/project/[projectId]/traces/setup.tsx
index a6c3c0bbc5..5568e9fb14 100644
--- a/web/src/pages/project/[projectId]/traces/setup.tsx
+++ b/web/src/pages/project/[projectId]/traces/setup.tsx
@@ -10,7 +10,7 @@ import { ApiKeyRender } from "@/src/features/public-api/components/CreateApiKeyB
import { type RouterOutput } from "@/src/utils/types";
import { useState } from "react";
-const TracingSetup = ({
+export const TracingSetup = ({
projectId,
hasTracingConfigured,
}: {
@@ -39,7 +39,7 @@ const TracingSetup = ({
return (
<div className="space-y-8">
<div>
- <SubHeader title="1. Get API Keys" />
+ <SubHeader title="1. Get API keys" />
{apiKeys ? (
<ApiKeyRender
generatedKeys={apiKeys}
@@ -73,7 +73,7 @@ const TracingSetup = ({
<div>
<SubHeader
- title="2. Instrument Your Application"
+ title="2. Add tracing to your application"
status={hasTracingConfigured ? "active" : "pending"}
/>
<p className="mb-4 text-sm text-muted-foreground">
@@ -83,7 +83,7 @@ const TracingSetup = ({
in the documentation to add Langfuse to your application.
</p>
<ActionButton href="https://langfuse.com/docs/observability/get-started">
- Instrumentation Quickstart
+ Quickstart guide
</ActionButton>
</div>
</div>
diff --git a/web/src/pages/project/[projectId]/users.tsx b/web/src/pages/project/[projectId]/users.tsx
index cc457af893..177efbdc9c 100644
--- a/web/src/pages/project/[projectId]/users.tsx
+++ b/web/src/pages/project/[projectId]/users.tsx
@@ -83,9 +83,23 @@ export default function UsersPage() {
headerProps={{
title: "Users",
help: {
- description:
- "Attribute data in Langfuse to a user by adding a userId to your traces. See docs to learn more.",
- href: "https://langfuse.com/docs/user-explorer",
+ description: (
+ <>
+ Attribute data in Langfuse to a user by adding a userId to your
+ traces. See{" "}
+ <a
+ href="https://langfuse.com/docs/observability/features/users"
+ target="_blank"
+ rel="noopener noreferrer"
+ className="underline decoration-primary/30 hover:decoration-primary"
+ onClick={(e) => e.stopPropagation()}
+ >
+ docs
+ </a>{" "}
+ to learn more.
+ </>
+ ),
+ href: "https://langfuse.com/docs/observability/features/users",
},
}}
scrollable={showOnboarding}