Event data retention

New Relic products report a wide range of event data. Different products have different data retention periods, and different ways to extend event data retention. You can customize the length of your event data retention through flexible event retention.

Overview of event data retention

All New Relic product subscriptions come with a certain level of data retention that governs how long different types of data are retained. One type of data governed by data retention rules is event data. Event data is available in some UI charts and tables, and also available for querying via NRQL, our querying language.

There are events reported from products by default, and there are custom events: each have their own retention rules, depending on the product and subscription level.

Here are some examples of how different product subscriptions can affect event data retention:

  • Free/Lite APM subscription: default-reported events available for 1 day. No custom events available.
  • Pro APM subscription: default-reported events available for 8 days. Custom events available for 1 day (and able to be extended with Insight Pro).

To see your New Relic subscriptions, go to the Account summary page.

Extend your event retention

Product Method
APM, Browser, and Mobile Event data retention can be extended with a paid subscription to these products (see product data retention). To extend retention of both default-reported events and custom events further, you need an Insights Pro subscription.
Infrastructure Event data retention can be extended with a paid Infrastructure subscription. See Infrastructure data retention rules.
Synthetics Event data retention can be extended with a paid Synthetics subscription. See Synthetics data retention rules.
Custom events Custom events reported by agent APIs or the Event API: Extension requires an Insights Pro subscription.

Insights Pro

A paid Insights subscription is what governs the extension of event data retention for:

  • Our APM, Browser, Mobile, and Serverless products
  • Custom events that come from an agent API or from the Event API

Note that having an Insights Pro subscription doesn't require use of the Insights UI (insights.newrelic.com) to query your data: there are other querying options available.

To see the data retention governed by your Insights subscription, go to: rpm.newrelic.com > Account dropdown > Account settings > Usage > Event data retention.

With an Insights Pro subscription, you can use flexible retention to customize how your event data is retained. This lets you keep only the data you need, for as long as you need it.

How number of events stored is calculated

This is an explanation of how the number of stored events are calculated by default for an Insights Pro subscription. (Note that with flexible retention, you have more fine-grained control over the retention period.)

The events stored is calculated based on 1) total events stored over time (calculated based on the events generated per week) and 2) the weeks of data retention available. This equation can be represented like this:

    events stored = (events generated per week) * (weeks of retention)
    

An Insights Pro subscription provides a given number of weeks of data retention as well as a given number of events over that retention period.

For example:

  • (200M transactions per week) * (4 weeks of retention) = 800M events stored in Insights
  • (16M transactions per week) * (50 weeks of retention) = 800M events stored in Insights

For Insights Pro subscriptions, data is purged based on retention window, not volume. It is deleted from the system once it's past the retention window.

For example: If your Insights license is for 800 million events with a 4 week retention period, your data would start being purged after it is older than four weeks. Temporary spikes in data exceeding your subscription level will still be recorded, but consistent overage should be solved by upgrading your subscription level or decreasing data collected.

For customers without an Insights Pro subscription, New Relic may throttle or downsample events to a limit of not more than than 4,000 events per host per minute.

Insights Pro event overage example

In this example, you have an Insights Pro subscription with a license for 800 million events over 4 weeks, a rate of 200 million events per week. You have APM Pro, Browser Pro, and Mobile Enterprise. A fifth week of data is added via your subscriptions, bumping you to a total of 1 billion events stored within your plan:

  • If you are using 975 million events, you are not over your retention.
  • If you are using 1.25 billion events, you are over your retention.
Disable/enable Transaction and Pageview event reporting

Owners or Admins

The Insights Data summary UI page is used to see the types of events being reported. You can also use this page to enable and disable the reporting of PageView and Transaction events.

To view Data summary:

  1. Go to insights.newrelic.com > Manage data.
  2. Select the Summary tab.

Note: if you disable PageView or Transaction event reporting, this can affect some New Relic UI elements. You may see some empty charts on some UI pages that rely on this data.

  1. Go to insights.newrelic.com > Manage data > Summary.
  2. From the Summary tab, select Configure data sources.
  3. Toggle the appropriate switch on or off, then save.

Toggling Transaction on or off will cause reporting agents to restart themselves.

For more about configuring event reporting, see Event data retention.

Flexible data retention

With an Insights Pro subscription, you get access to flexible retention, which lets you define how some types of event data are retained. This lets you keep only the event data you need, for as long as you need it. You can manage your flexible retention through the UIor through our GraphQL API.

Requirements to use this feature:

How it works

To understand how standard event data retention works, first read Event data retention.

With flexible retention, you specify the data retention for applicable event namespaces across your accounts. This gives you per-event namespace control of your data. The retention that you specify for an event namespace will be shared by all the event types under that namespace. If some namespaces are not relevant to you, you can avoid collecting their event data entirely.

Your retention value can’t be lower than the included retention or higher than the default retention.

You can control data retention either in our UI or by API.

flex-2.png
Manage retention via UI

You can control data retention either using our GraphQL API or in the UI.

