Flexible retention: Define how long New Relic retains event data

Owners and data retention add-on managers

With flexible retention, you define how much Insights event data is retained by New Relic. This lets you keep only the data you need, as long as you need it.

You can control how much data is retained either in our UI or by API.

Requirements

To access this feature, you must be an account Owner or data retention add-on manager for for your account.

How it works

With flexible retention, you specify the data retention for different 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.

flex-2.png

Manage retention via the UI

If you're not familiar with GraphQL, you can easily manage your data retention in the UI, from 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.

Manage retention via API

If you're familiar with GraphQL, you can use the NerdGraph API to control your data retention. These 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
 }
}			

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.

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 Insights events 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 more information, see Included Insights events.

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.

Example: namespaces and flexible retention

Below shows the two event namespace examples and their default retention. Using flexible retention, you can override it by setting the new total retention which will update the “paid retention” portion of your retention - changing the total number of days that data is stored by New Relic and also your spend.

This example shows how an override can impact your usage.
This example shows how overriding your paid retention can impact your retention overall.

For more help

Recommendations for learning more: