• /
  • EnglishEspañol日本語한국어Português
  • Log inStart now

Use tags to help organize and find your data

Tags are key-value pairs, for example team: operations, added to your monitored entities, or to your dashboards or workloads. We make some important attributes available as tags: this includes app metadata, like the app name and the language, and host metadata like the host name and the cloud provider region. You can also add your own custom tags.

You can use tags in the UI to filter down to relevant entities. Here's an example:

New Relic filtering workloads using tags

Here you can see an accountId tag being used to filter workloads to a specific account.

The benefits of tags

Tags help you:

  • Organize data coming from a large number of sources and/or to a large number of New Relic accounts.
  • Identify teams, roles, environments, or regions to know who's responsible for what. See some examples.
  • Better organize and search and workloads.
  • Query and chart APM data.

Tags are useful for organizing your data at a high level. If you want to add more fine-grained detail, like capturing user names or other high-cardinality values, we recommend using custom attributes or custom events.

Automatically reported tags

Tags are automatically applied to your monitored entities in some cases, from the following sources:

  • New Relic account metadata
  • Agent configuration
  • Host/environment
  • OpenTelemetry resource attributes

Tags from these sources can be removed or changed only by modifying the source of the tag, not via the UI or API.

You can also programmatically automate tags using our API, the New Relic CLI, or the New Relic Terraform provider.

Manage tags

Some important attributes are available by default to be used as tags. For example, the account name, the account ID, and some basic host and server metadata. You can't remove these available-by-default tags.

When you add tags via the UI or API, this occurs at the entity level. This means that, for example, if you have multiple APM agents monitoring a single entity and apply a tag via the UI, that tag is available for all data coming from that entity.

To change a tag name, you'll need to delete the current tag and create a new tag with the desired name.

Add tags

  1. Go to one.newrelic.com and select a monitored entity, like a monitored app or host.

  2. Near the entity's name at the top of the page, click on the tags button.

  3. In the Add a new tag... field of the tags widget, add a tag with this format: accountId: 123456789. Add tags in New Relic

  4. For APM agents, if you want to use those tags in NRQL queries, restart your service.

Remove tags

  1. Go to one.newrelic.com and select a monitored entity, like a monitored app or host.
  2. Near the entity's name at the top of the page, click on the tags button.
  3. Click the next to the tag you want to remove.
  4. For APM agents, if you want to use those tags in NRQL queries, restart your service.

Check out this short video on querying APM tags (3:20 minutes).

Use tags to filter your entities

New Relic advanced tag filter query

Use the filter bar on the entity explorer UI to filter down to specific entities.

You can filter by single or multiple elements and use advanced search options.

To filter down to certain entities using tags:

  1. Go to one.newrelic.com.
  2. Click the Filter by ... field to see a dropdown of available attributes and tags or enter a tag you want to filter by, such as accountId: 123456789.

Best practices

Follow these best practices to get the most out of your tags.

Tag examples

Here are some examples of common ways to use tags to organize data.

Custom queries, dashboards, and alerts

Different features handle tags differently. Here are some details about how you can use NRQL to query tag data, or create NRQL condition alerts.

Learn about how to use tags with dashboards and how to use tags with workloads.

Query and alert on APM tags

You can query tags using NRQL. These are the supported APM agents:

  • Go v2.3.0 or higher
  • Java v4.9.0 or higher
  • .NET v8.17 or higher
  • Node.js v4.13.0 or higher
  • PHP v10.0.0.312 or higher
  • Python v4.10.0.112 or higher
  • Ruby v6.1.0.352 or higher

Query and alert on infrastructure tags

You can query infrastructure tags with NRQL, also known as tag propagation, if they're created:

  • As custom attributes: By adding a section in your newrelic-infra.yml configuration file, such as:

    custom_attributes:
    internalOwningTeam: devops-sf
    service: api-platform

    Tip

    For more information, read about custom attributes.

  • In the New Relic UI: On the entity's infrastructure page, create a tag and assign it a value. To query these tags, you need to add the tags. prefix to the name of the tag when you're quering for it in NRQL.

If you want to turn off infrastructure tag propagation, which means that you won't be able to query them with NRQL, see how to turn it off with Nerdgraph.

Query examples

Query and alert on attributes

Some important attributes are used as tags. You can query all attributes and create custom charts using NRQL, and create NRQL alert conditions.

Copyright © 2024 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.