The New Relic Roku Agent is designed to track the behavior of Roku applications, focusing on system-level and video-related events. It uses the Event API to send data via a REST interface, supporting five types of events:
- ConnectedDeviceSystem: System events
- VideoAction: Video events
- VideoErrorAction: Error events
- VideoAdAction: Ad events
- VideoCustomAction: Custom events
Prerequisites
To initialize the New Relic Roku Agent, you need:
- Your New Relic account ID
- Your New Relic .
Install and configure the Roku agent
Download the Roku Video Agent package and unzip it to access the following file structure:
components/NewRelicAgent/ NRAgent.brs NRAgent.xml NRTask.brs NRTask.xmlsource/ NewRelicAgent.brs
Copy the NewRelicAgent
folder to the components
directory and the NewRelicAgent.brs
file to the source
directory of your Roku app project.
Initialize the Agent: Open your main BrightScript file (e.g., Main.brs
). Initialize the New Relic Agent by calling the NewRelic
function with your ACCOUNT ID
, , APP NAME
, APPLICATION TOKEN
and ENDPOINT
.
**To configure the agent to use different endpoints based on the environment, you need to modify the main.brs file. The default configuration value is US, and it can be changed to EU or staging depending on the environment you want to use.
m.nr = NewRelic("ACCOUNT ID", "LICENSE KEY", "APP NAME", "APPLICATION TOKEN", "US", true)