Skip to content

Commit 61b32f7

Browse files
fix(sdk): remove posthog and telemetry reporting (#835)
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent 116a6c0 commit 61b32f7

File tree

6 files changed

+11
-108
lines changed

6 files changed

+11
-108
lines changed

packages/traceloop-sdk/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@
8484
"fetch-retry": "^6.0.0",
8585
"nunjucks": "^3.2.4",
8686
"papaparse": "^5.5.3",
87-
"posthog-node": "^5.5.1",
8887
"supports-color": "^10.0.0",
8988
"tslib": "^2.8.1",
9089
"uuid": "^11.1.0"

packages/traceloop-sdk/src/lib/prompts/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { TraceloopError } from "../errors";
22
import { Prompt, PromptVersion } from "../interfaces";
3-
import { Telemetry } from "../telemetry/telemetry";
43
import { getPromptByKey } from "./registry";
54
import { renderMessages } from "./template";
65
export { waitForInitialization } from "./registry";
@@ -40,8 +39,6 @@ const managedPromptTracingAttributes = (
4039
};
4140

4241
export const getPrompt = (key: string, variables: Record<string, string>) => {
43-
Telemetry.getInstance().capture("prompt:rendered");
44-
4542
const prompt = getPromptByKey(key);
4643
const promptVersion = getEffectiveVersion(prompt);
4744

packages/traceloop-sdk/src/lib/telemetry/telemetry.ts

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

packages/traceloop-sdk/src/lib/tracing/decorators.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import {
1414
TraceloopSpanKindValues,
1515
} from "@traceloop/ai-semantic-conventions";
1616
import { shouldSendTraces } from ".";
17-
import { Telemetry } from "../telemetry/telemetry";
1817

1918
export type DecoratorConfig = {
2019
name: string;
@@ -134,7 +133,7 @@ function withEntity<
134133
);
135134
}
136135
} catch (error) {
137-
Telemetry.getInstance().logException(error);
136+
console.debug("Error setting input attributes", error);
138137
}
139138
}
140139

@@ -149,7 +148,7 @@ function withEntity<
149148
);
150149
}
151150
} catch (error) {
152-
Telemetry.getInstance().logException(error);
151+
console.debug("Error setting output attributes", error);
153152
} finally {
154153
span.end();
155154
}
@@ -165,7 +164,7 @@ function withEntity<
165164
);
166165
}
167166
} catch (error) {
168-
Telemetry.getInstance().logException(error);
167+
console.debug("Error setting output attributes", error);
169168
} finally {
170169
span.end();
171170
}

packages/traceloop-sdk/src/lib/tracing/index.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { Resource } from "@opentelemetry/resources";
77
import { ATTR_SERVICE_NAME } from "@opentelemetry/semantic-conventions";
88
import { Instrumentation } from "@opentelemetry/instrumentation";
99
import { InitializeOptions } from "../interfaces";
10-
import { Telemetry } from "../telemetry/telemetry";
1110
import { _configuration } from "../configuration";
1211
import { CONTEXT_KEY_ALLOW_TRACE_CONTENT } from "@traceloop/ai-semantic-conventions";
1312
import { AnthropicInstrumentation } from "@traceloop/instrumentation-anthropic";
@@ -51,7 +50,9 @@ let mcpInstrumentation: McpInstrumentation | undefined;
5150
const instrumentations: Instrumentation[] = [];
5251

5352
export const initInstrumentations = (apiKey?: string, baseUrl?: string) => {
54-
const exceptionLogger = (e: Error) => Telemetry.getInstance().logException(e);
53+
const exceptionLogger = (e: Error) => {
54+
console.debug("[Traceloop] Instrumentation exception:", e.message);
55+
};
5556
const enrichTokens =
5657
(process.env.TRACELOOP_ENRICH_TOKENS || "true").toLowerCase() === "true";
5758

@@ -133,7 +134,9 @@ export const manuallyInitInstrumentations = (
133134
apiKey?: string,
134135
baseUrl?: string,
135136
) => {
136-
const exceptionLogger = (e: Error) => Telemetry.getInstance().logException(e);
137+
const exceptionLogger = (e: Error) => {
138+
console.debug("[Traceloop] Instrumentation exception:", e.message);
139+
};
137140
const enrichTokens =
138141
(process.env.TRACELOOP_ENRICH_TOKENS || "true").toLowerCase() === "true";
139142

pnpm-lock.yaml

Lines changed: 2 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)