Skip to content
Sign in

How-to

Send results to New Relic

Updated

On this page

About 5 minutes.

Connect your own New Relic account and Zof sends every completed test run there as events you can query, shows them on a dashboard it creates in your account, and tags them with the APM application you pick. New Relic is in early access: Zof turns it on for your company on request.

Before you start

Zof needs two New Relic keys for one account:

  • An ingest license key, which lets Zof send events. In New Relic it is listed under API keys with the type INGEST - LICENSE.
  • A user key, which lets Zof check that the events arrived, list your APM applications and manage its one dashboard. It starts with NRAK- and can do whatever its New Relic user can do.

Give Zof the narrowest access New Relic offers:

  • Create a dedicated New Relic user for the integration, with access to this one account only, and make the user key as that user.
  • On a Pro or Enterprise plan, give that user a custom role that can only query data and manage dashboards.

Zof only ever calls the queries it needs for the steps on this page.

Connect New Relic

  1. A company admin opens Integrations › New Relic.
  2. Pick the Region: EU if you sign in to New Relic at one.eu.newrelic.com, else US.
  3. Enter the Account ID, the Ingest license key and the User key. The page checks each one's shape as you submit.
  4. Choose Connect New Relic.

Zof checks that the user key can see the account, sends one test event with the license key, waits for New Relic to index it, and creates a dashboard named "Zof test results". If a check fails, the page says which one and Zof stores nothing.

The keys are encrypted as soon as they reach Zof. The page never shows them again, only their last four characters.

Tag results with an APM application

Under What Zof sends, pick the APM application the results belong to, or None. To tag one repository's runs with a different application, choose Add override, enter the repository and pick its application. Choose Save settings.

The tag is the application's name and entity GUID, stored as Zof's own attributes. Zof does not link results to traces: it records no trace IDs, so it doesn't claim a link it can't prove.

What Zof sends

One ZofTestRun event for each completed manual or scheduled run: its name, number, link back to Zof and a link to run it again, the repository, commit and environment when known, the outcome, the code review's state, finding counts by severity (only when the review completed), test counts, timings, and your APM tag.

Up to 50 ZofFinding events for each run, most severe first: severity and category, a link to its run in Zof, plus:

  • the finding's title, with secrets redacted, while Send finding titles is on (it is on to start);
  • the file path and line, while Send file paths is on (it is off to start).

Zof never sends agent output, logs, evidence or prompts. Runs that finished before you connected are not sent.

The Zof dashboard

The dashboard has three pages:

  • Overview: a Run a test table first, then the last 7 days. Runs, pass rate, runs with issues, and critical and high issues; results and run time over time; and a table of the latest runs.
  • Issues: the last 7 days. Issues by severity over time, the top issue types, issues by repository, and the latest critical and high issues.
  • Repositories and tests: the last 30 days. Each repository, pass rate by kind of testing, scheduled runs that didn't pass, the slowest runs, runs per APM application and the connection tests.

Run a test has one row for each kind of testing and repository Zof ran in the last 30 days, with its environment, last result and when it last ran. Its Run link opens Zof's Run again page with that test's last settings filled in. The Latest runs table has a Run link for each run too, next to an Open link that opens the run in Zof. The slowest runs and the latest critical and high issues have an Open link to their run. On the Run again page you check the settings, see the cost and start the run in Zof. Nothing starts from inside New Relic.

Zof upgrades an existing dashboard to this layout within an hour, but only while its pages and widgets are still the ones Zof made. If you added, removed or changed a widget, Zof leaves the dashboard as it is. To take the new layout anyway, choose Repair dashboard: it replaces the whole dashboard, so your changes are lost. To keep your own version for good, remove "Managed by Zof" from the dashboard's description, and Zof never changes it. The upgrade doesn't recreate a dashboard you deleted (Repair dashboard does).

Check the connection

The connection card on the same page says where things stand:

  • Checking: the keys were accepted and Zof is confirming New Relic indexed the test event. This can take a few minutes.
  • Connected: the keys work, New Relic indexed an event from Zof, and the dashboard exists.
  • Needs attention: an event wasn't confirmed in New Relic, or the dashboard is missing. The card lists what went wrong.
  • Reconnect required: New Relic stopped accepting a key.

Send test event sends one more test event. Open dashboard opens Zof's dashboard in New Relic. Repair dashboard creates it again if it was deleted, or restores its layout. Zof only changes the dashboard it created.

Rotate the keys

Make the new keys in New Relic, then choose Reconnect and enter them. Zof checks them the same way as a first connection. Revoke the old keys in New Relic afterwards. If you revoke a key first, the card shows Reconnect required: within the hour for the user key, and at the next send for the ingest license key. Zof holds results until you reconnect.

Disconnect

Choose Disconnect. Zof stops sending results and forgets both keys. Events already in New Relic stay there; New Relic doesn't let anyone delete them. The dashboard stays too, unless you tick Also delete the Zof dashboard.

Check that it worked

  1. The card says Connected.
  2. In New Relic, open the query builder and run SELECT * FROM ZofConnectionTest SINCE 1 day ago. You see Zof's test event.
  3. After your next completed run, SELECT * FROM ZofTestRun SINCE 1 day ago shows it, and the dashboard lists it.

Next steps