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

Release 1.3.2 #92

Merged
merged 95 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
5a3581c
Merge branch 'development' into release
karthikscale3 Apr 1, 2024
63fa12e
Merge branch 'development' of github.com:Scale3-Labs/langtrace into r…
karthikscale3 Apr 2, 2024
540b613
Merge branch 'main' of github.com:Scale3-Labs/langtrace into release
karthikscale3 Apr 2, 2024
b2cd5c2
Merge branch 'development' into release
karthikscale3 Apr 2, 2024
e428dc9
Merge branch 'development' into release
karthikscale3 Apr 2, 2024
1490b00
Merge branch 'development' into release
karthikscale3 Apr 2, 2024
62e7250
Merge branch 'main' of github.com:Scale3-Labs/langtrace into release
karthikscale3 Apr 2, 2024
7cbc191
Merge branch 'development' into release
karthikscale3 Apr 2, 2024
6c097a5
Merge branch 'main' of github.com:Scale3-Labs/langtrace into release
karthikscale3 Apr 2, 2024
7041a32
Merge branch 'development' into release
karthikscale3 Apr 2, 2024
7dd49d0
Merge branch 'main' of github.com:Scale3-Labs/langtrace into release
karthikscale3 Apr 2, 2024
c30d1bf
Merge branch 'development' into release
karthikscale3 Apr 2, 2024
81c9f8c
Merge branch 'main' of github.com:Scale3-Labs/langtrace into release
karthikscale3 Apr 3, 2024
aaec9b0
Merge branch 'development' into release
karthikscale3 Apr 3, 2024
02358de
Merge branch 'main' of github.com:Scale3-Labs/langtrace into release
karthikscale3 Apr 3, 2024
3f21ae0
Merge branch 'development' into release
karthikscale3 Apr 3, 2024
b178105
Pagination bug
karthikscale3 Apr 4, 2024
af47e53
Merge branch 'development' of github.com:Scale3-Labs/langtrace into d…
karthikscale3 Apr 4, 2024
65eb483
Merge branch 'main' of github.com:Scale3-Labs/langtrace into release
karthikscale3 Apr 4, 2024
29c53c7
Merge branch 'development' into release
karthikscale3 Apr 4, 2024
cc6ab77
Merge branch 'development' of github.com:Scale3-Labs/langtrace into d…
karthikscale3 Apr 4, 2024
677b1aa
Merge branch 'development' of github.com:Scale3-Labs/langtrace into d…
karthikscale3 Apr 4, 2024
642483d
Merge branch 'main' of github.com:Scale3-Labs/langtrace into release
karthikscale3 Apr 4, 2024
db451ad
Merge branch 'development' into release
karthikscale3 Apr 4, 2024
f996899
Merge branch 'development' of github.com:Scale3-Labs/langtrace into d…
karthikscale3 Apr 4, 2024
fa9bac5
Merge branch 'development' into release
karthikscale3 Apr 4, 2024
0e963e2
Bug fix
karthikscale3 Apr 5, 2024
f3a8a23
Merge branch 'development' of github.com:Scale3-Labs/langtrace into d…
karthikscale3 Apr 5, 2024
da27c8a
Merge branch 'development' into release
karthikscale3 Apr 5, 2024
e3273b7
fix merge conflicts
karthikscale3 Apr 5, 2024
3c353a5
Merge branch 'development' of github.com:Scale3-Labs/langtrace into d…
karthikscale3 Apr 5, 2024
0b0545a
Merge branch 'main' of github.com:Scale3-Labs/langtrace into release
karthikscale3 Apr 5, 2024
7154a9b
Merge branch 'development' into release
karthikscale3 Apr 5, 2024
94f0fb1
Merge branch 'development' of github.com:Scale3-Labs/langtrace into d…
karthikscale3 Apr 7, 2024
f22f397
Merge branch 'development' of github.com:Scale3-Labs/langtrace into d…
karthikscale3 Apr 8, 2024
5023d1f
Merge branch 'development' of github.com:Scale3-Labs/langtrace into d…
karthikscale3 Apr 9, 2024
2ebb4fa
Merge branch 'main' of github.com:Scale3-Labs/langtrace into release
karthikscale3 Apr 9, 2024
e3cb63b
Merge branch 'development' into release
karthikscale3 Apr 9, 2024
4178d5c
Merge branch 'development' of github.com:Scale3-Labs/langtrace into d…
karthikscale3 Apr 11, 2024
4fe4108
Merge branch 'development' of github.com:Scale3-Labs/langtrace into d…
karthikscale3 Apr 13, 2024
784f09c
Merge branch 'development' of github.com:Scale3-Labs/langtrace into d…
karthikscale3 Apr 14, 2024
391320d
Merge branch 'main' of github.com:Scale3-Labs/langtrace into release
karthikscale3 Apr 14, 2024
ca49b2b
Merge branch 'development' into release
karthikscale3 Apr 14, 2024
42f1128
Merge branch 'development' of github.com:Scale3-Labs/langtrace into d…
karthikscale3 Apr 19, 2024
71ad0d5
Merge branch 'main' of github.com:Scale3-Labs/langtrace into release
karthikscale3 Apr 19, 2024
0be2143
Merge branch 'development' into release
karthikscale3 Apr 19, 2024
51e3310
chore: add docker cmd
darshit-s3 Apr 23, 2024
0b424f2
Compatibility fixes for SDK version 2.0.0 (#69)
karthikscale3 Apr 24, 2024
0c8e92b
Merge branch 'development' of github.com:Scale3-Labs/langtrace into d…
karthikscale3 Apr 24, 2024
a6f7c97
Merge
karthikscale3 Apr 24, 2024
e0e0c2b
Merge branch 'development' into release
karthikscale3 Apr 24, 2024
3ed6d31
Merge pull request #66 from Scale3-Labs/add-docker-cmd
darshit-s3 Apr 25, 2024
28227d9
Merge branch 'development' of github.com:Scale3-Labs/langtrace into d…
karthikscale3 Apr 28, 2024
9a0b049
Support for Langgraph, Qdrant & Groq (#73)
karthikscale3 Apr 28, 2024
0cec8be
Merge branch 'development' of github.com:Scale3-Labs/langtrace into d…
karthikscale3 Apr 28, 2024
f6f47e8
Merge branch 'main' of github.com:Scale3-Labs/langtrace into release
karthikscale3 Apr 28, 2024
cf4867c
Merge branch 'development' into release
karthikscale3 Apr 28, 2024
64bda4a
feat: optimise docker image for self host setup
darshit-s3 Apr 29, 2024
36620bb
Merge branch 'development' into optimise-docker-image
darshit-s3 Apr 30, 2024
95de2de
Merge pull request #75 from Scale3-Labs/optimise-docker-image
darshit-s3 Apr 30, 2024
a1025f7
adding api access to traces endpoint
dylanzuber-scale3 May 1, 2024
bc90bbd
clean up
dylanzuber-scale3 May 2, 2024
1426245
refactor
dylanzuber-scale3 May 2, 2024
934e304
Merge pull request #78 from Scale3-Labs/dylan/s3en-2221-add-api-key-a…
dylanzuber-scale3 May 2, 2024
ea5cd7b
feat: add clickhouse db create on app start (#79)
darshit-s3 May 4, 2024
34875e2
docs: add railway deploy, fix sdk badges (#81)
darshit-s3 May 7, 2024
4551d7e
untrack .env
rohit-kadhe May 7, 2024
c7b05ca
Revert "untrack .env"
rohit-kadhe May 7, 2024
096ee2e
Playground and Prompt Management (#83)
karthikscale3 May 7, 2024
9766d40
fix: clickhouse table find queries (#82)
darshit-s3 May 7, 2024
eae354d
Merge branch 'development' of github.com:Scale3-Labs/langtrace into d…
karthikscale3 May 7, 2024
f67f7fb
Merge branch 'development' of github.com:Scale3-Labs/langtrace into r…
rohit-kadhe May 7, 2024
1c480c9
Fix to surface multiple LLM requests inside LLM View (#84)
karthikscale3 May 7, 2024
7723147
Merge branch 'development' of github.com:Scale3-Labs/langtrace into d…
karthikscale3 May 7, 2024
b588d25
Fix merge conflicts
karthikscale3 May 7, 2024
2a28815
Fix merge conflict
karthikscale3 May 7, 2024
db5959c
Minor bugfixes (#86)
karthikscale3 May 7, 2024
39acc90
Merge branch 'main' of github.com:Scale3-Labs/langtrace into release
karthikscale3 May 7, 2024
31bfd5f
Merge branch 'development' of github.com:Scale3-Labs/langtrace into d…
karthikscale3 May 7, 2024
9b677c1
Merge branch 'development' into release
karthikscale3 May 7, 2024
7f32b5a
Merge branch 'development' of github.com:Scale3-Labs/langtrace into r…
rohit-kadhe May 7, 2024
fd347a2
api to fetch promptset with prompt filters
rohit-kadhe May 8, 2024
66c1293
bug fixes
rohit-kadhe May 8, 2024
e039e5c
fix invalid redirect
rohit-kadhe May 8, 2024
c3f6ade
fix invalid status code
rohit-kadhe May 8, 2024
974756f
Merge pull request #88 from Scale3-Labs/rohit/S3EN-2232-get-prompts-api
rohit-kadhe May 9, 2024
1b9c986
Merge branch 'development' of github.com:Scale3-Labs/langtrace into d…
karthikscale3 May 9, 2024
1296c89
Project Switcher (#90)
karthikscale3 May 9, 2024
31f50e6
Merge branch 'development' of github.com:Scale3-Labs/langtrace into d…
karthikscale3 May 9, 2024
82bd818
Feat: dataset download (#60)
MayuriS24 May 9, 2024
4e30354
Merge branch 'development' of github.com:Scale3-Labs/langtrace into d…
karthikscale3 May 9, 2024
e3edb54
Update prompt registry with instructions to fetch prompts (#91)
karthikscale3 May 9, 2024
9cbb929
Merge branch 'development' of github.com:Scale3-Labs/langtrace into d…
karthikscale3 May 9, 2024
94b13f6
Merge branch 'main' of github.com:Scale3-Labs/langtrace into release
karthikscale3 May 9, 2024
417c314
update package lock
karthikscale3 May 9, 2024
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
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ COPY . .
RUN npm install

EXPOSE 3000

CMD [ "/bin/sh", "-c", "npm run create-tables && npm run dev" ]
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,13 @@ Langtrace automatically captures traces from the following vendors:
| OpenAI | LLM | :white_check_mark: | :white_check_mark: |
| Anthropic | LLM | :white_check_mark: | :white_check_mark: |
| Azure OpenAI | LLM | :white_check_mark: | :white_check_mark: |
| Cohere | LLM | :white_check_mark: | :white_check_mark: |
| Groq | LLM | :x: | :white_check_mark: |
| Langchain | Framework | :x: | :white_check_mark: |
| LlamaIndex | Framework | :white_check_mark: | :white_check_mark: |
| Pinecone | Vector Database | :white_check_mark: | :white_check_mark: |
| ChromaDB | Vector Database | :white_check_mark: | :white_check_mark: |
| QDrant | Vector Database | :x: | :white_check_mark: |

---

Expand Down
34 changes: 33 additions & 1 deletion components/project/traces/trace-row.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"use client";

import LanggraphView from "@/components/shared/langgraph-view";
import {
calculateTotalTime,
convertTracesToHierarchy,
Expand Down Expand Up @@ -36,17 +37,23 @@ export const TraceRow = ({
let prompts: any = {};
let responses: any = {};
let cost = { total: 0, input: 0, output: 0 };
let langgraph = false;
for (const span of trace) {
if (span.attributes) {
const attributes = JSON.parse(span.attributes);
if (attributes["langtrace.service.name"]) {
vendor = attributes["langtrace.service.name"].toLowerCase();
if (vendor === "langgraph") {
langgraph = true;
}
}
userId = attributes["user.id"];
if (attributes["llm.prompts"] && attributes["llm.responses"]) {
prompts = attributes["llm.prompts"];
responses = attributes["llm.responses"];
}
if (attributes["llm.token.counts"]) {
model = attributes["llm.model"];
vendor = attributes["langtrace.service.name"].toLowerCase();
const currentcounts = JSON.parse(attributes["llm.token.counts"]);
tokenCounts = {
input_tokens: tokenCounts.input_tokens
Expand Down Expand Up @@ -213,6 +220,26 @@ export const TraceRow = ({
<Separator className="bg-primary h-[2px]" />
)}
</Button>
{langgraph && (
<Button
onClick={() => setSelectedTab("langgraph")}
variant={"ghost"}
className="flex flex-col justify-between pb-0"
>
<p
className={
selectedTab === "langgraph"
? "text-xs text-primary font-medium"
: "text-xs text-muted-foreground font-medium"
}
>
Langgraph
</p>
{selectedTab === "langgraph" && (
<Separator className="bg-primary h-[2px]" />
)}
</Button>
)}
</div>
<Separator />
{selectedTab === "trace" && (
Expand All @@ -235,6 +262,11 @@ export const TraceRow = ({
<LLMView prompts={prompts} responses={responses} />
</div>
)}
{selectedTab === "langgraph" && (
<div className="h-[500px]">
<LanggraphView trace={trace} />
</div>
)}
</div>
)}
</div>
Expand Down
122 changes: 122 additions & 0 deletions components/shared/langgraph-view.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
import { Span } from "@/lib/clients/scale3_clickhouse/models/span";
import ReactFlow, {
Background,
BaseEdge,
Controls,
EdgeLabelRenderer,
getBezierPath,
} from "reactflow";
import "reactflow/dist/style.css";

const CustomEdge = ({ id, data, ...props }: any) => {
const [edgePath, labelX, labelY] = getBezierPath(props);

return (
<>
<BaseEdge id={id} path={edgePath} />
<EdgeLabelRenderer>
<div
style={{
position: "absolute",
transform: `translate(-50%, -50%) translate(${labelX}px,${labelY}px)`,
background: "#000000",
padding: 1,
borderRadius: 5,
fontSize: 12,
fontWeight: 700,
color: "#ffffff",
}}
className="nodrag nopan"
>
{data.label}
</div>
</EdgeLabelRenderer>
</>
);
};

export default function LanggraphView({ trace }: { trace: Span[] }) {
// construct the nodes and edges from the trace
let x = 0;
let y = 0;
const nodes = [
{ id: "__start__", data: { label: "Start" }, position: { x: 0, y: 0 } },
];
const edges = [];
try {
for (const span of trace) {
const attributes = JSON.parse(span.attributes);
if (Object.keys(attributes).length > 0) {
const vendor = attributes["langtrace.service.name"].toLowerCase();
const node = attributes["langgraph.node"];
const edge = attributes["langgraph.edge"];
const task = attributes["langgraph.task.name"];
if (vendor === "langgraph" && node) {
x += 200;
y += 200;
const pNode = JSON.parse(node);
nodes.push({
id: pNode?.name || span.span_id,
data: {
label:
`${pNode?.name} (action: ${pNode.action})}` || span.span_id,
},
position: { x, y },
});
}

if (vendor === "langgraph" && edge) {
const pEdge = JSON.parse(edge);
if (task === "add_conditional_edges") {
const pathMap = pEdge?.path_map;
if (pathMap) {
for (const k of Object.keys(pathMap)) {
edges.push({
id: `${pEdge?.source || "source"}-${
pathMap[k] || "destination"
}`,
data: { label: `${pEdge?.path} (output: ${k})` || "" },
source: pEdge?.source || "source",
target: pathMap[k] || "destination",
type: "custom",
});
}
}
} else {
edges.push({
id: `${pEdge?.source || "source"}-${
pEdge?.destination || "destination"
}`,
source: pEdge?.source || "source",
target: pEdge?.destination || "destination",
});
}
}
}
}
} catch (e) {
console.error(e);
}

nodes.push({
id: "__end__",
data: { label: "End" },
position: { x: 0, y: y + 200 },
});

return (
<div style={{ height: "100%" }}>
<ReactFlow
nodes={nodes}
edges={edges}
edgeTypes={{
custom: CustomEdge,
}}
draggable={true}
>
<Background />
<Controls />
</ReactFlow>
</div>
);
}
48 changes: 48 additions & 0 deletions components/shared/vendor-metadata.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ export function vendorBadgeColor(vendor: string) {
return "bg-red-500";
}

if (vendor.includes("qdrant")) {
return "bg-grey-500";
}

if (vendor.includes("qdrant")) {
return "bg-grey-500";
}

return "bg-gray-500";
}

Expand Down Expand Up @@ -82,6 +90,14 @@ export function vendorColor(vendor: string) {
return "bg-red-200";
}

if (vendor.includes("qdrant")) {
return "bg-grey-200";
}

if (vendor.includes("groq")) {
return "bg-slate-200";
}

return "bg-gray-800";
}

Expand Down Expand Up @@ -109,6 +125,22 @@ export function VendorLogo({
serviceName = attributes["langtrace.service.name"].toLowerCase();
}

if (span.name.includes("groq") || serviceName.includes("groq")) {
const color = vendorColor("groq");
return (
<Image
alt="Groq Logo"
src="/groq.png"
width={50}
height={50}
className={cn(
`${color} p-[3px]`,
variant === "circular" ? "rounded-full" : "rounded-md"
)}
/>
);
}

if (span.name.includes("perplexity") || serviceName.includes("perplexity")) {
const color = vendorColor("perplexity");
return (
Expand Down Expand Up @@ -237,6 +269,22 @@ export function VendorLogo({
);
}

if (span.name.includes("qdrant") || serviceName.includes("qdrant")) {
const color = vendorColor("qdrant");
return (
<Image
alt="Qdrant Logo"
src="/qdrant.png"
width={50}
height={50}
className={cn(
`${color} p-[3px]`,
variant === "circular" ? "rounded-full" : "rounded-md"
)}
/>
);
}

return (
<div className="flex items-center bg-muted p-2 rounded-sm">
<StackIcon
Expand Down
6 changes: 6 additions & 0 deletions components/traces/trace_graph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ const SpanItem: React.FC<SpanItemProps> = ({
color = "bg-indigo-500";
else if (span.name.includes("langchain") || serviceName.includes("langchain"))
color = "bg-purple-500";
else if (span.name.includes("cohere") || serviceName.includes("cohere"))
color = "bg-red-500";
else if (span.name.includes("qdrant") || serviceName.includes("qdrant"))
color = "bg-grey-500";
else if (span.name.includes("groq") || serviceName.includes("groq"))
color = "bg-slate-500";
else if (
span.name.includes("llamaindex") ||
serviceName.includes("llamaindex")
Expand Down
1 change: 0 additions & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ services:
working_dir: /app
env_file:
- .env
command: /bin/sh -c "npm run create-tables && npm run dev"
ports:
- "3000:3000"
# Uncmment this for development
Expand Down
Loading