🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.
TypeScript analyticsautogenevaluationlangchainlarge-language-modelsllama-indexllmllm-evaluationllm-observabilityllmopsmonitoringobservabilityopen-sourceopenaiplaygroundprompt-engineeringprompt-managementself-hostedycombinator
chore: remove public key double check from otel ingestion pipeline (#10871)
Max Deichmann90b34b630a06
diff --git a/packages/shared/src/server/otel/OtelIngestionProcessor.ts b/packages/shared/src/server/otel/OtelIngestionProcessor.tsindex 81a53ce8c7..833a990ecb 100644--- a/packages/shared/src/server/otel/OtelIngestionProcessor.ts+++ b/packages/shared/src/server/otel/OtelIngestionProcessor.ts@@ -605,12 +605,6 @@ export class OtelIngestionProcessor {scopeSpan.scope?.name?.startsWith("langfuse-sdk") ?? false;const scopeAttributes = this.extractScopeAttributes(scopeSpan);- this.validatePublicKey(- isLangfuseSDKSpans,- scopeAttributes,- resourceAttributes,- );-if (isLangfuseSDKSpans) {recordIncrement("langfuse.otel.ingestion.langfuse_sdk_batch", 1);}@@ -950,25 +944,6 @@ export class OtelIngestionProcessor {} as unknown as IngestionEventType;}- private validatePublicKey(- isLangfuseSDKSpans: boolean,- scopeAttributes: Record<string, unknown>,- resourceAttributes: Record<string, unknown>,- ): void {- if (- isLangfuseSDKSpans &&- (!this.publicKey ||- (scopeAttributes["public_key"] as unknown as string) !==- this.publicKey) &&- (resourceAttributes["telemetry.sdk.language"] as unknown as string) ===- "python" // Only Python has multi project setups. Node OTEL does not allow setting scope.attributes, thus skipping the check for node- ) {- throw new ForbiddenError(- `Langfuse OTEL SDK span has different public key '${scopeAttributes["public_key"]}' than used for authentication '${this.publicKey}'. Discarding span.`,- );- }- }-private hasTraceUpdates(attributes: Record<string, unknown>): boolean {const hasExactMatchingAttributeName = [LangfuseOtelSpanAttributes.TRACE_NAME,diff --git a/web/src/__tests__/server/api/otel/otelMapping.servertest.ts b/web/src/__tests__/server/api/otel/otelMapping.servertest.tsindex 9e445601c4..81ee31f0b7 100644--- a/web/src/__tests__/server/api/otel/otelMapping.servertest.ts+++ b/web/src/__tests__/server/api/otel/otelMapping.servertest.ts@@ -492,102 +492,6 @@ describe("OTel Resource Span Mapping", () => {environment: "production",});});-- it("should throw an error if langfuse scope spans have wrong project ID", async () => {- const langfuseOtelSpans = [- {- resource: {- attributes: [- {- key: "telemetry.sdk.language",- value: {- stringValue: "python",- },- },- {- key: "telemetry.sdk.name",- value: {- stringValue: "opentelemetry",- },- },- {- key: "telemetry.sdk.version",- value: {- stringValue: "1.32.0",- },- },- {- key: "service.name",- value: {- stringValue: "unknown_service",- },- },- ],- },- scopeSpans: [- {- scope: {- name: "langfuse-sdk",- version: "2.60.3",- attributes: [- {- key: "public_key",- value: {- stringValue: "pk-lf-another",- },- },- ],- },- spans: [- {- traceId: {- type: "Buffer",- data: [- 219, 242, 249, 255, 154, 168, 21, 165, 233, 52, 222, 186,- 28, 97, 54, 95,- ],- },- spanId: {- type: "Buffer",- data: [128, 191, 93, 22, 69, 180, 81, 135],- },- name: "t1",- kind: 1,- startTimeUnixNano: {- low: -1422874264,- high: 406650983,- unsigned: true,- },- endTimeUnixNano: {- low: -904695264,- high: 406650983,- unsigned: true,- },- attributes: [- {- key: "langfuse.observation.type",- value: {- stringValue: "span",- },- },- ],- status: {},- },- ],- },- ],- },- ];-- await expect(- Promise.all(- langfuseOtelSpans.map(- async (span) =>- await convertOtelSpanToIngestionEvent(span, new Set(), publicKey),- ),- ),- ).rejects.toThrowError("Langfuse OTEL SDK span has different public key");- });});describe("Vendor Spans", () => {