Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
---
title: Blocks in notebook
tags:
- Query your data
- Explore and query data
- Notebooks
- NRQL
metaDescription: 'Learn about notebook blocks, active blocks, action toolbars, and how to add and manage query blocks in your New Relic notebooks.'
freshnessValidatedDate: never
---

Query blocks are the core component of notebooks, allowing you to write NRQL queries and visualize the results directly within your document. You can add multiple query blocks to a single notebook to build a comprehensive data story.

## Active block

The active block is the currently focused, interactive unit within your notebook. It serves as your immediate workspace for writing code, running queries, or adding documentation.

The active block is immediately visible, making it easy to spot within your notebook. It is identified by two key visual cues:
* **Clear Borders**: The active block is highlighted with a distinct, clear border color.
* **Visible Toolbar**: It is the only cell that displays the actions.

Queries coming from Data Explorer are added to the active block if the active block is of type query. If the active block is currently markdown, a new query block is added.

To change an active block you need to select or add another block in the notebook.
Copy link
Contributor

Choose a reason for hiding this comment

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

What does this mean? Not sure what we are trying to say here?
Also, how do you make a block "not active"?


When a Markdown Block is active, it automatically enters an editing mode featuring a convenient two-column layout to optimize your documentation workflow:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
When a Markdown Block is active, it automatically enters an editing mode featuring a convenient two-column layout to optimize your documentation workflow:
When a Markdown Block is active, it automatically enters editing mode featuring a two-column layout:

* **Editing Column (Left)**: This is where you directly type and format your Markdown code.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* **Editing Column (Left)**: This is where you directly type and format your Markdown code.
* **Editing Column (Left)**: This is where you type and format your Markdown code.

* **Live Preview Column (Right)**: This instantly displays a real-time visual preview of your formatted documentation, ensuring accuracy as you type.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* **Live Preview Column (Right)**: This instantly displays a real-time visual preview of your formatted documentation, ensuring accuracy as you type.
* **Live Preview Column (Right)**: This displays a real-time visual preview of your formatted documentation.


## Action toolbar

To help you optimize your workspace and maintain a clean view, the notebooks interface features an action toolbar. It consolidates core query actions into a compact, icon-based menu and groups secondary controls into a dedicated Actions Menu.
Copy link
Contributor

Choose a reason for hiding this comment

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

Delete this. No valuable information here.


### Core actions (Top of the Query block)

These essential, frequently used actions are directly accessible at the top of the query block via intuitive icons:
Copy link
Contributor

@vpayyapilly vpayyapilly Nov 6, 2025

Choose a reason for hiding this comment

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

Suggested change
These essential, frequently used actions are directly accessible at the top of the query block via intuitive icons:
These essential, frequently used actions are accessible at the top of the query block:

* **Run query**: This is now represented by a play icon and executes the current query.
* **Recent queries**: Allows you to quickly access and reuse recently executed queries.
Copy link
Contributor

Choose a reason for hiding this comment

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

How many queries will it list out? How do we define "recent".....by number or by days?

* **Recommended queries**: Provides suggestions for queries.
* **Copy query link**: Generates a shareable link to the current query.

### Actions Menu (Secondary controls)

The Actions Menu houses additional, less frequently used, or organizational controls to keep your main toolbar uncluttered.
Copy link
Contributor

Choose a reason for hiding this comment

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

"houses" will not translate properly.

Suggested change
The Actions Menu houses additional, less frequently used, or organizational controls to keep your main toolbar uncluttered.
The Actions Menu houses additional, less frequently used, or organizational controls.

* **Add another query**: Inserts a new, empty query block into your notebook.
* **Remove query**: Deletes the query from multi-query TIMESERIES.
* **PromQL translator**: A utility for translating queries into PromQL (Prometheus Query Language).
* **Clear**: Removes the query from the query input.
* **Create alert**: Initiates the process for setting up a new alert based on the query results.
* **Move up/down/to the top/to the bottom**: Reorganizes the current query block's position within the notebook.
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 useful? Do the queries run in sequence?

