Giter Club home page Giter Club logo

rokudatadog's Introduction

Roku DataDog error tracker

npm version monthly downloads license GitHub last commit


A tool to track your Roku application errors.

Requirements

Installation

Use following command to get the package to your application

ropm install roku-data-dog

The package should be stored in /components directory

How to use DataDogTracker:

  • Create your RUM application in DataDog
  • Create a try-catch block where you expect any error to occure

Used with a SceneGraph project:

  • Inside the CATCH:
  • Create dataDogTracker component
  • Create and set the DataDog configuration
  • Send the error to DataDog
  • In the following example you can observe how to set up what was explained above:
dataDogTracker = CreateObject("roSGNode", "TrackerComponent")
dataDogConfigurationObject = {applicationID: "[application_id]", clientToken: "[application_token]"}
dataDogTracker.callFunc("setConfiguration", ConfigurationObject)
dataDogTracker.callFunc("sendError", error)

Used with BrightScript project:

  • Inside the xml file of your component you have to include the scripts for the following components:
<script type="text/brightscript" uri="pkg:/[path_to_project]/dataDogTracker/viewSample.brs" />
<script type="text/brightscript" uri="pkg:/[path_to_project]/dataDogTracker/errorSample.brs" />
<script type="text/brightscript" uri="pkg:/[path_to_project]/dataDogTracker/dataDogConfig.brs" />
<script type="text/brightscript" uri="pkg:/[path_to_project]/dataDogTracker/dataDogConfiguration.brs" />
<script type="text/brightscript" uri="pkg:/[path_to_project]/dataDogTracker/dataDogTracker.brs" />
  • Inside the CATCH:
  • Set the DataDog configuration
  • Send the error to DataDog
  • In the following example you can observe how to set up what was explained above:
dataDogConfigurationObject = {applicationID: "[application_id]", clientToken: "[application_token]"}
dataDogTrackerConfiguration = Configuration(dataDogConfigurationObject)
dataDogTracker = Tracker(dataDogTrackerConfiguration)
dataDogTracker.sendError(error)
Keep in mind that in the examples, the methods are called without any prefixes, so if you install the package with prefixes, use them for the package methods.
The following fields can be set inside the DataDog configuration:
Field Type Default Value
applicationID STRING ""
clientToken STRING ""
site STRING ""
service STRING ""
sampleRate INTEGER 100
trackInteractions BOOLEAN TRUE

How to use the Test Project

  • Download test-project file to your machine
  • Note that in the scene component there are 2 ways of the DataDog tracker implementation:
  • BrightScript implementation (currently used)
  • SceneGraph implementation (commented inside the code)
  • Replace [application_id] with your application id
  • Replace [application_token] with your application token
  • Archive the project and run it on your device
  • Look in DataDog RUM application to see the view with one error in it

Data recieved by DataDog RUM application

Currently the application is sending a view event and one error event, both sharing same ids.

What you can see inside the error

  • date
  • country
  • application ID
  • application version
  • device model
  • device OS version
  • message
  • backtrace

License

This library is licensed under the Apache 2.0 License. See the LICENSE for details.

rokudatadog's People

Contributors

bogdanterzea avatar hsoerensen avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.