Bugsnag provides error reporting libraries for major software platforms which automatically detect and report errors in your applications, and capture diagnostic data required to help you reproduce and fix each error.

RudderStack supports Bugsnag as a destination to which you can seamlessly send your event data.

Getting started

Before configuring Bugsnag as a destination in RudderStack, verify if the source platform is supported by Bugsnag by referring to the table below:

Connection ModeWebMobileServer
Device modeSupportedSupported-
Cloud mode---
To know more about the difference between cloud mode and device mode in RudderStack, refer to the RudderStack Connection Modes guide.

Once you have confirmed that the platform supports sending events to Bugsnag, follow these steps:

  1. From your RudderStack dashboard, add a source. Then, from the list of destinations, select Bugsnag.
  2. Assign a name to the destination and click on Next.

Connection settings

To successfully configure Bugsnag as a destination, you will need to configure the following settings:

bugsnag connection settings
  • BugSnag Api Key: Enter your BugSnag API key. You can find the API key in your Bugsnag dashboard under Settings > Project Settings.

For more information on getting your BugSnag Api Key, refer to the FAQ section below.

  • Use device-mode to send events: As this is a device mode-only destination, this setting is enabled by default and cannot be disabled.
  • Release Stage: Use this setting to specify the release stage of your app:
    • Enable it for Development stage.
    • Keep it dsabled for Production stage.
  • SSL: Enabled by default, this option uses SSL while sending data to Bugsnag.

Adding Bugsnag to mobile project

Once you add Bugsnag as a destination in the RudderStack dashboard, follow these steps to add it to your mobile project depending on your integration platform:

Please follow the steps below to add Bugsnag to your Android Project:
  1. Add the following repository to your app/build.gradle file.
    repositories {
    mavenCentral()
    }
  2. After that, add the following dependencies in the same file:
    implementation 'com.rudderstack.android.sdk:core:1.0.1-beta.1'
    implementation 'com.rudderstack.android.integration:bugsnag:0.1.0-beta.1'
  3. Finally, change the initialization of your RudderClient in your Application class
    val rudderClient = RudderClient.getInstance(
    this,
    <YOUT_WRITE_KEY>,
    RudderConfig.Builder()
    .withDataPlaneUrl(<YOUR_DATA_PLANE_URL>)
    .withFactory(BugsnagIntegrationFactory.FACTORY)
    .build()
    )
Follow these steps to add Bugsnag to your iOS project:
  1. Go to Podfile and add the Rudder-Bugsnag extension:
    pod 'Rudder-Bugsnag', '0.1.0-beta.1'
  2. After adding the dependency followed by pod install , you can add the imports to your AppDelegate.m file as shown:
    #import "RudderBugsnagFactory.h"
  3. Finally, change the initialization of your RudderClient as shown:
    RudderConfigBuilder *builder = [[RudderConfigBuilder alloc] init];
    [builder withDataPlaneUrl:<YOUR_DATA_PLANE_URL>];
    [builder withFactory:[RudderBugsnagFactory instance]];
    [RudderClient getInstance:<YOUR_WRITE_KEY> config:[builder build]];
This device mode integration is supported for Bugsnag v6.16.4 and above.
Follow these steps to add Bugsnag to your iOS project:
  1. Install RudderBugsnag (available through CocoaPods) by adding the following line to your Podfile:
    pod 'RudderBugsnag', '~> 1.0.0'
  2. Run the pod install command.
  3. Then, import the SDK depending on your preferred platform:
    import RudderBugsnag
    @import RudderBugsnag;
  4. Next, add the imports to your AppDelegate file under the didFinishLaunchingWithOptions method, as shown:

    let config: RSConfig = RSConfig(writeKey: WRITE_KEY)
    .dataPlaneURL(DATA_PLANE_URL)
    RSClient.sharedInstance().configure(with: config)
    RSClient.sharedInstance().addDestination(RudderBugsnagDestination())
    RSConfig *config = [[RSConfig alloc] initWithWriteKey:WRITE_KEY];
    [config dataPlaneURL:DATA_PLANE_URL];
    [[RSClient sharedInstance] configureWith:config];
    [[RSClient sharedInstance] addDestination:[[RudderBugsnagDestination alloc] init]];

Identify

The identify method lets you identify a user and associate them to their actions. It also lets you record any traits about them like their name, email, etc.

A sample identify call is shown below:

rudderanalytics.identify("1hKOmRA4el9Zt1WSfVJIVo4GRlm", {
name: "Alex Keener",
email: "alex@example.com",
});

Bugsnag will show the userId and traits in the Users tab of each error.

Error Reporting

Along with user-specific information, you can also use Bugsnag to track handled exceptions data to your dashboard using Bugsnag's native methods. For more information on these functions, refer to Bugsnag documentation.

FAQ

Where can I find the Bugsnag API Key?

  1. Log into your Bugsnag dashboard.
  2. Click on Settings at the top right corner.
  3. Click on Project Settings to find the API key as shown:
bugsnag api key

What is meant by Release Stage?

You can distinguish errors that happen in different stages of your app's release process, for example, production, development, etc.

Do I need to use SSL?

You should use SSL while sending data to Bugsnag in web device mode.


Contact us

For more information on the topics covered on this page, email us or start a conversation in our Slack community.

Contents