Skip to content
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

fix(otlp): manual span #3647

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bodinsamuel
Copy link
Collaborator

@bodinsamuel bodinsamuel commented Mar 10, 2025

Changes

Contributes to https://linear.app/nango/issue/NAN-2803/investigate-otlp-export

  • Manually declare OTLP span
    We need to dissociate span creation from logCtx, because getting the operation entirely from ES is not a viable solution. This fix only changes Span to be declared manually but does not fix the main issue. Just wanted to be sure it was doable and limit the scope of this PR.

  • Fix nangoProps type

  • Fix OTLP export broken by Sentry (skipOtel)

@bodinsamuel bodinsamuel self-assigned this Mar 10, 2025
Copy link

linear bot commented Mar 10, 2025

@bodinsamuel bodinsamuel requested a review from a team March 10, 2025 09:33
syncJobId?: number | undefined;
track_deletes?: boolean;
attributes?: object | undefined;
abortSignal?: AbortSignal;
syncConfig: DBSyncConfig;
runnerFlags: RunnerFlags;
/**
* @deprecated not used
*/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is only debug deprecated?

@@ -21,8 +21,7 @@ export function initSentry({ dsn, hash, applicationName }: { dsn: string | undef
Sentry.init({
dsn: dsn || '',
sampleRate: 1,
tracesSampleRate: 0,
openTelemetryInstrumentations: [],
skipOpenTelemetrySetup: true,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add a comment to explain why we set skipOpenTelemetrySetup to true?

@@ -92,6 +93,7 @@ export async function startSync(task: TaskSync, startScriptFn = startScript): Pr
meta: { scriptVersion: syncConfig.version }
}
);
logCtx.attachSpan(new OtlpSpan(logCtx.operation, startedAt));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not a huge fan of this pseudo independent attachSpan function that we need to sprinkle all over the codebase.
Since it always depends on a logContextGetter.create why not making it a part of it.
can logContextGetter.create take a otlpSpan?: { startedAt?: Date } params. When it is passed the create function can set span = new OtlpSpan(...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants