New Relic Open Source: Roku Agent

Roku Agent

The New Relic Roku Agent tracks the behaviour of a Roku App. It contains two parts, one to monitor general system level events and one to monitor video related events, for apps that use a video player).

Internally, it uses the Insights API to send events using the REST interface. It sends two types of events: RokuSystem for system events and RokuVideo for video events. After the agent has sent some data it will be accessible in Insights with a simple NRQL request like:

SELECT * FROM RokuSystem, RokuVideo

Requirements

Sending both system events and video events requires an Insights Pro subscription. Insights Free accounts permit only one event type per API key. If you are using an Insights Free account, you can enable only one type of Roku event capture at a time (system or video).

To initialize the agent you need an ACCOUNT ID and an API KEY.

The ACCOUNT ID indicates the New Relic account to which you would like to send the Roku data. For example, https://insights.newrelic.com/accounts/xxx. Where “xxx” is the Account ID.

To register the API Key, follow the instructions found here.

Installation

  1. Download the Roku Video Agent and unzip it. Inside the package you will find the following file structure:
components/NewRelicAgent/
	NRAgent.brs
	NRAgent.xml
	NRTask.brs
	NRTask.xml
source/
	NewRelicAgent.brs
  1. Open your Roku app project’s directory and copy the “NewRelicAgent” folder to “components” and "NewRelicAgent.brs" file to “source”.

Usage

To enable automatic event capture perform the following steps which are detailed below.

  1. Call NewRelic from Main subroutine and store the returned object.
  2. Right after that, call nrAppStarted (optional but recommended).
  3. Call NewRelicSystemStart and NewRelicVideoStart to start capturing events for system and video (both optional).
  4. Inside the main wait loop, call nrProcessMessage (only mandatory to capture system events, otherwise not necessary).

For examples, go to Github here (https://github.com/newrelic/video-agent-roku).

Support -

This Roku agent is supported by the developers here in this community thread, or alternatively you can ask questions in the Github Issues page (https://github.com/newrelic/video-agent-roku/issues). If you can fix the issue yourself, please do submit a pull request.

The full Roku Agent Readme and Repo can be found here