Skip to content

Commit c4e3782

Browse files
authored
fix: remove sentry; lower noise for instrumentation errors (#294)
1 parent 2f01d24 commit c4e3782

File tree

11 files changed

+29
-34
lines changed

11 files changed

+29
-34
lines changed

packages/instrumentation-anthropic/src/instrumentation.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ export class AnthropicInstrumentation extends InstrumentationBase<any> {
234234
}
235235
}
236236
} catch (e) {
237-
this._diag.warn(e);
237+
this._diag.debug(e);
238238
this._config.exceptionLogger?.(e);
239239
}
240240

@@ -290,7 +290,7 @@ export class AnthropicInstrumentation extends InstrumentationBase<any> {
290290
}
291291
}
292292
} catch (e) {
293-
this._diag.warn(e);
293+
this._diag.debug(e);
294294
this._config.exceptionLogger?.(e);
295295
}
296296
}
@@ -321,7 +321,7 @@ export class AnthropicInstrumentation extends InstrumentationBase<any> {
321321
result.completion += chunk.completion;
322322
}
323323
} catch (e) {
324-
this._diag.warn(e);
324+
this._diag.debug(e);
325325
this._config.exceptionLogger?.(e);
326326
}
327327
}
@@ -425,7 +425,7 @@ export class AnthropicInstrumentation extends InstrumentationBase<any> {
425425
}
426426
}
427427
} catch (e) {
428-
this._diag.warn(e);
428+
this._diag.debug(e);
429429
this._config.exceptionLogger?.(e);
430430
}
431431

packages/instrumentation-azure/src/instrumentation.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ export class AzureOpenAIInstrumentation extends InstrumentationBase<any> {
218218
}
219219
}
220220
} catch (e) {
221-
this._diag.warn(e);
221+
this._diag.debug(e);
222222
this._config.exceptionLogger?.(e);
223223
}
224224

@@ -349,7 +349,7 @@ export class AzureOpenAIInstrumentation extends InstrumentationBase<any> {
349349
}
350350
}
351351
} catch (e) {
352-
this._diag.warn(e);
352+
this._diag.debug(e);
353353
this._config.exceptionLogger?.(e);
354354
}
355355

packages/instrumentation-bedrock/src/instrumentation.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ export class BedrockInstrumentation extends InstrumentationBase<any> {
171171
};
172172
}
173173
} catch (e) {
174-
this._diag.warn(e);
174+
this._diag.debug(e);
175175
this._config.exceptionLogger?.(e);
176176
}
177177

@@ -274,7 +274,7 @@ export class BedrockInstrumentation extends InstrumentationBase<any> {
274274
}
275275
}
276276
} catch (e) {
277-
this._diag.warn(e);
277+
this._diag.debug(e);
278278
this._config.exceptionLogger?.(e);
279279
}
280280

packages/instrumentation-chromadb/src/instrumentation.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ export class ChromaDBInstrumentation extends InstrumentationBase<any> {
201201
}
202202
}
203203
} catch (e) {
204-
this._diag.warn(e);
204+
this._diag.debug(e);
205205
this._config.exceptionLogger?.(e);
206206
}
207207

@@ -341,7 +341,7 @@ export class ChromaDBInstrumentation extends InstrumentationBase<any> {
341341
});
342342
}
343343
} catch (e) {
344-
this._diag.warn(e);
344+
this._diag.debug(e);
345345
this._config.exceptionLogger?.(e);
346346
}
347347

packages/instrumentation-cohere/src/instrumentation.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ export class CohereInstrumentation extends InstrumentationBase<any> {
267267
}
268268
}
269269
} catch (e) {
270-
this._diag.warn(e);
270+
this._diag.debug(e);
271271
this._config.exceptionLogger?.(e);
272272
}
273273

@@ -388,7 +388,7 @@ export class CohereInstrumentation extends InstrumentationBase<any> {
388388
}
389389
}
390390
} catch (e) {
391-
this._diag.warn(e);
391+
this._diag.debug(e);
392392
this._config.exceptionLogger?.(e);
393393
}
394394
}
@@ -471,7 +471,7 @@ export class CohereInstrumentation extends InstrumentationBase<any> {
471471
);
472472
}
473473
} catch (e) {
474-
this._diag.warn(e);
474+
this._diag.debug(e);
475475
this._config.exceptionLogger?.(e);
476476
}
477477
}
@@ -541,7 +541,7 @@ export class CohereInstrumentation extends InstrumentationBase<any> {
541541
);
542542
}
543543
} catch (e) {
544-
this._diag.warn(e);
544+
this._diag.debug(e);
545545
this._config.exceptionLogger?.(e);
546546
}
547547
}

packages/instrumentation-langchain/src/utils.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export function genericWrapper(
4242
);
4343
}
4444
} catch (e) {
45-
this._diag.warn(e);
45+
this._diag.debug(e);
4646
this._config.exceptionLogger?.(e);
4747
}
4848
}
@@ -77,7 +77,7 @@ export function genericWrapper(
7777
}
7878
}
7979
} catch (e) {
80-
this._diag.warn(e);
80+
this._diag.debug(e);
8181
this._config.exceptionLogger?.(e);
8282
} finally {
8383
span.end();

packages/instrumentation-openai/src/instrumentation.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ export class OpenAIInstrumentation extends InstrumentationBase<any> {
318318
}
319319
}
320320
} catch (e) {
321-
this._diag.warn(e);
321+
this._diag.debug(e);
322322
this._config.exceptionLogger?.(e);
323323
}
324324

