Object containing the OpenTelemetry span to link to
The OpenTelemetry span from a Langfuse observation
Name of the experiment run for grouping related items
OptionalrunArgs: { description?: string; metadata?: any }Optional configuration for the dataset run
Optionaldescription?: stringDescription of the dataset run
Optionalmetadata?: anyAdditional metadata for the dataset run
Promise that resolves to the created dataset run item
const dataset = await langfuse.dataset.get("my-dataset");
const span = startObservation("my-task", { input: "test" });
span.update({ output: "result" });
span.end();
// Link the dataset item to this execution
await dataset.items[0].link(
  { otelSpan: span.otelSpan },
  "experiment-run-1"
);
await dataset.items[0].link(
  { otelSpan: span.otelSpan },
  "model-comparison-v2",
  {
    description: "Comparing GPT-4 vs Claude performance",
    metadata: {
      modelVersion: "gpt-4-1106-preview",
      temperature: 0.7,
      timestamp: new Date().toISOString()
    }
  }
);
https://langfuse.com/docs/datasets Langfuse datasets documentation
Function type for linking dataset items to OpenTelemetry spans.
This function creates a connection between a dataset item and a trace/observation, enabling tracking of which dataset items were used in which experiments or runs. This is essential for creating dataset runs and tracking experiment lineage.