Skip to content

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

feat(otel): map traceloop.entity.input/output to input/output (#5460)

Steffen Schmitz185cb10d7c7e
diff --git a/.github/workflows/snyk.yml b/.github/workflows/snyk.yml
index 602df1c875..ff3a75b289 100644
--- a/.github/workflows/snyk.yml
+++ b/.github/workflows/snyk.yml
@@ -29,6 +29,13 @@ jobs:
image: langfuse-langfuse-web
args: --file=web/Dockerfile
+ # Workaround for https://github.com/github/codeql-action/issues/2187
+ - name: Replace security-severity undefined for license-related findings
+ run: "sed -i 's/\"security-severity\": \"undefined\"/\"security-severity\": \"0\"/g' snyk.sarif"
+
+ - name: Replace security-severity null for license-related findings
+ run: "sed -i 's/\"security-severity\": \"null\"/\"security-severity\": \"0\"/g' snyk.sarif"
+
- name: Upload result to GitHub Code Scanning
uses: github/codeql-action/upload-sarif@v3
with:
@@ -44,6 +51,13 @@ jobs:
image: langfuse-langfuse-worker
args: --file=worker/Dockerfile
+ # Workaround for https://github.com/github/codeql-action/issues/2187
+ - name: Replace security-severity undefined for license-related findings
+ run: "sed -i 's/\"security-severity\": \"undefined\"/\"security-severity\": \"0\"/g' snyk.sarif"
+
+ - name: Replace security-severity null for license-related findings
+ run: "sed -i 's/\"security-severity\": \"null\"/\"security-severity\": \"0\"/g' snyk.sarif"
+
- name: Upload result to GitHub Code Scanning
uses: github/codeql-action/upload-sarif@v3
with:
diff --git a/web/src/__tests__/server/api/otel/otelMapping.servertest.ts b/web/src/__tests__/server/api/otel/otelMapping.servertest.ts
index c29f14548e..988d3f2715 100644
--- a/web/src/__tests__/server/api/otel/otelMapping.servertest.ts
+++ b/web/src/__tests__/server/api/otel/otelMapping.servertest.ts
@@ -579,6 +579,18 @@ describe("OTel Resource Span Mapping", () => {
entityAttributeValue: 4096,
},
],
+ [
+ "#5457: should map traceloop.entity.input to input",
+ {
+ entity: "trace",
+ otelAttributeKey: "traceloop.entity.input",
+ otelAttributeValue: {
+ stringValue: '{"foo": "bar"}',
+ },
+ entityAttributeKey: "input",
+ entityAttributeValue: '{"foo": "bar"}',
+ },
+ ],
])(
"Attributes: %s",
(
diff --git a/web/src/features/otel/server/index.ts b/web/src/features/otel/server/index.ts
index 61b560fb47..59a28744b0 100644
--- a/web/src/features/otel/server/index.ts
+++ b/web/src/features/otel/server/index.ts
@@ -131,6 +131,13 @@ const extractInputAndOutput = (
return { input, output };
}
+ // TraceLoop sets traceloop.entity.input and traceloop.entity.output
+ input = attributes["traceloop.entity.input"];
+ output = attributes["traceloop.entity.output"];
+ if (input || output) {
+ return { input, output };
+ }
+
// SmolAgents sets input.value and output.value
input = attributes["input.value"];
output = attributes["output.value"];