Skip to content

fix: remove sentry; lower noise for instrumentation errors #294

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/instrumentation-anthropic/src/instrumentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ export class AnthropicInstrumentation extends InstrumentationBase<any> {
}
}
} catch (e) {
this._diag.warn(e);
this._diag.debug(e);
this._config.exceptionLogger?.(e);
}

Expand Down Expand Up @@ -290,7 +290,7 @@ export class AnthropicInstrumentation extends InstrumentationBase<any> {
}
}
} catch (e) {
this._diag.warn(e);
this._diag.debug(e);
this._config.exceptionLogger?.(e);
}
}
Expand Down Expand Up @@ -321,7 +321,7 @@ export class AnthropicInstrumentation extends InstrumentationBase<any> {
result.completion += chunk.completion;
}
} catch (e) {
this._diag.warn(e);
this._diag.debug(e);
this._config.exceptionLogger?.(e);
}
}
Expand Down Expand Up @@ -425,7 +425,7 @@ export class AnthropicInstrumentation extends InstrumentationBase<any> {
}
}
} catch (e) {
this._diag.warn(e);
this._diag.debug(e);
this._config.exceptionLogger?.(e);
}

Expand Down
4 changes: 2 additions & 2 deletions packages/instrumentation-azure/src/instrumentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ export class AzureOpenAIInstrumentation extends InstrumentationBase<any> {
}
}
} catch (e) {
this._diag.warn(e);
this._diag.debug(e);
this._config.exceptionLogger?.(e);
}

Expand Down Expand Up @@ -349,7 +349,7 @@ export class AzureOpenAIInstrumentation extends InstrumentationBase<any> {
}
}
} catch (e) {
this._diag.warn(e);
this._diag.debug(e);
this._config.exceptionLogger?.(e);
}

Expand Down
4 changes: 2 additions & 2 deletions packages/instrumentation-bedrock/src/instrumentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export class BedrockInstrumentation extends InstrumentationBase<any> {
};
}
} catch (e) {
this._diag.warn(e);
this._diag.debug(e);
this._config.exceptionLogger?.(e);
}

Expand Down Expand Up @@ -274,7 +274,7 @@ export class BedrockInstrumentation extends InstrumentationBase<any> {
}
}
} catch (e) {
this._diag.warn(e);
this._diag.debug(e);
this._config.exceptionLogger?.(e);
}

Expand Down
4 changes: 2 additions & 2 deletions packages/instrumentation-chromadb/src/instrumentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ export class ChromaDBInstrumentation extends InstrumentationBase<any> {
}
}
} catch (e) {
this._diag.warn(e);
this._diag.debug(e);
this._config.exceptionLogger?.(e);
}

Expand Down Expand Up @@ -341,7 +341,7 @@ export class ChromaDBInstrumentation extends InstrumentationBase<any> {
});
}
} catch (e) {
this._diag.warn(e);
this._diag.debug(e);
this._config.exceptionLogger?.(e);
}

Expand Down
8 changes: 4 additions & 4 deletions packages/instrumentation-cohere/src/instrumentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ export class CohereInstrumentation extends InstrumentationBase<any> {
}
}
} catch (e) {
this._diag.warn(e);
this._diag.debug(e);
this._config.exceptionLogger?.(e);
}

Expand Down Expand Up @@ -388,7 +388,7 @@ export class CohereInstrumentation extends InstrumentationBase<any> {
}
}
} catch (e) {
this._diag.warn(e);
this._diag.debug(e);
this._config.exceptionLogger?.(e);
}
}
Expand Down Expand Up @@ -471,7 +471,7 @@ export class CohereInstrumentation extends InstrumentationBase<any> {
);
}
} catch (e) {
this._diag.warn(e);
this._diag.debug(e);
this._config.exceptionLogger?.(e);
}
}
Expand Down Expand Up @@ -541,7 +541,7 @@ export class CohereInstrumentation extends InstrumentationBase<any> {
);
}
} catch (e) {
this._diag.warn(e);
this._diag.debug(e);
this._config.exceptionLogger?.(e);
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/instrumentation-langchain/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export function genericWrapper(
);
}
} catch (e) {
this._diag.warn(e);
this._diag.debug(e);
this._config.exceptionLogger?.(e);
}
}
Expand Down Expand Up @@ -77,7 +77,7 @@ export function genericWrapper(
}
}
} catch (e) {
this._diag.warn(e);
this._diag.debug(e);
this._config.exceptionLogger?.(e);
} finally {
span.end();
Expand Down
12 changes: 6 additions & 6 deletions packages/instrumentation-openai/src/instrumentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ export class OpenAIInstrumentation extends InstrumentationBase<any> {
}
}
} catch (e) {
this._diag.warn(e);
this._diag.debug(e);
this._config.exceptionLogger?.(e);
}

