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

ref: Change native frames from traceId to spanId #4029

Merged
merged 3 commits into from
Aug 16, 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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

## Unreleased

- Add `spotlight` option ([#4023](https://github.com/getsentry/sentry-react-native/pull/4023))
- Deprecating `enableSpotlight` and `spotlightSidecarUrl`

## 5.29.0

### Features

- `TimeToInitialDisplay` and `TimeToFullDisplay` start the time to display spans on mount ([#4020](https://github.com/getsentry/sentry-react-native/pull/4020))
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@sentry/react-native",
"homepage": "https://github.com/getsentry/sentry-react-native",
"repository": "https://github.com/getsentry/sentry-react-native",
"version": "5.28.0",
"version": "5.29.0",
"description": "Official Sentry SDK for react-native",
"typings": "dist/js/index.d.ts",
"types": "dist/js/index.d.ts",
Expand Down
6 changes: 3 additions & 3 deletions samples/expo/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"slug": "sentry-react-native-expo-sample",
"jsEngine": "hermes",
"scheme": "sentry-expo-sample",
"version": "5.28.0",
"version": "5.29.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"userInterfaceStyle": "light",
Expand All @@ -19,15 +19,15 @@
"ios": {
"supportsTablet": true,
"bundleIdentifier": "io.sentry.expo.sample",
"buildNumber": "16"
"buildNumber": "17"
},
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#ffffff"
},
"package": "io.sentry.expo.sample",
"versionCode": 16
"versionCode": 17
},
"web": {
"bundler": "metro",
Expand Down
2 changes: 1 addition & 1 deletion samples/expo/app/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ process.env.EXPO_SKIP_DURING_EXPORT !== 'true' && Sentry.init({
// replaysOnErrorSampleRate: 1.0,
replaysSessionSampleRate: 1.0,
},
enableSpotlight: true,
spotlight: true,
});

function RootLayout() {
Expand Down
2 changes: 1 addition & 1 deletion samples/expo/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sentry-react-native-expo-sample",
"version": "5.28.0",
"version": "5.29.0",
"main": "expo-router/entry",
"scripts": {
"start": "expo start",
Expand Down
4 changes: 2 additions & 2 deletions samples/react-native/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ android {
applicationId "io.sentry.reactnative.sample"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 19
versionName "5.28.0"
versionCode 20
versionName "5.29.0"
}

signingConfigs {
Expand Down
4 changes: 2 additions & 2 deletions samples/react-native/ios/sentryreactnativesample/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>5.28.0</string>
<string>5.29.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>23</string>
<string>24</string>
<key>LSRequiresIPhoneOS</key>
<true />
<key>NSAppTransportSecurity</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>5.28.0</string>
<string>5.29.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>23</string>
<string>24</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion samples/react-native/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sentry-react-native-sample",
"version": "5.28.0",
"version": "5.29.0",
"private": true,
"scripts": {
"postinstall": "patch-package",
Expand Down
2 changes: 1 addition & 1 deletion samples/react-native/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ Sentry.init({
// replaysSessionSampleRate: 1.0,
replaysOnErrorSampleRate: 1.0,
},
enableSpotlight: true,
spotlight: true,
// This should be disabled when manually initializing the native SDK
// Note that options from JS are not passed to the native SDKs when initialized manually
autoInitializeNativeSdk: true,
Expand Down
9 changes: 3 additions & 6 deletions src/js/integrations/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,9 @@ export function getDefaultIntegrations(options: ReactNativeClientOptions): Integ
integrations.push(expoContextIntegration());
}

if (options.enableSpotlight) {
integrations.push(
spotlightIntegration({
sidecarUrl: options.spotlightSidecarUrl,
}),
);
if (options.spotlight || options.enableSpotlight) {
const sidecarUrl = (typeof options.spotlight === 'string' && options.spotlight) || options.spotlightSidecarUrl;
integrations.push(spotlightIntegration({ sidecarUrl }));
}

if (
Expand Down
16 changes: 16 additions & 0 deletions src/js/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ export interface BaseReactNativeOptions {
* More details: https://spotlightjs.com/
*
* IMPORTANT: Only set this option to `true` while developing, not in production!
*
* @deprecated Use `spotlight` instead.
*/
enableSpotlight?: boolean;

Expand All @@ -178,9 +180,23 @@ export interface BaseReactNativeOptions {
* More details: https://spotlightjs.com/
*
* @default "http://localhost:8969/stream"
*
* @deprecated Use `spotlight` instead.
*/
spotlightSidecarUrl?: string;

/**
* If you use Spotlight by Sentry during development, use
* this option to forward captured Sentry events to Spotlight.
*
* Either set it to true, or provide a specific Spotlight Sidecar URL.
*
* More details: https://spotlightjs.com/
*
* IMPORTANT: Only set this option to `true` while developing, not in production!
*/
spotlight?: boolean | string;

/**
* Sets a callback which is executed before capturing screenshots. Only
* relevant if `attachScreenshot` is set to true. When false is returned
Expand Down
2 changes: 1 addition & 1 deletion src/js/version.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export const SDK_PACKAGE_NAME = 'npm:@sentry/react-native';
export const SDK_NAME = 'sentry.javascript.react-native';
export const SDK_VERSION = '5.28.0';
export const SDK_VERSION = '5.29.0';
22 changes: 21 additions & 1 deletion test/sdk.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ describe('Tests the SDK functionality', () => {
expect(actualIntegrations).toEqual(expect.not.arrayContaining([expect.objectContaining({ name: 'Spotlight' })]));
});

it('adds spotlight integration', () => {
it('adds spotlight integration with enableSpotlight', () => {
init({
enableSpotlight: true,
});
Expand All @@ -442,6 +442,26 @@ describe('Tests the SDK functionality', () => {
expect(actualIntegrations).toEqual(expect.arrayContaining([expect.objectContaining({ name: 'Spotlight' })]));
});

it('adds spotlight integration with spotlight bool', () => {
init({
spotlight: true,
});

const actualOptions = usedOptions();
const actualIntegrations = actualOptions?.integrations;
expect(actualIntegrations).toEqual(expect.arrayContaining([expect.objectContaining({ name: 'Spotlight' })]));
});

it('adds spotlight integration with direct url', () => {
init({
spotlight: 'http://localhost:8969/stream',
});

const actualOptions = usedOptions();
const actualIntegrations = actualOptions?.integrations;
expect(actualIntegrations).toEqual(expect.arrayContaining([expect.objectContaining({ name: 'Spotlight' })]));
});

it('no default integrations', () => {
init({
defaultIntegrations: false,
Expand Down
Loading