Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 0 additions & 1 deletion .craft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ targets:
# NPM Targets
## 1. Base Packages, node or browser SDKs depend on
## 1.1 Types
# TODO(v9): Remove
- name: npm
id: '@sentry/types'
includeNames: /^sentry-types-\d.*\.tgz$/
Expand Down
1 change: 0 additions & 1 deletion dev-packages/e2e-tests/verdaccio-config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ packages:
unpublish: $all
# proxy: npmjs # Don't proxy for E2E tests!

# TODO(v9): Remove
'@sentry/types':
access: $all
publish: $all
Expand Down
20 changes: 10 additions & 10 deletions dev-packages/node-integration-tests/test.txt

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions docs/migration/v8-to-v9.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ Older Typescript versions _may_ still work, but we will not test them anymore an

- The `tracesSampler` hook will no longer be called for _every_ span. Instead, it will only be called for "root spans". Root spans are spans that have no local parent span. Root spans may however have incoming trace data from a different service, for example when using distributed tracing.

- The `childProcessIntegration`'s (previously `processThreadBreadcrumbIntegration`) `name` value has been changed from `"ProcessAndThreadBreadcrumbs"` to `"ChildProcess"`. This is relevant if you were filtering integrations by name.

### `@sentry/browser`

- The `captureUserFeedback` method has been removed. Use the `captureFeedback` method instead and update the `comments` field to `message`.
Expand All @@ -116,6 +118,8 @@ Older Typescript versions _may_ still work, but we will not test them anymore an

- By default, source maps will now be automatically deleted after being uploaded to Sentry for client-side builds. You can opt out of this behavior by explicitly setting `sourcemaps.deleteSourcemapsAfterUpload` to `false` in your Sentry config.

- The `sentry` property on the Next.js config object has officially been discontinued. Pass options to `withSentryConfig` directly.

### All Meta-Framework SDKs (`@sentry/astro`, `@sentry/nuxt`, `@sentry/solidstart`)

- Updated source map generation to respect the user-provided value of your build config, such as `vite.build.sourcemap`:
Expand Down
57 changes: 0 additions & 57 deletions packages/aws-serverless/src/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,21 +213,6 @@ function enhanceScopeWithEnvironmentData(scope: Scope, context: Context, startTi
});
}

/**
* Adds additional transaction-related information from the environment and AWS Context to the Sentry Scope.
*
* @param scope Scope that should be enhanced
* @param context AWS Lambda context that will be used to extract some part of the data
*/
function enhanceScopeWithTransactionData(scope: Scope, context: Context): void {
scope.addEventProcessor(event => {
event.transaction = context.functionName;
return event;
});
scope.setTag('server_name', process.env._AWS_XRAY_DAEMON_ADDRESS || process.env.SENTRY_NAME || hostname());
scope.setTag('url', `awslambda:///${context.functionName}`);
}

