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:
Here you can see an
accountId tag being used to filter workloads to a specific account.
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.
Tags are automatically applied to your monitored entities in some cases, from the following sources:
- New Relic account metadata
- Agent configuration
- 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.
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.
Go to one.newrelic.com and select a monitored entity, like a monitored app or host.
Near the entity's name at the top of the page, click on the tags button.
In the Add a new tag... field of the tags widget, add a tag with this format:
For APM agents, if you want to use those tags in NRQL queries, restart your service.
- Go to one.newrelic.com and select a monitored entity, like a monitored app or host.
- Near the entity's name at the top of the page, click on the tags button.
- Click the next to the tag you want to remove.
- 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 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:
- Go to one.newrelic.com.
- 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
Follow these best practices to get the most out of your tags.
Here are some examples of common ways to use tags to organize data.
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 v188.8.131.52 or higher
- Ruby v184.108.40.2062 or higher
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.ymlconfiguration file, such as:custom_attributes:internalOwningTeam: devops-sfservice: api-platform
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.