Skip to content

Commit 45cf778

Browse files
perf: improve performance of db sync
1 parent 6a4681e commit 45cf778

8 files changed

Lines changed: 591 additions & 343 deletions

File tree

.changeset/README-env-example-docs.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/brave-traces-sync.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/many-examples-reflect.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

packages/core/src/otel.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ export function otelResourceSpansToEvents(
185185
const attributes = attributesToRecord(
186186
getArray(span, "attributes") ?? [],
187187
);
188-
const langfuse = langfuseAttributes(attributes);
189188
const name = stringField(span, "name") ?? "otel-span";
190189
const observationType = stringValue(
191190
attributes["langfuse.observation.type"],
@@ -228,6 +227,7 @@ export function otelResourceSpansToEvents(
228227
events.push(observationEvent);
229228

230229
if (!parentSpanId) {
230+
const langfuse = langfuseAttributes(attributes);
231231
events.push({
232232
id: randomUUID(),
233233
timestamp,
@@ -258,7 +258,7 @@ export function otelResourceSpansToEvents(
258258
}
259259
}
260260

261-
return events.sort((a, b) => a.timestamp.localeCompare(b.timestamp));
261+
return events;
262262
}
263263

264264
function observationTypeToEventType(

0 commit comments

Comments
 (0)