/**
* Wraps a lambda handler adding it error capture and tracing capabilities.
*
Expand Down Expand Up @@ -333,50 +318,8 @@ export function wrapHandler<TEvent, TResult>(
return rv;
}

// Only start a trace and root span if the handler is not already wrapped by Otel instrumentation
// Otherwise, we create two root spans (one from otel, one from our wrapper).
// If Otel instrumentation didn't work or was filtered by users, we still want to trace the handler.
// TODO(v9): Since bumping the OTEL Instrumentation, this is likely not needed anymore, we can possibly remove this
if (options.startTrace && !isWrappedByOtel(handler)) {
const traceData = getAwsTraceData(event as { headers?: Record<string, string> }, context);

return continueTrace({ sentryTrace: traceData['sentry-trace'], baggage: traceData.baggage }, () => {
return startSpanManual(
{
name: context.functionName,
op: 'function.aws.lambda',
attributes: {
[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'component',
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.function.serverless',
},
},
span => {
enhanceScopeWithTransactionData(getCurrentScope(), context);

return processResult(span);
},
);
});
}

return withScope(async () => {
return processResult(undefined);
});
};
}

/**
* Checks if Otel's AWSLambda instrumentation successfully wrapped the handler.
* Check taken from @opentelemetry/core
*/
function isWrappedByOtel(
// eslint-disable-next-line @typescript-eslint/ban-types
handler: Function & { __original?: unknown; __unwrap?: unknown; __wrapped?: boolean },
): boolean {
return (
typeof handler === 'function' &&
typeof handler.__original === 'function' &&
typeof handler.__unwrap === 'function' &&
handler.__wrapped === true
);
}
5 changes: 0 additions & 5 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@
"publishConfig": {
"access": "public"
},
"TODO(v9):": "Remove these dependencies",
"devDependencies": {
"@types/array.prototype.flat": "^1.2.1",
"array.prototype.flat": "^1.3.0"
},
"scripts": {
"build": "run-p build:transpile build:types",
"build:dev": "yarn build",
Expand Down
16 changes: 3 additions & 13 deletions packages/core/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ import { getPossibleEventMessages } from './utils/eventUtils';
import { merge } from './utils/merge';
import { parseSampleRate } from './utils/parseSampleRate';
import { prepareEvent } from './utils/prepareEvent';
import { showSpanDropWarning } from './utils/spanUtils';
import { convertSpanJsonToTransactionEvent, convertTransactionEventToSpanJson } from './utils/transactionEvent';

const ALREADY_SEEN_ERROR = "Not capturing exception because it's already been captured.";
Expand Down Expand Up @@ -1132,24 +1131,15 @@ function processBeforeSend(
if (beforeSendSpan) {
// process root span
const processedRootSpanJson = beforeSendSpan(convertTransactionEventToSpanJson(processedEvent));
if (!processedRootSpanJson) {
showSpanDropWarning();
} else {
// update event with processed root span values
processedEvent = merge(event, convertSpanJsonToTransactionEvent(processedRootSpanJson));
}
// update event with processed root span values
processedEvent = merge(event, convertSpanJsonToTransactionEvent(processedRootSpanJson));

// process child spans
if (processedEvent.spans) {
const processedSpans: SpanJSON[] = [];
for (const span of processedEvent.spans) {
const processedSpan = beforeSendSpan(span);
if (!processedSpan) {
showSpanDropWarning();
processedSpans.push(span);
} else {
processedSpans.push(processedSpan);
}
processedSpans.push(processedSpan);
}
processedEvent.spans = processedSpans;
}
Expand Down
8 changes: 1 addition & 7 deletions packages/core/src/envelope.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
getSdkMetadataForEnvelopeHeader,
} from './utils-hoist/envelope';
import { uuid4 } from './utils-hoist/misc';
import { showSpanDropWarning, spanToJSON } from './utils/spanUtils';
import { spanToJSON } from './utils/spanUtils';

/**
* Apply SdkInfo (name, version, packages, integrations) to the corresponding event key.
Expand Down Expand Up @@ -128,12 +128,6 @@ export function createSpanEnvelope(spans: [SentrySpan, ...SentrySpan[]], client?
? (span: SentrySpan) => {
const spanJson = spanToJSON(span);
const processedSpan = beforeSendSpan(spanJson);

if (!processedSpan) {
showSpanDropWarning();
return spanJson;
}

return processedSpan;
}
: spanToJSON;
Expand Down
1 change: 0 additions & 1 deletion packages/core/src/scope.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ export interface ScopeContext {
propagationContext: PropagationContext;
}

// TODO(v9): Add `normalizedRequest`
export interface SdkProcessingMetadata {
[key: string]: unknown;
requestSession?: {
Expand Down
21 changes: 0 additions & 21 deletions packages/core/src/utils/spanUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import type {
SpanTimeInput,
TraceContext,
} from '../types-hoist';
import { consoleSandbox } from '../utils-hoist/logger';
import { addNonEnumerableProperty, dropUndefinedKeys } from '../utils-hoist/object';
import { generateSpanId } from '../utils-hoist/propagationContext';
import { timestampInSeconds } from '../utils-hoist/time';
Expand All @@ -30,9 +29,6 @@ import { _getSpanForScope } from './spanOnScope';
export const TRACE_FLAG_NONE = 0x0;
export const TRACE_FLAG_SAMPLED = 0x1;

// todo(v9): Remove this once we've stopped dropping spans via `beforeSendSpan`
let hasShownSpanDropWarning = false;

/**
* Convert a span to a trace context, which can be sent as the `trace` context in an event.
* By default, this will only include trace_id, span_id & parent_span_id.
Expand Down Expand Up @@ -279,23 +275,6 @@ export function getActiveSpan(): Span | undefined {
return _getSpanForScope(getCurrentScope());
}

/**
* Logs a warning once if `beforeSendSpan` is used to drop spans.
*
* todo(v9): Remove this once we've stopped dropping spans via `beforeSendSpan`.
*/
export function showSpanDropWarning(): void {
if (!hasShownSpanDropWarning) {
consoleSandbox(() => {
// eslint-disable-next-line no-console
console.warn(
'[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly.',
);
});
hasShownSpanDropWarning = true;
}
}

/**
* Updates the name of the given span and ensures that the span name is not
* overwritten by the Sentry SDK.
Expand Down
9 changes: 0 additions & 9 deletions packages/nextjs/src/config/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -373,15 +373,6 @@ export type SentryBuildOptions = {
*/
unstable_sentryWebpackPluginOptions?: SentryWebpackPluginOptions;

/**
* Use `hidden-source-map` for webpack `devtool` option, which strips the `sourceMappingURL` from the bottom of built
* JS files.
*
* @deprecated This is deprecated. The SDK emits chunks without `sourceMappingURL` for client bundles by default.
*/
// TODO(v9): Remove option
hideSourceMaps?: boolean;

/**
* Include Next.js-internal code and code from dependencies when uploading source maps.
*
Expand Down
11 changes: 0 additions & 11 deletions packages/nextjs/src/config/withSentryConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,6 @@ function getFinalConfigObject(
incomingUserNextConfigObject: NextConfigObject,
userSentryOptions: SentryBuildOptions,
): NextConfigObject {
// TODO(v9): Remove this check for the Sentry property
if ('sentry' in incomingUserNextConfigObject) {
// eslint-disable-next-line no-console
console.warn(
'[@sentry/nextjs] Setting a `sentry` property on the Next.js config object as a means of configuration is no longer supported. Please use the `sentryBuildOptions` argument of of the `withSentryConfig()` function instead.',
);

// Next 12.2.3+ warns about non-canonical properties on `userNextConfig`.
delete incomingUserNextConfigObject.sentry;
}

if (userSentryOptions?.tunnelRoute) {
if (incomingUserNextConfigObject.output === 'export') {
if (!showedExportModeTunnelWarning) {
Expand Down
5 changes: 1 addition & 4 deletions packages/node/src/integrations/childProcess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ interface Options {
includeChildProcessArgs?: boolean;
}

// TODO(v9): Update this name and mention in migration docs.
const INTEGRATION_NAME = 'ProcessAndThreadBreadcrumbs';
const INTEGRATION_NAME = 'ChildProcess';

/**
* Capture breadcrumbs for child processes and worker threads.
Expand All @@ -22,14 +21,12 @@ export const childProcessIntegration = defineIntegration((options: Options = {})
return {
name: INTEGRATION_NAME,
setup(_client) {
// eslint-disable-next-line deprecation/deprecation
diagnosticsChannel.channel('child_process').subscribe((event: unknown) => {
if (event && typeof event === 'object' && 'process' in event) {
captureChildProcessEvents(event.process as ChildProcess, options);
}
});

// eslint-disable-next-line deprecation/deprecation
diagnosticsChannel.channel('worker_threads').subscribe((event: unknown) => {
if (event && typeof event === 'object' && 'worker' in event) {
captureWorkerThreadEvents(event.worker as Worker);
Expand Down
2 changes: 1 addition & 1 deletion packages/node/src/transports/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export function makeNodeTransport(options: NodeTransportOptions): Transport {
const nativeHttpModule = isHttps ? https : http;
const keepAlive = options.keepAlive === undefined ? false : options.keepAlive;

// TODO(v9): Evaluate if we can set keepAlive to true. This would involve testing for memory leaks in older node
// TODO(v10): Evaluate if we can set keepAlive to true. This would involve testing for memory leaks in older node
// versions(>= 8) as they had memory leaks when using it: #2555
const agent = proxy
? (new HttpsProxyAgent(proxy) as http.Agent)
Expand Down
12 changes: 1 addition & 11 deletions packages/nuxt/src/client/vueIntegration.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
import { GLOBAL_OBJ, defineIntegration } from '@sentry/core';
import type { VueIntegrationOptions } from '@sentry/vue';

type Options = Omit<
VueIntegrationOptions,
| 'app'
| 'Vue'
// TODO(v9): Should be removed from parent type so we can remove it here
| 'hooks'
// TODO(v9): Should be removed from parent type so we can remove it here
| 'timeout'
// TODO(v9): Should be removed from parent type so we can remove it here
| 'trackComponents'
>;
type Options = Omit<VueIntegrationOptions, 'app' | 'Vue'>;

// Since the options object needs to cross the boundary between some builds (i.e. the nuxt module build and our client
// SDK build) we cannot use a getter that is exported from here. Instead we'll pass the options object through a global
Expand Down
Loading