Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Updated the information as per PM
  • Loading branch information
adutta-newrelic committed May 26, 2025
commit 49387de7e24be859d93c22d30bc742076144aa93
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
title: 'Query entities & relationships via NRQL'
metaDescription: 'New Relic Advanced Compute customers leverage NRQL to directly query entity and relationship data within NRDB. This capability simplifies the correlation of this data with telemetry, leading to faster insights and a more comprehensive understanding of systems.'
freshnessValidatedDate: 2024-03-19
---

Understanding the intricate connections within your systems and quickly troubleshooting issues is crucial. If you're an Advanced Compute customer, you can now **directly query entity and relationship data within New Relic Database (NRDB) using the familiar New Relic Query Language (NRQL)**. This powerful capability allows you to seamlessly join this vital information with your telemetry data, all in one place.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a lot of repeated information in the first three paras. Merge and make more crisp.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's talk about this. Not comfortable with how it has shaped up.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Further questions:

  • how does this affect pricing
  • how quickly does change in my environment reflect here?
  • any perf implications


This document shows you how to leverage this unified data access to **gain comprehensive insights faster** and achieve a more holistic understanding of your environment. You'll explore how to:

* Access and query your entity and relationship data directly in NRDB.
* Simplify correlation between entities, their relationships, and associated telemetry.
* Utilize practical NRQL examples for common use cases, like correlating CPU usage with host attributes or tracking entity state changes over time.

### Comprehensive insights with Unified data access with NRQL
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this a title?


Are you looking to simplify how you understand your systems and troubleshoot issues faster? We've centralized your data by bringing entities and their relationships directly into NRDB. This means you can now use the power of NRQL to get a complete picture of your environment, all in one place.

Here's how you benefit:

* **Access all your entity data directly in NRDB:** You'll find that your entity and relationship data is now ingested and stored in NRDB. This creates a unified datastore, making it the central place for this critical information alongside your telemetry data.
* **Query with ease using NRQL:** You can use the powerful and flexible NRQL you're already familiar with to query this entity and relationship data. This simplifies your workflow, as you don't need to learn new query languages or perform complex joins across different data stores. Your queries become more straightforward and easier to manage.
* **Get timely insights with 24-hour data availability:** Wondering if the data will be there when you need it? This entity and relationship data is retained in NRDB for a 24-hour period. This availability allows you to perform timely analysis and correlation, so you can quickly retrieve the information needed to understand system behavior and identify dependencies.
* **Achieve a holistic view with simplified correlation:** You can now effortlessly link entities, their relationships, and your associated telemetry data (like metrics, events, logs, and traces). This improved correlation capability means you get a complete picture of your environment's health and performance, enabling you to troubleshoot issues more efficiently and gain faster insights.
82 changes: 82 additions & 0 deletions src/content/docs/nrql/nrql-examples/query-entities-via-nrql.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
---
title: 'NRQL query examples for entities & relationships'
metaDescription: 'Examples of NRQL queries for entities & relationships'
freshnessValidatedDate: 2024-03-19
---

Streamline your system analysis by using New Relic Query Language (NRQL) to directly query entity and relationship data. This approach replaces cumbersome manual processes for crucial tasks like correlating CPU performance with host attributes, viewing past entity states, or tracking configuration changes, offering faster insights into your complex environments.

To query this data, you'll need Advanced Compute; use the Entity event type (and Relationships or entityRelationships for relationship-specific queries).

Explore the practical NRQL solutions below to help you:


<CollapserGroup>
<Collapser
id="total-tx"
title="Correlate CPU usage with host attributes"
>

- **Objective**: An operations team needs to analyze CPU utilization for all production hosts located in a specific AWS region (e.g., 'eu-central-1') to identify potential performance bottlenecks.
- **Challenge**: This often required exporting host data and performance metrics separately and then using external tools or complex scripts to join and analyze them.
- **NRQL solution**:

```sql
FROM SystemSample
JOIN (FROM Entity SELECT id, name WHERE type = 'INFRA-HOST' AND `tags.aws.awsRegion` = 'eu-central-1')
ON entityGuid = id
SELECT average(cpuPercent) FACET name
```
</Collapser>

<Collapser
id="total-tx"
title="View entity state at a specific point in time"
>

- **Objective**: A developer is investigating an incident that occurred several hours ago and needs to know the exact configuration or state of a specific host (or container, application, etc.) at that particular point in time.

- **Challenge**: Obtaining a snapshot of an entity's attributes from a specific past timeframe was often not possible or required sifting through voluminous configuration logs, if available.

- **NRQL solution**: This query retrieves all available attributes for a specific entity (identified by its id) within a narrow one-hour window from seven hours ago.

```sql
FROM Entity
SELECT *
WHERE id = '<your_entity_id>'
SINCE 7 hours ago UNTIL 6 hours ago
LIMIT 1
```
</Collapser>

<Collapser
id="total-tx"
title="Tracking entity state changes"
>

- **Objective**: An SRE wants to understand how an entity's configuration or key attributes have changed over the last few hours, perhaps to see if a deployment or an automated process has altered its state as expected.

- **Challenge**: Tracking subtle changes in an entity's state over time was difficult and often involved manual comparisons or custom monitoring scripts.

- **NRQL solution**: This query fetches all recorded states for a particular entity within the last three hours, allowing for an audit of any changes.

```sql
SELECT *
FROM Entity
WHERE id = '<your_entity_id>'
SINCE 3 hours ago
```
</Collapser>

<Collapser
id="total-tx"
title="How to access entities & relationships"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Repetitive?

>

This feature is available to New Relic customers on Advanced Compute. These customers can begin querying entity and relationship data using the Entity event type

```sql
FROM Relationships o FROM entityRelationships
```
</Collapser>
</CollapserGroup>

This file was deleted.

10 changes: 6 additions & 4 deletions src/nav/nrql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ pages:
- title: Get started with NRQL
path: /docs/nrql/get-started/introduction-nrql-new-relics-query-language
- title: How to query with NRQL
path: /docs/nrql/get-started/introduction-nrql-how-nrql-works
path: /docs/nrql/get-started/introduction-nrql-how-nrql-works
- title: What to query with NRQL
path: /docs/nrql/get-started/query-entities-and-relationships-via-nrql
- title: NRQL charts and dashboards
path: /docs/nrql/get-started/charts-and-dashboards-with-nrql
- title: NRQL syntax
Expand All @@ -29,8 +31,6 @@ pages:
path: /docs/nrql/using-nrql/arrays-in-nrql
- title: Buckets
path: /docs/nrql/using-nrql/nrql-segment-your-data-buckets
- title: Querying via NRQL
path: /docs/nrql/using-nrql/query-entities-and-relationships-via-nrql
- title: Dimensional metrics
path: /docs/nrql/using-nrql/query-infrastructure-dimensional-metrics-nrql
- title: Facet results by time
Expand Down Expand Up @@ -62,4 +62,6 @@ pages:
- title: Browser/SPA NRQL examples
path: /docs/nrql/nrql-examples/browserspa-nrql-query-examples
- title: Mobile NRQL examples
path: /docs/nrql/nrql-examples/nrql-query-examples-mobile-monitoring
path: /docs/nrql/nrql-examples/nrql-query-examples-mobile-monitoring
- title: Query entities & relationships NRQL examples
path: /docs/nrql/nrql-examples/query-entities-via-nrql
Loading