Skip to content

Commit

Permalink
chore: add projectid to ingestion logs
Browse files Browse the repository at this point in the history
  • Loading branch information
maxdeichmann committed Oct 9, 2024
1 parent 9a6ea8a commit dfedb37
Showing 1 changed file with 30 additions and 33 deletions.
63 changes: 30 additions & 33 deletions integration-test/langfuse-integration-node.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,39 +114,36 @@ describe("Langfuse Node.js", () => {
});
});

it.only("create span", async () => {
const a = await langfuse.fetchTraces({ tags: ["tag1", "tag2"] });
console.log(a);

// const trace = langfuse.trace({ name: "trace-name-span" });
// const span = trace.span({
// name: "span-name",
// startTime: new Date("2020-01-01T00:00:00.000Z"),
// });
// await langfuse.flushAsync();
// // check from get api if trace is created
// const res = await axios.get(`${LANGFUSE_BASEURL}/api/public/observations/${span.id}`, { headers: getHeaders() });
// expect(res.data).toMatchObject({
// id: span.id,
// name: "span-name",
// type: "SPAN",
// startTime: new Date("2020-01-01T00:00:00.000Z").toISOString(),
// completionStartTime: null,
// endTime: null,
// metadata: null,
// model: null,
// modelParameters: null,
// input: null,
// output: null,
// level: "DEFAULT",
// parentObservationId: null,
// completionTokens: 0,
// promptTokens: 0,
// totalTokens: 0,
// statusMessage: null,
// traceId: trace.id,
// version: null,
// });
it("create span", async () => {
const trace = langfuse.trace({ name: "trace-name-span" });
const span = trace.span({
name: "span-name",
startTime: new Date("2020-01-01T00:00:00.000Z"),
});
await langfuse.flushAsync();
// check from get api if trace is created
const res = await axios.get(`${LANGFUSE_BASEURL}/api/public/observations/${span.id}`, { headers: getHeaders() });
expect(res.data).toMatchObject({
id: span.id,
name: "span-name",
type: "SPAN",
startTime: new Date("2020-01-01T00:00:00.000Z").toISOString(),
completionStartTime: null,
endTime: null,
metadata: null,
model: null,
modelParameters: null,
input: null,
output: null,
level: "DEFAULT",
parentObservationId: null,
completionTokens: 0,
promptTokens: 0,
totalTokens: 0,
statusMessage: null,
traceId: trace.id,
version: null,
});
});

it("update a span", async () => {
Expand Down

0 comments on commit dfedb37

Please sign in to comment.