Expand Down Expand Up @@ -472,7 +472,7 @@ export class OpenAIInstrumentation extends InstrumentationBase<any> {
result.choices[0].text += chunk.choices[0].text;
}
} catch (e) {
this._diag.warn(e);
this._diag.debug(e);
this._config.exceptionLogger?.(e);
}
}
Expand Down Expand Up @@ -500,7 +500,7 @@ export class OpenAIInstrumentation extends InstrumentationBase<any> {
}
}
} catch (e) {
this._diag.warn(e);
this._diag.debug(e);
this._config.exceptionLogger?.(e);
}

Expand Down Expand Up @@ -650,7 +650,7 @@ export class OpenAIInstrumentation extends InstrumentationBase<any> {
}
}
} catch (e) {
this._diag.warn(e);
this._diag.debug(e);
this._config.exceptionLogger?.(e);
}

Expand Down Expand Up @@ -714,7 +714,7 @@ export class OpenAIInstrumentation extends InstrumentationBase<any> {

span.addEvent("logprobs", { logprobs: JSON.stringify(result) });
} catch (e) {
this._diag.warn(e);
this._diag.debug(e);
this._config.exceptionLogger?.(e);
}
}
Expand All @@ -729,7 +729,7 @@ export class OpenAIInstrumentation extends InstrumentationBase<any> {
encoding = encodingForModel(model as TiktokenModel);
this._encodingCache.set(model, encoding);
} catch (e) {
this._diag.warn(e);
this._diag.debug(e);
this._config.exceptionLogger?.(e);
return 0;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/instrumentation-pinecone/src/instrumentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export class PineconeInstrumentation extends InstrumentationBase<any> {
JSON.stringify(options.filter ? options.filter : {}),
);
} catch (e) {
this._diag.warn(e);
this._diag.debug(e);
this._config.exceptionLogger?.(e);
}

Expand Down Expand Up @@ -268,7 +268,7 @@ export class PineconeInstrumentation extends InstrumentationBase<any> {
);
}
} catch (e) {
this._diag.warn(e);
this._diag.debug(e);
this._config.exceptionLogger?.(e);
}
span.end();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ export class AIPlatformInstrumentation extends InstrumentationBase<any> {
}
}
} catch (e) {
this._diag.warn(e);
this._diag.debug(e);
this._config.exceptionLogger?.(e);
}

Expand Down Expand Up @@ -355,7 +355,7 @@ export class AIPlatformInstrumentation extends InstrumentationBase<any> {
}
}
} catch (e) {
this._diag.warn(e);
this._diag.debug(e);
this._config.exceptionLogger?.(e);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export class VertexAIInstrumentation extends InstrumentationBase<any> {
this._formatPartsData(params.contents[0].parts);
}
} catch (e) {
this._diag.warn(e);
this._diag.debug(e);
this._config.exceptionLogger?.(e);
}

Expand Down Expand Up @@ -250,7 +250,7 @@ export class VertexAIInstrumentation extends InstrumentationBase<any> {
});
}
} catch (e) {
this._diag.warn(e);
this._diag.debug(e);
this._config.exceptionLogger?.(e);
}

Expand Down
7 changes: 1 addition & 6 deletions packages/traceloop-sdk/src/lib/telemetry/telemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import * as fs from "fs";
import * as path from "path";
import { v4 as uuid } from "uuid";
import { PostHog } from "posthog-node";
import * as Sentry from "@sentry/node";
import { version } from "../../../package.json";

export class Telemetry {
Expand Down Expand Up @@ -32,10 +31,6 @@ export class Telemetry {
this.posthog = new PostHog(
"phc_JMTeAfG8OpaPsyHzSBtqquMvko1fmOHcW0gyqLCrF3t",
);
Sentry.init({
dsn: "https://0cbbe354864172adc0fbd41621a7a541@o4505278734663680.ingest.us.sentry.io/4507114378166272",
defaultIntegrations: false,
});
}
}

Expand Down Expand Up @@ -85,7 +80,7 @@ export class Telemetry {

public logException(error: Error) {
if (this.telemetryEnabled) {
Sentry.captureException(error);
this.capture("error", { error: error.message, stack: error.stack || "" });
}
}
}
Loading