@@ -472,7 +472,7 @@ export class OpenAIInstrumentation extends InstrumentationBase<any> {
472472
result.choices[0].text += chunk.choices[0].text;
473473
}
474474
} catch (e) {
475-
this._diag.warn(e);
475+
this._diag.debug(e);
476476
this._config.exceptionLogger?.(e);
477477
}
478478
}
@@ -500,7 +500,7 @@ export class OpenAIInstrumentation extends InstrumentationBase<any> {
500500
}
501501
}
502502
} catch (e) {
503-
this._diag.warn(e);
503+
this._diag.debug(e);
504504
this._config.exceptionLogger?.(e);
505505
}
506506

@@ -650,7 +650,7 @@ export class OpenAIInstrumentation extends InstrumentationBase<any> {
650650
}
651651
}
652652
} catch (e) {
653-
this._diag.warn(e);
653+
this._diag.debug(e);
654654
this._config.exceptionLogger?.(e);
655655
}
656656

@@ -714,7 +714,7 @@ export class OpenAIInstrumentation extends InstrumentationBase<any> {
714714

715715
span.addEvent("logprobs", { logprobs: JSON.stringify(result) });
716716
} catch (e) {
717-
this._diag.warn(e);
717+
this._diag.debug(e);
718718
this._config.exceptionLogger?.(e);
719719
}
720720
}
@@ -729,7 +729,7 @@ export class OpenAIInstrumentation extends InstrumentationBase<any> {
729729
encoding = encodingForModel(model as TiktokenModel);
730730
this._encodingCache.set(model, encoding);
731731
} catch (e) {
732-
this._diag.warn(e);
732+
this._diag.debug(e);
733733
this._config.exceptionLogger?.(e);
734734
return 0;
735735
}

packages/instrumentation-pinecone/src/instrumentation.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ export class PineconeInstrumentation extends InstrumentationBase<any> {
178178
JSON.stringify(options.filter ? options.filter : {}),
179179
);
180180
} catch (e) {
181-
this._diag.warn(e);
181+
this._diag.debug(e);
182182
this._config.exceptionLogger?.(e);
183183
}
184184

@@ -268,7 +268,7 @@ export class PineconeInstrumentation extends InstrumentationBase<any> {
268268
);
269269
}
270270
} catch (e) {
271-
this._diag.warn(e);
271+
this._diag.debug(e);
272272
this._config.exceptionLogger?.(e);
273273
}
274274
span.end();

packages/instrumentation-vertexai/src/aiplatform-instrumentation.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ export class AIPlatformInstrumentation extends InstrumentationBase<any> {
216216
}
217217
}
218218
} catch (e) {
219-
this._diag.warn(e);
219+
this._diag.debug(e);
220220
this._config.exceptionLogger?.(e);
221221
}
222222

@@ -355,7 +355,7 @@ export class AIPlatformInstrumentation extends InstrumentationBase<any> {
355355
}
356356
}
357357
} catch (e) {
358-
this._diag.warn(e);
358+
this._diag.debug(e);
359359
this._config.exceptionLogger?.(e);
360360
}
361361

packages/instrumentation-vertexai/src/vertexai-instrumentation.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ export class VertexAIInstrumentation extends InstrumentationBase<any> {
163163
this._formatPartsData(params.contents[0].parts);
164164
}
165165
} catch (e) {
166-
this._diag.warn(e);
166+
this._diag.debug(e);
167167
this._config.exceptionLogger?.(e);
168168
}
169169

@@ -250,7 +250,7 @@ export class VertexAIInstrumentation extends InstrumentationBase<any> {
250250
});
251251
}
252252
} catch (e) {
253-
this._diag.warn(e);
253+
this._diag.debug(e);
254254
this._config.exceptionLogger?.(e);
255255
}
256256

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

+1-6
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import * as fs from "fs";
33
import * as path from "path";
44
import { v4 as uuid } from "uuid";
55
import { PostHog } from "posthog-node";
6-
import * as Sentry from "@sentry/node";
76
import { version } from "../../../package.json";
87

98
export class Telemetry {
@@ -32,10 +31,6 @@ export class Telemetry {
3231
this.posthog = new PostHog(
3332
"phc_JMTeAfG8OpaPsyHzSBtqquMvko1fmOHcW0gyqLCrF3t",
3433
);
35-
Sentry.init({
36-
dsn: "https://0cbbe354864172adc0fbd41621a7a541@o4505278734663680.ingest.us.sentry.io/4507114378166272",
37-
defaultIntegrations: false,
38-
});
3934
}
4035
}
4136

@@ -85,7 +80,7 @@ export class Telemetry {
8580

8681
public logException(error: Error) {
8782
if (this.telemetryEnabled) {
88-
Sentry.captureException(error);
83+
this.capture("error", { error: error.message, stack: error.stack || "" });
8984
}
9085
}
9186
}

0 commit comments

Comments
 (0)