To do this with the UI, go to Account Settings > Usage > Data management section. Your retention changes take effect within 24 hours after updating.

Want a demo of how the UI works? Check out our videos for UI overview and assigning a role.

Flex retention is found in the account usage UI.
Go to rpm.newrelic.com > (account dropdown) > Account settings > Usage > Data management section: you can view your current retention plans, modify them, and perform overrides, all in the UI.
Master and sub-accounts

When it comes to master and sub-accounts with flexible retention, be aware of the following:

Feature Description
Account inheritance

Retention set for a master account is inherited by all sub-accounts, unless a sub-account has its own custom retention override.

Switch between accounts

You can toggle between your master and sub-accounts by using the Account switcher in the data retention UI.

Moving sub-accounts

If a sub-account is moved to another master, it will adopt the retention settings of the new master account it’s under. However, if the sub-account has its own custom retention override, it’ll persist and ignore the current retention of its master account.

Copy retention values from one sub-account to other sub-accounts From within a sub-account, select Copy retentions and use that sub-account as a source or template to apply those same namespace retention values to one or more other destination or target sub-accounts. Note: Source and destination sub-accounts must all be under the same master account.
Glossary

To understand the terms used with flexible retention, see the following:

Term Description

Event namespace

An event's namespace corresponds to one or more event types that share a single data retention value. For more information, see Event namespaces (types). You can also use NerdGraph to get the list of customizable event namespaces.

Retention value

The number (in days) that specifies how long your event data is stored.

Retention rule

The event namespace and retention value pair that you specify to override the current retention.

Licensed retention

Retention period that’s determined in weeks by your Insights Pro subscription contract.

Included retention

Retention period for which your data is stored but not charged under the Insights Pro subscription. For details, see the data retention details for a specific product.

Paid retention

Retention period for which your data is stored and is charged under the Insights Pro subscription. By default, your licensed retention determines this value but Flexible retention lets you override it.

Default retention

Retention period that comes out of the box. This is based on the total of included retention plus licensed retention.

Manage flexible retention via API

You can control data retention with either NerdGraph (our GraphQL API) or in the UI.

The following API examples show how to alter data retention via the NerdGraph GraphiQL explorer.

Your retention changes take effect within 24 hours after updating.

List customizable retention event namespaces

To list the customizable retention event names spaces for your account, go to api.newrelic.com/graphiql and run the following:

query {
 actor {
   account(id: YOUR_ACCOUNT_ID) {
     dataManagement {
       customizableRetention {
         eventNamespaces {
           namespace
         }
       }
     }
   }
 }
}
List active rules on an account

To list active rules on an account, go to api.newrelic.com/graphiql and run the following:

query {
 actor {
   account(id: YOUR_ACCOUNT_ID) {
     dataManagement {
       eventRetentionRules {
         id
         deletedAt
         deletedById
         createdAt
         createdById
         retentionInDays
         namespace
       }
     }
   }
 }
}
Show active rule on an account/namespace pair

To show the active rule on a specific account/namespace pair, go to api.newrelic.com/graphiql and run the following:

query {
 actor {
   account(id: YOUR_ACCOUNT_ID) {
     dataManagement {
       eventRetentionRule(namespace: "APM") {
         id
         deletedById
         deletedAt
         createdById
         createdAt
         retentionInDays
         namespace
       }
     }
   }
 }
}
Create a new rule

To create a new rule, go to api.newrelic.com/graphiql and run the following:

mutation {
 dataManagementCreateEventRetentionRule(accountId: YOUR_ACCOUNT_ID, namespace: "APM", retentionInDays: 8) {
   id
   deletedById
   deletedAt
   createdById
   createdAt
   retentionInDays
   namespace
 }
}
Delete an existing rule

If you delete a rule applied to a sub-account, that sub-account will adopt the current retention value of its master account for the given namespace. If you delete a rule applied to a master account, the default retention value will re-apply for the given namespace. To delete an existing rule, go to api.newrelic.com/graphiql and run the following:

mutation {
 dataManagementDeleteEventRetentionRule(accountId: YOUR_ACCOUNT_ID, namespace: "APM") {
   id
   deletedById
   deletedAt
   createdById
   createdAt
   retentionInDays
   namespace
 }
}			
Copy existing sub-account rules to other sub-accounts

You can specify a sub-account to be the template or source account, and have other destination sub-accounts adopt the same namespace retention values of the source sub-account. Note: all sub-accounts must be within the same master account. To copy an existing set of retentions, go to api.newrelic.com/graphiql and run the following:

mutation {
  dataManagementCopyRetentions(
    sourceAccountId: SOURCE_ACCOUNT_ID,
    destinationAccountIds: [DESTINATION_ACCOUNT_ID_1, DESTINATION_ACCOUNT_ID_2, DESTINATION_ACCOUNT_ID_3])
  {
    success
    failure
  }
}

Success and failure will return lists of destination account ids which were successful (or failed) in copying rules from the source account.

For more help

For details about the data retention of other products or integrations, see that specific documentation.

Recommendations for learning more: