### Get Project Details (Ruby) Source: https://docs.rollbar.com/reference/get-a-project Ruby example for retrieving project information. An Account Access Token with 'read' scope is necessary. ```ruby require 'rollbar' Rollbar.configure do |config| config.access_token = 'YOUR_ACCESS_TOKEN' # Other Rollbar options... end Rollbar.get_project(project_id) do |project| if project puts project.to_json else puts 'Error retrieving project' end end ``` -------------------------------- ### Installation & Initialization Source: https://docs.rollbar.com/docs/session-replay Steps to install the Rollbar SDK and initialize it with the session replay option. ```APIDOC ## Installation & Enabling Session Replay in Rollbar To use Rollbar's new session replay feature and privacy controls, follow these steps: 1. **Install or upgrade to the latest Rollbar SDK:** ```jsx npm install rollbar@3.0.0 ``` 2. **Import and initialize Rollbar Replays with the replay option:** **For existing Rollbar connected projects** ```jsx //New Rollbar Imports import Rollbar from "rollbar/replay"; //Your current Rollbar config config = { // ... your existing config replay: { enabled: true } } ``` For React users using the Rollbar Provider: ```jsx const rollbar = new Rollbar(config); const root = ReactDOM.createRoot( document.getElementById('root') as HTMLElement ); root.render( ); ``` **If loading the client from the CDN:** ```jsx CDN_URL = ``` **For new Rollbar connected projects.** Follow the Quick Start guide that matches your application at and add the above configuration ``` -------------------------------- ### Get a Deploy by ID (Ruby) Source: https://docs.rollbar.com/reference/get-a-deploy Ruby example for retrieving deploy information. Remember to substitute the placeholder deploy ID and access token. ```ruby require 'rollbar' Rollbar.configure do |config| config.access_token = 'YOUR_PROJECT_ACCESS_TOKEN' end Rollbar.get_deploy('{deploy_id}') do |deploy, err| if err puts err else puts deploy end end ``` -------------------------------- ### Get Project Details (Node.js) Source: https://docs.rollbar.com/reference/get-a-project Example of fetching project details using Node.js. Requires an Account Access Token with 'read' scope. ```javascript const Rollbar = require('rollbar'); const rollbar = new Rollbar({ accessToken: 'YOUR_ACCESS_TOKEN', // Other Rollbar options... }); rollbar.getProject(projectId, function (err, project) { if (err) { console.error(err); return; } console.log(project); }); ``` -------------------------------- ### Get a Deploy by ID (Python) Source: https://docs.rollbar.com/reference/get-a-deploy Python example for making an API request to get deploy information. Replace the placeholder token and ID. ```python import rollbar rollbar.init('YOUR_PROJECT_ACCESS_TOKEN') response = rollbar.get_deploy('{deploy_id}') if response.error: print(response.error) else: print(response.result) ``` -------------------------------- ### Trigger Example Source: https://docs.rollbar.com/docs/session-replay Example configuration showing how to set up different types of triggers. ```APIDOC ## Trigger Example ### Description This example demonstrates how to configure various triggers for Rollbar Replays. ### Request Example ```jsx replay: { triggers: [ { type: 'occurrence', level: ['warning', 'error', 'critical', 'info'], samplingRatio: 1.0 }, { type: 'navigation', pathMatch: /app/, // matches any valid regex (as shown, will also match paths containing 'app') preDuration: 0, postDuration: 600, }, { type: 'direct', tags: ['blue', 'green'], } ] } ``` ``` -------------------------------- ### Install Rollbar SDK Source: https://docs.rollbar.com/docs/python Use pip to install the package. ```bash pip install rollbar ``` -------------------------------- ### Start Redis Server Source: https://docs.rollbar.com/docs/sidekiq-integration Before starting Sidekiq, ensure the Redis server is running. ```bash $ redis-server ``` -------------------------------- ### Install Dependencies with Bundler Source: https://docs.rollbar.com/docs/logstash Use this command to install all necessary dependencies for plugin development. ```bash bundle install ``` -------------------------------- ### Get a Deploy by ID (Node.js) Source: https://docs.rollbar.com/reference/get-a-deploy Example of fetching deploy details using Node.js. Replace placeholders with your actual deploy ID and access token. ```javascript const Rollbar = require('rollbar'); const rollbar = new Rollbar({ accessToken: 'YOUR_PROJECT_ACCESS_TOKEN', // Other Rollbar options }); rollbar.getDeploy('{deploy_id}', function (err, deploy) { if (err) { console.error(err); return; } console.log(deploy); }); ``` -------------------------------- ### Install Rollbar with yarn Source: https://docs.rollbar.com/docs/react-ts Install the Rollbar SDK and its React integration using yarn. ```bash yarn add rollbar @rollbar/react ``` -------------------------------- ### JavaScript Example Source: https://docs.rollbar.com/reference/update-a-deploy A basic JavaScript example demonstrating an AJAX GET request. This is likely boilerplate or a placeholder and not directly related to the API update functionality. ```javascript $.get('http://yoursite.com/test/' + id, function(data) { console.log(data); }); ``` -------------------------------- ### Install Rollbar with npm Source: https://docs.rollbar.com/docs/react-ts Install the Rollbar SDK and its React integration using npm. ```bash npm install rollbar @rollbar/react ``` -------------------------------- ### Start rollbar-agent service Source: https://docs.rollbar.com/docs/rollbar-agent Start the rollbar-agent service after it has been set up and configured. ```bash service rollbar-agent start ``` -------------------------------- ### Install rollbar-agent from source Source: https://docs.rollbar.com/docs/rollbar-agent After cloning or extracting the source, run this command to install the agent. A sudo may be required. ```bash python setup.py install ``` -------------------------------- ### Install Rollbar for Next.js Source: https://docs.rollbar.com/docs/nextjs Install the Rollbar SDK and the React integration package using npm, yarn, or pnpm. ```bash # npm > npm install rollbar @rollbar/react ``` ```bash # yarn > yarn add rollbar @rollbar/react ``` ```bash # pnpm > pnpm add rollbar @rollbar/react ``` -------------------------------- ### Install Rollbar React SDK with npm Source: https://docs.rollbar.com/docs/react Install the Rollbar React SDK and the core rollbar.js library using npm. ```shell npm install @rollbar/react rollbar ``` -------------------------------- ### Install Rollbar via NuGet Source: https://docs.rollbar.com/docs/asp-net-mvc Command to install the Rollbar SDK using the Package Manager Console. ```shell Install-Package Rollbar ``` -------------------------------- ### Configure and Install Rollbar in Bottle Source: https://docs.rollbar.com/docs/bottle Initializes the Rollbar reporter and installs it globally to catch exceptions in a Bottle application. ```python import bottle from rollbar.contrib.bottle import RollbarBottleReporter rbr = RollbarBottleReporter(access_token='POST_SERVER_ITEM_ACCESS_TOKEN', environment='production') #setup rollbar bottle.install(rbr) #install globally @bottle.get('/') def raise_error(): ''' When navigating to /, we'll get a regular 500 page from bottle, as well as have the error below listed on Rollbar. ''' raise Exception('Hello, Rollbar!') if __name__ == '__main__': bottle.run(host='localhost', port=8080) ``` -------------------------------- ### Install Rollbar React SDK with yarn Source: https://docs.rollbar.com/docs/react Install the Rollbar React SDK and the core rollbar.js library using yarn. ```shell yarn add @rollbar/react rollbar ``` -------------------------------- ### Configure and Start AUL Monitoring Source: https://docs.rollbar.com/docs/sdk-module-rollbaraul Initializes the Rollbar configuration with telemetry enabled and starts the AUL store monitor to capture application logs. ```swift // Create proper RollbarConfig instance making sure // the Telemetry and its log capture are enabled: let config = RollbarConfig(); config.destination.accessToken = ""; config.destination.environment = ""; config.developerOptions.transmit = true; config.telemetry.enabled = true; config.telemetry.captureLog = true; // Setup shared RollbarLogger with the config: Rollbar.initWithConfiguration(config); // Configure the AUL monitor with the logger: RollbarAulStoreMonitor.sharedInstance().configureRollbarLogger(Rollbar.currentLogger()); // Optionally, configure the AUL monitoring options: let aulOptions = RollbarAulStoreMonitorOptions(); aulOptions.addAulSubsystem("DataAccessLayer"); aulOptions.addAulSubsystem("Model"); aulOptions.addAulCategory("CompanyOrg"); RollbarAulStoreMonitor.sharedInstance().configure(with: aulOptions); // Start the AUL monitoring: RollbarAulStoreMonitor.sharedInstance().start(); ``` ```objectivec // Create proper RollbarConfig instance making sure // the Telemetry and its log capture are enabled: RollbarConfig *rollbarConfig = [[RollbarConfig alloc] init]; rollbarConfig.destination.accessToken = @""; rollbarConfig.destination.environment = @""; rollbarConfig.developerOptions.transmit = YES; rollbarConfig.telemetry.enabled = YES; // required for AUL capture rollbarConfig.telemetry.captureLog = YES; // required for AUL capture rollbarConfig.telemetry.maximumTelemetryData = 100; // Setup shared RollbarLogger with the config: [Rollbar initWithConfiguration:rollbarConfig]; // Configure the AUL monitor with the logger: [RollbarAulStoreMonitor.sharedInstance configureRollbarLogger:Rollbar.currentLogger]; // Optionally, configure the AUL monitoring options: RollbarAulStoreMonitorOptions *aulMonitorOptions = [[RollbarAulStoreMonitorOptions alloc] init]; [aulMonitorOptions addAulSubsystem:@"DataAccessLayer"]; [aulMonitorOptions addAulSubsystem:@"Model"]; [aulMonitorOptions addAulCategory:@"CompanyOrg"]; [RollbarAulStoreMonitor.sharedInstance configureWithOptions:aulMonitorOptions]; // Start the AUL monitoring: [RollbarAulStoreMonitor.sharedInstance start]; ``` -------------------------------- ### Install Twisted and Treq Source: https://docs.rollbar.com/docs/twisted Install the Twisted framework and the treq library, which are required for using pyrollbar with Twisted. Run these commands in your terminal. ```bash pip install twisted pip install treq ``` -------------------------------- ### Create RQL Job cURL Example Source: https://docs.rollbar.com/docs/rql Example using cURL to create an RQL job with a specified query string. Requires an ACCOUNT_READ_TOKEN for authentication. ```curl curl --location 'https://api.rollbar.com/api/1/rql/jobs/' \ --header 'X-Rollbar-Access-Token: ACCOUNT_READ_TOKEN' \ --form 'query_string=" SELECT * FROM item_occurrence WHERE item.counter = 1 ORDER BY timestamp DESC"' ``` -------------------------------- ### Get Project Details (Python) Source: https://docs.rollbar.com/reference/get-a-project Python code to get project details. Requires an Account Access Token with 'read' scope. ```python import rollbar rollbar.init( 'YOUR_ACCESS_TOKEN', # Other Rollbar options... ) project = rollbar.get_project(project_id) if project: print(project) else: print('Error retrieving project') ``` -------------------------------- ### Initialize and Report Errors Source: https://docs.rollbar.com/docs/python Initialize the SDK with your access token and environment, then use try-except blocks to report exceptions. ```python import rollbar # access_token, environment, code_version rollbar.init('POST_SERVER_ITEM_ACCESS_TOKEN', 'production', code_version='COMMIT_SHA') try: main_app_loop() except IOError: rollbar.report_message('Got an IOError in the main loop', 'warning') except: # catch-all rollbar.report_exc_info() # equivalent to rollbar.report_exc_info(sys.exc_info()) ``` -------------------------------- ### View CLI Help Source: https://docs.rollbar.com/docs/python Display available command-line options. ```bash $ rollbar --help Usage: rollbar [options] Options: --version show program's version number and exit -h, --help show this help message and exit -t ACCESS_TOKEN, --access_token=ACCESS_TOKEN You project's access token from rollbar.com. -e ENVIRONMENT, --environment=ENVIRONMENT The environment to report errors and messages to. -u ENDPOINT_URL, --url=ENDPOINT_URL The Rollbar API endpoint url to send data to. -m HANDLER, --handler=HANDLER The method in which to report errors. -v, --verbose Print verbose output. ``` -------------------------------- ### Initialize LaunchDarkly Client with Context Source: https://docs.rollbar.com/docs/launchdarkly Set up the LaunchDarkly client with user and organization context. Ensure 'YOUR_LD_TOKEN' is replaced with your actual LaunchDarkly client-side ID. ```javascript //Create Org and User Context to be used const context = { kind: "multi", user: { key: "User X_ID", name: "User X", email: "UserX@company.com" }, organization: { key: "Company X_ID", name: "Company X", address: { street: "Some Street", city: "Some City" } } } // Set clientSideID to your LaunchDarkly client-side ID const clientSideID = 'YOUR_LD_TOKEN'; //Initialize Client const ldclient = LDClient.initialize(clientSideID, context); ``` -------------------------------- ### Initializing Rollbar with New API (Recommended) Source: https://docs.rollbar.com/docs/upgrading-from-v054-or-earlier-to-v100 This example shows the recommended way to initialize the Rollbar SDK using the new API, which involves configuring the Rollbar instance with a Config object built using the builder pattern. ```java import com.rollbar.notifier.Rollbar; public class MainClass { public static final Rollbar rollbar = new Rollbar( withAccessToken("ACCESS_TOKEN") .environment("production") .handleUncaughtErrors(true) .build()); public int main(String[] args) { OtherClass.runProgram(); return 0; } } ``` -------------------------------- ### Make init.d script executable and symlink Source: https://docs.rollbar.com/docs/rollbar-agent Make the init.d script executable and then symlink it to the system's init.d directory. Ensure VIRTUALENV is set correctly in the script. ```bash chmod +x /path/to/virtualenv/rollbar-agent-init.sh ln -s /path/to/virtualenv/rollbar-agent-init.sh /etc/init.d/rollbar-agent ``` -------------------------------- ### Add Rake to Gemfile Source: https://docs.rollbar.com/docs/using-with-zeus If the Zeus server fails to start after installing the rollbar gem, explicitly add 'gem "rake"' to your Gemfile to resolve potential conflicts. ```ruby gem "rake" ``` -------------------------------- ### Initialize and use Rollbar in Go Source: https://docs.rollbar.com/docs/go Configure the Rollbar client with your project token and environment, then use it to report messages or wrap functions to capture panics. ```go package main import ( "github.com/rollbar/rollbar-go" "time" ) func main() { rollbar.SetToken("MY_TOKEN") rollbar.SetEnvironment("production") // defaults to "development" rollbar.SetCodeVersion("v2") // optional Git hash/branch/tag (required for GitHub integration) rollbar.SetServerHost("web.1") // optional override; defaults to hostname rollbar.SetServerRoot("github.com/heroku/myproject") // path of project (required for GitHub integration and non-project stacktrace collapsing) - where repo is set up for the project, the server.root has to be "/" rollbar.Info("Message body goes here") rollbar.WrapAndWait(doSomething) rollbar.Close() // call before your application closes to send any final events } func doSomething() { var timer *time.Timer = nil timer.Reset(10) // this will panic } ``` -------------------------------- ### cURL Request to Get Activated Item Counts Source: https://docs.rollbar.com/reference/get-activated-item-counts Example cURL request to fetch activated item counts. The `buckets` query parameter specifies the number of buckets to return, defaulting to 60. ```shell curl --request GET \ --url 'https://api.rollbar.com/api/1/reports/activated_counts?buckets=60' ``` -------------------------------- ### Rollbar SDK Configuration Example Source: https://docs.rollbar.com/docs/rollbarjs-configuration-reference Illustrates how to configure the Rollbar SDK with various options. Ensure you replace 'YOUR_POST_SERVER_ITEM_ACCESS_TOKEN' with your actual access token. ```javascript Rollbar.init({ accessToken: 'YOUR_POST_SERVER_ITEM_ACCESS_TOKEN', captureUncaught: true, captureUnhandledRejections: true, payload: { environment: 'production', server: { } } }); ``` -------------------------------- ### Configure RollbarTraceListener in app.config Source: https://docs.rollbar.com/docs/v5-integrating-as-a-tracelistener Add this configuration to your app.config file to enable the RollbarTraceListener. Ensure Rollbar.dll is in the same directory. This example includes basic listener setup with trace output options, access token, and environment. ```xml ``` -------------------------------- ### Install Plugin Gem Source: https://docs.rollbar.com/docs/logstash Install the built plugin gem into your Logstash installation. ```bash bin/plugin install /your/local/plugin/logstash-filter-awesome.gem ``` -------------------------------- ### Install dependencies after updating package.json Source: https://docs.rollbar.com/docs/react Run npm install or yarn install after manually updating package.json to include the Rollbar SDK. ```shell npm install # OR yarn install ``` -------------------------------- ### Build the project using Gradle Source: https://docs.rollbar.com/docs/java Execute the build process using the Gradle wrapper. ```bash ./gradlew clean build ``` -------------------------------- ### Install Rollbar Gem Source: https://docs.rollbar.com/docs/ruby Add the gem to your Gemfile and install it via terminal. ```ruby gem 'rollbar' ``` ```bash bundle install # Or if you don't use bundler: gem install rollbar ``` -------------------------------- ### View Heroku Webhook Help Source: https://docs.rollbar.com/docs/heroku Displays documentation for the webhooks:add command options. ```bash heroku webhooks:add --help ``` -------------------------------- ### Configure Global.asax.cs Source: https://docs.rollbar.com/docs/v5-integrating-with-aspnet-mvc Initialize the Rollbar infrastructure and implement global error handling within the MvcApplication class. ```csharp //... using Rollbar; using Rollbar.Net.AspNet; //.. public class MvcApplication : System.Web.HttpApplication { protected void Application_Start() { ConfigureRollbarInfrastructure(); RollbarLocator.RollbarInstance.Info("Rollbar.NET is ready to roll!"); AreaRegistration.RegisterAllAreas(); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); } protected void Application_Error() { var exception = Server.GetLastError(); var httpContext = HttpContext.Current; IRollbarPackage packagingStrategy = new ExceptionPackage( exception, "EXCEPTION intercepted by MvcApplication.Application_Error()" ); if (httpContext != null) { packagingStrategy = new HttpContextPackageDecorator(packagingStrategy, httpContext); } RollbarLocator.RollbarInstance.Critical(packagingStrategy); } /// /// Configures the Rollbar infrastructure. /// private static void ConfigureRollbarInfrastructure() { // minimally required Rollbar configuration: RollbarInfrastructureConfig rollbarInfrastructureConfig = new RollbarInfrastructureConfig( RollbarSamplesSettings.AccessToken, RollbarSamplesSettings.Environment ); // optionally, add data scrubbing options: RollbarDataSecurityOptions dataSecurityOptions = new RollbarDataSecurityOptions(); dataSecurityOptions.ScrubFields = new string[] { "access_token", // normally, you do not want scrub this specific field (it is operationally critical), but it just proves safety net built into the notifier... "username", }; rollbarInfrastructureConfig .RollbarLoggerConfig .RollbarDataSecurityOptions .Reconfigure(dataSecurityOptions); // initialize Rollbar infrastructure: RollbarInfrastructure.Instance.Init(rollbarInfrastructureConfig); // optionally, if you would like to monitor all Rollbar instances' internal events within your application: RollbarInfrastructure.Instance.QueueController.InternalEvent += OnRollbarInternalEvent; // optionally, if you would like to monitor this Rollbar instance's internal events within your application: RollbarLocator.RollbarInstance.InternalEvent += OnRollbarInternalEvent; // basic test: RollbarLocator .RollbarInstance .Info($"{typeof(MvcApplication).Namespace}: Rollbar is up and running!"); } /// /// Called when rollbar internal event is detected. /// /// The sender. /// The instance containing the event data. private static void OnRollbarInternalEvent(object sender, RollbarEventArgs e) { Console.WriteLine(e.TraceAsString()); RollbarApiErrorEventArgs apiErrorEvent = e as RollbarApiErrorEventArgs; if (apiErrorEvent != null) { //TODO: handle/report Rollbar API communication error event... return; } CommunicationEventArgs commEvent = e as CommunicationEventArgs; if (commEvent != null) { //TODO: handle/report Rollbar API communication event... return; } CommunicationErrorEventArgs commErrorEvent = e as CommunicationErrorEventArgs; if (commErrorEvent != null) { //TODO: handle/report basic communication error while attempting to reach Rollbar API service... return; } InternalErrorEventArgs internalErrorEvent = e as InternalErrorEventArgs; if (internalErrorEvent != null) { //TODO: handle/report basic internal error while using the Rollbar Notifier... return; } } } ``` -------------------------------- ### Report a Deploy using Ruby Source: https://docs.rollbar.com/reference/deploy This Ruby example shows how to send deploy information to Rollbar using an HTTP POST request. ```ruby require 'rest-client' require 'json' url = 'https://api.rollbar.com/api/1/deploy' headers = { 'X-Rollbar-Access-Token' => 'YOUR_PROJECT_ACCESS_TOKEN' } payload = { environment: 'production', revision: 'a1b2c3d4e5f6', rollbar_username: 'test_user', local_username: 'local_user', comment: 'Deploying version 1.2.3', status: 'succeeded' } response = RestClient.post(url, payload.to_json, headers: headers) puts JSON.parse(response) ``` -------------------------------- ### Install React SDK Dependencies Source: https://docs.rollbar.com/docs/react-native Commands to install dependencies for using Rollbar with the React SDK. ```bash npm install @rollbar/react rollbar rollbar-react-native ``` ```bash yarn add @rollbar/react rollbar rollbar-react-native ``` -------------------------------- ### Build Plugin Gem Source: https://docs.rollbar.com/docs/logstash Create a gem package for your plugin to install it into an installed Logstash instance. ```bash gem build logstash-filter-awesome.gemspec ``` -------------------------------- ### Configure and Log with Singleton Instance - C# Source: https://docs.rollbar.com/docs/more-advanced-logger-usages Configure the singleton-like Rollbar instance using RollbarLocator before logging. This example demonstrates configuring with an access token and environment, then logging messages and exceptions at different levels. ```csharp const string postServerItemAccessToken = "POST_SERVER_ITEM_ACCESS_TOKEN"; RollbarLocator.RollbarInstance .Configure(new RollbarConfig(postServerItemAccessToken) { Environment = "proxyTest" }) ; RollbarLocator.RollbarInstance .Info("Basic info log example."); RollbarLocator.RollbarInstance .Debug("First debug log."); RollbarLocator.RollbarInstance .Error(new NullReferenceException()); RollbarLocator.RollbarInstance .Error(new Exception("trying out the TraceChain", new Exception("inner"))); ``` -------------------------------- ### Install Rollbar SDK Source: https://docs.rollbar.com/docs/session-replay Install or upgrade to the latest Rollbar SDK version 3.0.0 using npm. ```bash npm install rollbar@3.0.0 ``` -------------------------------- ### Quick Start Rollbar Configuration Source: https://docs.rollbar.com/docs/nodejs Initialize Rollbar with an access token and enable uncaught exception and unhandled rejection capturing. Replace 'POST_SERVER_ITEM_ACCESS_TOKEN' with your actual token. ```javascript var Rollbar = require('rollbar'); var rollbar = new Rollbar({ accessToken: 'POST_SERVER_ITEM_ACCESS_TOKEN', captureUncaught: true, captureUnhandledRejections: true, payload: { code_version: '1.0.0', } }); // log a generic message and send to rollbar rollbar.log('Hello world!'); ``` -------------------------------- ### Install rollbar-agent with pip Source: https://docs.rollbar.com/docs/rollbar-agent Use this command to install the rollbar-agent library and its configuration files into your virtual environment. ```bash pip install rollbar-agent ``` -------------------------------- ### Test Rollbar Installation Source: https://docs.rollbar.com/docs/grape Execute this command to verify that Rollbar is correctly capturing exceptions. ```bash $ rake rollbar:test ``` -------------------------------- ### Install Rollbar Laravel SDK Source: https://docs.rollbar.com/docs/laravel Use Composer to install the appropriate version of the Rollbar Laravel package. ```bash composer require rollbar/rollbar-laravel ``` ```bash composer require rollbar/rollbar-laravel 4.* ``` ```bash composer require rollbar/rollbar-laravel 2.* ``` -------------------------------- ### Report a Deploy using Python Source: https://docs.rollbar.com/reference/deploy This Python example demonstrates how to report a deploy to Rollbar using the `requests` library. ```python import requests import json url = 'https://api.rollbar.com/api/1/deploy' headers = { 'X-Rollbar-Access-Token': 'YOUR_PROJECT_ACCESS_TOKEN' } payload = { 'environment': 'production', 'revision': 'a1b2c3d4e5f6', 'rollbar_username': 'test_user', 'local_username': 'local_user', 'comment': 'Deploying version 1.2.3', 'status': 'succeeded' } response = requests.post(url, headers=headers, data=json.dumps(payload)) print(response.json()) ``` -------------------------------- ### Install Rollbar React Native dependencies Source: https://docs.rollbar.com/docs/migrating-to-v100 Install the required peer dependencies using npm or yarn. ```shell npm install rollbar rollbar-react-native ``` ```shell yarn add rollbar rollbar-react-native ``` -------------------------------- ### Initialize Rollbar SDK Source: https://docs.rollbar.com/docs/basic-php-installation-setup Configure and initialize the Rollbar SDK at the application entry point. ```php 'POST_SERVER_ITEM_ACCESS_TOKEN', // optional - environment name. any string will do. 'environment' => 'production', // optional - path to directory your code is in. used for linking stack traces. 'root' => '/var/www/myapp', // optional - the code version. e.g. git commit SHA or release tag 'code_version' => '27f47021038a159c5aa9bbb9f98ce47e55914404' ); Rollbar::init($config); ``` -------------------------------- ### Build Cordova Project Source: https://docs.rollbar.com/docs/rollbar-cordova Commands to build the project for specific platforms. ```bash cordova build ios ``` ```bash cordova build android ``` -------------------------------- ### Cocoapods Installation Source: https://docs.rollbar.com/docs/ios Add this line to your Podfile to install the Rollbar SDK using Cocoapods. Specify the desired version. ```ruby pod "Rollbar", "~> n.n.n" ``` -------------------------------- ### Bundle Gem Dependencies Source: https://docs.rollbar.com/docs/aws-lambda-ruby Install gem dependencies locally and then create a deployment-ready package using bundler. ```shell bundle install && bundle install --deployment ``` -------------------------------- ### Configure iOS Podfile Source: https://docs.rollbar.com/docs/migrating-to-v100 Set the platform version and enable frameworks in the Podfile. ```ruby platform :ios, '14.0' ``` ```ruby use_frameworks! ``` -------------------------------- ### RQL Job Resource Response Example Source: https://docs.rollbar.com/reference/rql-1 Example of the JSON structure returned by the API when querying an RQL job. ```json { "err" 0, "result": { "id": 123, // job id "project_id": 456, "query_string": "show tables", "status": "new", // One of "new", "running", "success", "failed", "cancelled", or "timed_out" "job_hash": "abcdefabcdefabcdef", "date_created": 1446598885, "date_modified": 1446598885, "result": {...} // A RQL job resource if expand=result is used in query string } } ``` -------------------------------- ### Add Rollbar.NET Packages Source: https://docs.rollbar.com/docs/v5-integrating-with-windows-forms-based-applications Install the Rollbar SDK and optional packages for configuration and offline persistence using the .NET CLI. ```shell dotnet add package Rollbar // optionally: dotnet add package Rollbar.App.Config dotnet add package Rollbar.OfflinePersistence ``` -------------------------------- ### Install Rollbar with npm Source: https://docs.rollbar.com/docs/nodejs Install the Rollbar Node.js package using npm. This command saves the package as a dependency in your project. ```bash npm install --save rollbar ``` -------------------------------- ### Install Rollbar npm Package Source: https://docs.rollbar.com/docs/electron Install the Rollbar npm package for use in both the front and back end of your Electron application. ```bash npm install --save rollbar ``` ```bash yarn add rollbar ``` -------------------------------- ### Install Flask and Blinker dependencies Source: https://docs.rollbar.com/docs/flask Required packages for using Rollbar with Flask. Ensure these are installed in your environment before proceeding with configuration. ```bash pip install Flask pip install blinker ``` -------------------------------- ### Trigger Direct Replay with Tags Source: https://docs.rollbar.com/docs/session-replay Manually trigger a session replay with specific tags. This example shows how to initiate a replay that would match a trigger configured with the same tags. ```sql Rollbar.triggerDirectReplay({ tags: ["beta test group"] }) ``` ```sql { tags: ["beta test group"], samplingRatio: 0.1, } ``` -------------------------------- ### Example Raw JSON Payload Source: https://docs.rollbar.com/docs/path-filter This is an example of a raw JSON payload sent by the Rollbar SDK, which can be used for filtering notifications. ```json { "body": { "trace": { "frames": [ { "class_name": "java.lang.Thread", "method": "run", "lineno": 748, "filename": "Thread.java" }, { "class_name": "org.apache.tomcat.util.threads.TaskThread$WrappingRunnable", "method": "run", "lineno": 61, "filename": "TaskThread.java" }, { "class_name": "com.example.springboot.MainController", "method": "test", "lineno": 32, "filename": "MainController.java" } ], "exception": { "message": "Unhandled Thread error has occurred", "class": "java.lang.RuntimeException" } } }, "person": { "id": "10098" }, "custom": { "trace_id": "9e5ba3146", "customer_type": "enterprise" } } ``` -------------------------------- ### Create a project via cURL Source: https://docs.rollbar.com/reference/create-a-project Use this request to create a new project. Requires an Account Access Token with write scope. ```Shell curl --request POST \ --url https://api.rollbar.com/api/1/projects \ --header 'accept: application/json' \ --header 'content-type: application/json' ```