* **Delete block**: Deletes the active block.

## Add a query block

To add a query block to your notebook:

1. Open your notebook in the query console.
2. Click the **+ Query** button or press **Ctrl+Enter** (or **Cmd+Enter** on Mac) to add a new query block.
Copy link
Contributor

Choose a reason for hiding this comment

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

We never say "click the blah button".....just "click blah"

3. Write your [NRQL query](https://docs.newrelic.com/docs/nrql/nrql-syntax-clauses-functions/) in the query editor.
4. Press **Run** or **Enter** to execute the query and display results.

<Callout variant="tip">
All NRQL queries supported in the standard query builder work in notebook query blocks. You can query any data type including metrics, events, logs, and traces. All [chart types](https://docs.newrelic.com/docs/query-your-data/explore-query-data/use-charts/chart-types/) and customizations available in the standard query builder are supported in notebooks.
</Callout>

## Use variables in queries

Variables make your notebooks dynamic and reusable. You can define variables once and reference them across multiple query blocks.

### Define variables

```sql
-- Define a variable at the top of your notebook
{{timeRange = "1 hour ago"}}
{{appName = "MyApplication"}}
```

### Use variables in queries

```sql
SELECT count(*) FROM Transaction
WHERE appName = '{{appName}}'
SINCE {{timeRange}}
```

<Callout variant="important">
Variables are scoped to the entire notebook and can be referenced in any query block within the same notebook.
</Callout>

## Query block management

<CollapserGroup>
<Collapser
id="duplicate-query-block"
title="Duplicate a query block"
>

1. Hover over the query block.
Copy link
Contributor

Choose a reason for hiding this comment

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

Not hover...."place your mouse pointer"

2. Click the **three-dot menu** in the top-right corner.
3. Select **Duplicate**.

</Collapser>

<Collapser
id="move-query-blocks"
title="Move query blocks"
>

Reorder your query blocks to improve your narrative flow:

1. Hover over the query block.
2. Click the **three-dot menu**.
3. Select from:
* **Move up**
* **Move down**
* **Move to top**
* **Move to bottom**

</Collapser>

<Collapser
id="delete-query-block"
title="Delete a query block"
>

1. Hover over the query block.
2. Click the **three-dot menu**.
3. Select **Delete**.
4. Confirm the deletion.

</Collapser>
</CollapserGroup>

## What's next?

* Return to [Get started with notebooks](/docs/query-your-data/explore-query-data/notebooks/introduction-notebooks) for an overview
* Explore [Dashboards](/docs/query-your-data/explore-query-data/dashboards/introduction-dashboards) for building persistent data visualizations
* Learn more about [Chart types](/docs/query-your-data/explore-query-data/use-charts/chart-types) for visualization options
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
---
title: Create data-driven documents with notebooks
tags:
- Query your data
- Explore and query data
- Notebooks
metaDescription: 'Use New Relic notebooks to create structured, data-driven documents that combine queries, visualizations, and descriptive text into shareable assets for investigations, post-mortems, and analytical insights.'
freshnessValidatedDate: never
---

<Callout title="Preview feature">
We're still actively developing notebooks, but we're excited for you to try this powerful new feature! This feature is currently provided as part of a preview program pursuant to our [pre-release policies](/docs/licenses/license-information/referenced-policies/new-relic-pre-release-policy/).
</Callout>

When investigating complex issues or sharing insights with your team, you often find yourself jumping between different tools, copying queries, taking screenshots, and struggling to maintain context as you piece together a complete story from your data. Traditional dashboards are great for monitoring, but they fall short when you need to document investigations, create detailed post-mortems, or build step-by-step analytical workflows.

Notebooks solve this problem by providing a dynamic and organized way to tell a complete story with your data. They are structured, data-driven documents that let you combine queries, visualizations, and descriptive text into a single, shareable asset, eliminating the need to switch between multiple tools or lose important context during your analysis.

## Use cases

Use notebooks to streamline your workflow and turn raw data into actionable stories:

* **Query, analyze, and visualize data**: Seamlessly query all your observability data (logs, metrics, events) and create visualizations to gain a better understanding of your system's performance.
* **Create post-mortems and incident documents**: Collaborate with your team to document investigations and create a clear, reusable record for incident post-mortems and root cause analysis.
* **Build reusable workflows and runbooks**: Create and share step-by-step guides for complex analysis, using variables to ensure consistent and repeatable processes.
* **Add context and narrative**: Use Markdown to easily add detailed titles, notes, and explanations to your queries and charts, transforming disconnected data points into a cohesive story.
* **Stay in one place, unifying your data**: Seamlessly query your observability, security and business data without switching between different tools or tabs with the power of New Relic Lens.

## How notebooks work

Notebooks are built using individual blocks that you can arrange and rearrange to tell your data story. This modular approach gives you complete flexibility to create everything from simple queries with context to complex analytical workflows.

### The building blocks

Every notebook is composed of different types of blocks:

* **Query blocks**: Run [NRQL queries](https://docs.newrelic.com/docs/nrql/nrql-syntax-clauses-functions/) and display visualizations using any of the available [chart types](https://docs.newrelic.com/docs/query-your-data/explore-query-data/use-charts/chart-types/)
* **Text blocks**: Add context, explanations, and documentation using Markdown formatting
* **Variables**: Create dynamic, reusable parameters that work across multiple blocks in the same notebook

### Interactive workflow

As you build your notebook, you can:

* **Edit blocks in real-time**: Click on any block to make it active and start editing
* **Organize your story**: Duplicate, move, or delete blocks to create the perfect narrative flow
* **Collaborate seamlessly**: Share your notebook with your team and work together on investigations

This flexible structure means you start with a simple query and gradually build a comprehensive document that captures your entire analytical process.

## Notebook blocks

Blocks are the fundamental building units of a notebook. They are individual sections you add to structure your analysis and narrative.

### Query blocks

Use query blocks to write [NRQL queries](/docs/nrql/nrql-syntax-clauses-functions/) and visualize the results. All single query [chart types](https://docs.newrelic.com/docs/query-your-data/explore-query-data/use-charts/chart-types/) and customizations available in the standard query builder are supported in notebooks.

### Text blocks

Use Markdown to add rich text, titles, context, explanations, and descriptive text to tell the story of your investigation.

### Block actions

Every block can be manipulated to organize your document:

* **Duplicate**: Create a copy of the block
* **Delete**: Remove the block from your notebook
* **Move Up/Down**: Reorder blocks within your notebook
* **Move to Top/Bottom**: Quickly move blocks to the beginning or end

## Notebooks permissions

Before you start creating notebooks, it's important to understand how permissions work and who will have access to your notebooks.

### Organization association

Every notebook is a resource that belongs to the organization in which it was created. This association is permanent. If the organization is deleted, the notebook is deleted as well.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can a notebook be moved between orgs or shared?


### Current permissions model

<Callout variant="tip">
Notebooks currently do not have granular permission settings. Anyone in the organization who has access to the feature can create new notebooks, edit and delete existing ones. We are working on introducing granular permissions allowing users to decide who within the organization sees, edits and deletes particular notebooks.
Copy link
Contributor

Choose a reason for hiding this comment

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

Do not mention what features we are working on for the future.

</Callout>

**Current capabilities:**
* All organization members with notebooks access can view all notebooks
* All organization members with notebooks access can create, edit, and delete any notebook
* Notebooks are automatically shared across your entire organization

**Coming soon:**
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove this list

* Owner-based permissions (only creators can edit/delete)
* Read-only sharing options
* Team-based access controls

## Get started with notebooks

Now that you understand how notebooks work and their permissions model, you're ready to start creating and managing your own notebooks.

### Access notebooks

To access notebooks:

1. Go to **[one.newrelic.com](https://one.newrelic.com)**.
2. Open the **Query your data** console from the drawer at the bottom of the page.
3. Click on **Notebooks** in the query builder header to see a list of all notebooks created by your organization.
Copy link
Contributor

Choose a reason for hiding this comment

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

We never say "click on" for anything. There another instance in this article where u use this construct. It is always just "click"


<img
title="Navigate to notebooks from query your data"
alt="Screenshot showing how to navigate to notebooks from the query your data drawer"
src="/images/notebooks-navigation.webp"
/>

<figcaption>
Navigate to notebooks by going to **Query your data > Notebooks**
</figcaption>

<CollapserGroup>
<Collapser
id="create-notebook"
title="Create a notebook"
>

You have two simple ways to start a new notebook:

### Start from the notebooks index

1. Select the **+ Create a notebook** button at the top-right corner of the index.
Copy link
Contributor

Choose a reason for hiding this comment

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

You cannot select a button. You always click it.

2. Give your notebook a meaningful name (names are searchable, so use relevant keywords like your service or application name).
3. Press **Create**.
Copy link
Contributor

Choose a reason for hiding this comment

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

What is Press? C'mon Chinmay.....focus man

4. The query console drawer opens. Type your first query!
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 step?


### Start from the query console

1. Open the query console (the drawer at the bottom of the platform).
2. Create your desired queries and Markdown blocks.
3. Press the **Save** button.
Copy link
Contributor

Choose a reason for hiding this comment

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

Review all your procedures for actions on UI elements. These don't follow style guide recommendations.

4. Name your notebook, and press **Save**.

</Collapser>

<Collapser
id="manage-notebooks"
title="Manage your notebooks"
>

### Search and sort notebooks
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need this? This is regular behavior. Why are we writing about it unless there is something special here.


To find specific notebooks in your organization:

1. **Search by name**: Use the search bar at the top of the notebooks index to find notebooks by name or keywords.
2. **Sort notebooks**: Click the sort dropdown to organize notebooks by:
* Name (A-Z or Z-A)
* Last modified date (newest or oldest first)
* Created date (newest or oldest first)
* Favorites (starred notebooks appear first)
3. **Filter by favorites**: Click the star filter to show only your favorite notebooks.

### Duplicate a notebook
Copy link
Contributor

Choose a reason for hiding this comment

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

When u duplicate a notebook, does it ask for org information or anything? Is it duplicated in the same org as the orginal one? What is the benefit? I am guessing we should approach this from the angle of templates.


1. Open the notebook you want to duplicate.
2. Click the arrow next to the tab name in the console drawer and click on **duplicate**.
3. Click **Duplicate** from the context menu.
4. A copy of the notebook will open in a new tab, ready for editing.

### Mark a notebook as favorite

To quickly find your most important notebooks, you can mark them as a favorite:

1. Click the star icon next to a notebook's name in the index page.
2. The icon will turn yellow, and the notebook will be grouped at the top of the index list.
3. Click the star icon again to remove it from your favorites.

</Collapser>

<Collapser
id="delete-notebook"
title="Delete a notebook"
>

<Callout variant="caution">
Copy link
Contributor

Choose a reason for hiding this comment

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

Can a deleted notebook be retrieved?

A notebook will remain saved in the system until it is explicitly deleted by following these steps.
</Callout>

1. On the notebook index list, click the three-dot action menu for the notebook you wish to delete.
2. Select the **Delete** option.
3. Confirm the deletion by selecting **Delete** again.

</Collapser>
</CollapserGroup>

## What's next?

Now that you understand the basics of notebooks, you can:

* Learn more about [blocks in notebook](/docs/query-your-data/explore-query-data/notebooks/add-queries-to-notebooks)

You can also explore related features:
* [Dashboards](/docs/query-your-data/explore-query-data/dashboards/introduction-dashboards) for building persistent data visualizations
* [Query builder](/docs/query-your-data/explore-query-data/query-builder/introduction-query-builder) for creating individual queries
* [Charts](/docs/query-your-data/explore-query-data/use-charts/use-your-charts) for understanding visualization options
Loading
Loading