Notebooks

Latest Dynatrace

With Notebooks Notebooks, you can create powerful, data-driven documents for custom analytics.

Notebook capabilities

Notebooks are your go-to place for data exploration.

  • Custom analytics

    Query, analyze, and visualize all your observability data such as logs, metrics, and events powered by Grail.

  • Extract fields

    Use the DPL Architect tool to extract additional typed fields from the data in Grail.

  • Collaborate

    Create and collaborate on interactive, data-driven, and persistent documents.

  • Fetch external data

    Fetch and incorporate external data by running Dynatrace functions.

  • Give context

    Annotate and add context with markdown.

Notebook sections

Notebooks can consist of multiple sections:

  • Explore: explore your logs, metrics, and business events with our point-and-click interface.
  • Query: displays data queried via Grail.
  • Code: display data returned by code executed via Dynatrace functions.
  • Markdown: static content edited in markdown.

Explore sections

You can use the Explore options to explore your logs, metrics, and business events with our point-and-click interface. With zero knowledge of DQL or coding, you can create and start using notebook sections in minutes.

For more information, we have a whole Explore data page that shows you how to create Explore sections.

Query section

The query sections allow you to easily query data from Grail and visualize the result in different ways.

Query section

The query section consists of a query input where you can write a DQL query. In the query input, use Ctrl+Space to trigger autocompletion at any time.

You can control the timeframe for the query via the timeframe dropdown list. If the timeframe is defined in the query itself, the dropdown list is disabled.

Code section

The code section enables you to fetch data for your notebook using Dynatrace functions.

Code section

Markdown section

A markdown section can be anything from a minor note about something on the dashboard to a whole page of formatted information with links and pictures.

Easy to edit:

Markdown section: edit

Attractive to look at:

Markdown section: display

To insert queries from your notebook with autocomplete, use Ctrl+Space.

Add links

You can link to other places in your notebook and elsewhere.

A link in Markdown is a label and link of the form [label](address), where:

  • The label is freeform text to display on the link in your Markdown tile or section
  • The address specifies what to open when someone selects the link, such as a website or a Dynatrace app
Link toSyntax and examples

Website

[My label](https://www.example.com/)

Notebooks app

[My label](/ui/apps/dynatrace.notebooks/notebooks)

Specific notebook

Syntax:

[label](ui/apps/dynatrace.notebooks/notebook/<notebookid>

Example:

[My label](ui/apps/dynatrace.notebooks/notebook/274edae4-dfe8-41fb-aced-5020fb1270bc

To get the address

  1. Display the target notebook.
  2. Copy everything on the browser address line starting from ui/.
  3. Paste it into your Markdown as the address of a link.

Specific notebook section

Syntax:

[label](ui/apps/dynatrace.notebooks/notebook/<notebookid>#<sectionid>

Example:

[My label](ui/apps/dynatrace.notebooks/notebook/274edae4-dfe8-41fb-aced-5020fb1270bc#cb69caf1-52ed-4e73-8a3e-120e8cd7e8f8

To get the address

  1. Display the target notebook.
  2. Select the target section of the notebook.
  3. Copy everything on the browser address line starting from ui/ and paste it into your Markdown as the address of a link.

Create a notebook

To create a new notebook

  1. In the Dynatrace Launcher, select Notebooks Notebooks.

    The Notebooks app starts.

  2. Select the in the app header. New notebooks are always blank and created as drafts. Drafts are not saved automatically. To save a notebook, select Save in the application header.

Davis CoPilot

To create a notebook section using Davis CoPilot to translate your natural language questions into DQL queries

  1. Go to Notebooks Notebooks and open or create a notebook you can edit.

  2. Open the Add menu and select Davis CoPilot. A new Davis CoPilot notebook section is created with an empty prompt box.

  3. In the prompt box, type a prompt. Try average cpu usage percentage by host or see the examples displayed in the web UI for inspiration.

  4. optional If your prompt doesn't specify the timeframe, you can still specify it in your section header. The default is Last 2 hours.

  5. Select Run. Davis CoPilot generates and runs the query for you.

    optional If you want to see the generated query before running it, open the menu next to the Run button and select Generate DQL only.

  6. Review the results.

    • You can review the query by expanding DQL on the right.
    • optional You can't edit the query directly in CoPilot, but you have two options for reusing it:
      • Copy the query and paste it elsewhere manually.
      • Open the menu in the section header and select Create DQL section to create a DQL section from this query.
    • You can edit your original prompt, regenerate the query, and run it to update the results.
      If you select Rerun sections, the Notebooks app will first check if any prompts have been edited.
      • If a prompt has been edited, the DQL will first be regenerated and then run.
      • If no prompts have been edited, the existing generated DQL will simply be run.
  7. optional Select the Options in the section header to change the visualization (refer to the visualization-specific documentation for more information).

    To have Dynatrace automatically select a visualization for your query, turn on Auto select in the upper-right corner of your visualization settings pane.

    • If you manually select a different visualization, the Auto select switch will turn off.
    • To have Dynatrace once again automatically select a visualization, turn Auto select back on.

Explore logs, metrics, and business events

The Explore sections offer the easiest way to get started.

  • To dive right in, just display a notebook, open the Add menu, and select Logs, Metrics, or Business Events.
  • To learn more about Explore sections first, see Explore data.

Query Grail

The fastest and easiest way to explore your data is with our new Explore tiles and sections. In a few seconds, you can find and analyze your logs, metrics, or business events. No DQL required!

To add data to a notebook

  1. Open the Add menu and select DQL.

    An empty section is added to the notebook and an Options side panel opens on the right.

  2. In the section edit box, use the Dynatrace Query Language (DQL) to define your query.

  3. Select Run Run to execute the DQL query. The Notebooks app automatically visualizes the result.

  4. Select Add title to add the title header to this notebook section.

  5. Select a visualization to display your results in your preferred format. Adjust visualization settings as needed.

    To have Dynatrace automatically select a visualization for your query, turn on Auto select in the upper-right corner of your visualization settings pane.

    • If you manually select a different visualization, the Auto select switch will turn off.
    • To have Dynatrace once again automatically select a visualization, turn Auto select back on.

Add code

To add code fetching data for your notebook using Dynatrace functions

  1. Open the Add menu and select Code.
  2. Select Run query to execute code. The Notebooks app automatically visualizes the result.
  3. Select Add title to add the title header to this notebook section.
  4. Select a visualization to display your results in your preferred format. Adjust visualization settings as needed.

    To have Dynatrace automatically select a visualization for your query, turn on Auto select in the upper-right corner of your visualization settings pane.

    • If you manually select a different visualization, the Auto select switch will turn off.
    • To have Dynatrace once again automatically select a visualization, turn Auto select back on.

Add Markdown-formatted text

To add a Markdown-formatted annotation to a notebook

  1. Open the Add menu and select Markdown.
  2. Enter your text. Use Markdown to format your text and add links and images. You can use the toolbar to insert common elements like a heading, bold text, or a link.

Edit a section

To see the edit commands for a section, select the section.

Copy to another document

Use Open with to copy a notebook section to another document (such as a different notebook or a dashboard).

An easy way to start a new notebook is to use Open with to copy reusable sections from existing notebooks to a new notebook and then edit the copied sections in the new notebook.

Example

To copy a notebook section to a dashboard (as a dashboard tile)

  1. In the notebook, select the notebook section that you want to copy to a dashboard.

  2. Select > Open with.

  3. In the Open with… window, select the Dashboards option.

    A Select destination box is displayed.

  4. In Select destination, you can create a new dashboard or select an existing dashboard.

  5. Select Add.

    The dashboard opens with the selected section copied into it.

For details, see Open with.

Duplicate section

To create a copy of a section within your notebook

  1. Select the section.
  2. Select > Duplicate section.

Move section

To move a section up or down within your notebook

  1. Select the section.
  2. Select and drag the section to a new location within the notebook.

Alternate method:

  1. Select the section.
  2. Select > Move section up or Move section down.

Delete section

To remove a section from your notebook

  1. Select the section.
  2. Select > Delete section.

Select segments

To filter data, you can specify segments for a section.

  1. In the action bar for that section, select and, in Filter by segments, select a segment.

  2. If the segment requires an additional value selection, select it now.

  3. To add another segment, select Segment. Repeat this step for each segment you want to add for the selected notebook section.

  4. Select Apply to apply the selection.

    • The segment selector for that section now displays the name of the selected segment or, if you select more than one segment, the number of selected segments.
    • To change your segment selection, select again, make your changes, and select Apply.
    • To manage segments in general (list, create, view, edit, delete), select and then select the Manage segments link.

Run code

To run a code section

  1. Select the section.
  2. Select Run code.

After you run a code section, you can clear the code results

  1. Select the section.
  2. Select > Clear result.

Show or hide code

To display the code in a code section

  1. Select the section.

  2. Select Show code.

    The code is displayed in a panel above the section.

To hide the code panel again, select Hide code.

Run query

To run a query section

  1. Select the section.
  2. Select Run query.

After you run a query section, you can clear the query results

  1. Select the section.
  2. Select > Clear result.

Show or hide query

To display the query in a query section

  1. Select the section.

  2. Select Show query.

    The query is displayed in a panel above the section.

To hide the query panel again, select Hide query.

Options

To open the Options panel (where you can select and customize a visualization for your section)

  1. Select the section.
  2. Select Options.

To copy a link to a section

  1. Select the section.
  2. Select > Copy [section type] link.

Download result

To download (export) the result of the current dashboard tile or notebook section

  1. Hover over the tile or section to display available commands.

  2. On the command bar, select More actions > Download result > [format].

    The result is downloaded to a local file in the selected format.

    The selection of download formats available depends on the visualization.

    • CSV: The result is downloaded to a local comma-separated values (*.csv) file
    • JSON: The result is downloaded to a local JSON (*.json) file

    Some visualizations offer no option for downloading the result.

Add notebook to Dock

To add your notebook to the Dock for easy access, open the menu next to the notebook name and select Add to Dock.

Share a notebook

If you own a document (dashboard or notebook), you can share it.

There are two ways to share a document with other Dynatrace users in your company:

  • Share access: Create and maintain a list of users and user groups that can access the document.
  • Share links: Create links (URLs) pointing to your document and distribute the links through the channel of your choice (email, for example).

These methods are not mutually exclusive. For example, you can maintain a focused list of users for ongoing access to the document (maybe everyone in a certain group edits the document regularly) and you can create and distribute view-only links for a wider audience as needed.

In either case, you control whether people can edit the document or only view it.

For details on sharing documents, see Share documents.

You can also export a notebook as a JSON file and send the JSON to others. For details, see export/import.

Change notebook owner

When you create a document (dashboard or notebook), you are the owner. To give ownership of the document to another Dynatrace user

  1. Open the document menu and select Change owner.

  2. Find and select a new owner, and then select Change owner.

    When you change the document owner, you immediately lose access to the document.

    • Be sure you are ready to transfer ownership before you select this command.
    • You can regain access to the document only if the new owner gives you permisssion.
  3. After the transfer is complete, the new owner will receive email about the document ownership transfer.

Print or export to PDF

To print a notebook or export it to PDF

  1. Open your notebook.

  2. optional Prepare your notebook sections for printing.

    For example:

    • Select Run to get the latest result before printing
    • Select Hide input to hide a section query and display only the result
    • Set visualization options, such as hiding sensitive or irrelevant table columns that you don't want to print and distribute
  3. From the notebook menu, select Print view.

    Open notebook menu from current notebook

    A printable view of the notebook is displayed on a Print preview page with print settings displayed at the top.

  4. Select the page size (A4 or US Letter) and orientation (Portrait or Landscape), and then select Print.

    The notebook is displayed in a print options window. Each notebook section prints to a new page.

  5. Make additional print settings as needed, and then select Save or Print (depending on the print destination) to finish.

Known print limitations

  • When printing in Landscape mode, a table may overlap the next section.
  • When Dynatrace is in dark mode, printing a notebook uses dark mode color schemes. To avoid this, you can temporarily switch Dynatrace to light mode: from the Dynatrace user menu (in the lower-left corner of Dynatrace), select Appearance > Light.

Start forecast analysis

From your notebook, you can trigger a series forecast analysis based on Davis AI.

In this example, we issue the following query:

timeseries avg(dt.host.cpu.usage), by:{ dt.entity.host }

and then run a forecast for a time series selected in the results.

  1. In a notebook, select > DQL.

  2. Enter a query such as timeseries avg(dt.host.cpu.usage), by:{ dt.entity.host } to chart time series.

  3. Select Run query.

  4. Hover over the required time series in the sidebar and select > Filter and forecast.

    Filter and forecast: select

  5. The query is automatically updated to filter by the selected time series and the chart is extended to show the projection for the selected series.

    Filter and forecast: results

For details, see Davis® forecast analysis

List notebooks

To list all notebooks

  1. Go to Notebooks.
  2. In the Notebooks panel, select All notebooks.

List my notebooks

To list all notebooks you own

  1. Go to Notebooks.
  2. In the Notebooks panel, select All notebooks.
  3. At the top of the Notebooks table, select My notebooks.

List notebooks shared with me

To list all notebooks that are shared with you

  1. Go to Notebooks.
  2. In the Notebooks panel, select All notebooks.
  3. At the top of the Notebooks table, select Shared with me.

List ready-made notebooks

To list all ready-made notebooks

  1. Go to Notebooks.

  2. In the Notebooks panel, select Ready-made notebooks.

    Select "Ready-made notebooks"

Alternatively, you can select All notebooks and then change the filter at the top of the table from All notebooks to Ready-made.

What's special about ready-made documents
  • Created and automatically distributed by Dynatrace as examples and templates.
  • Read-only: you can't change them, but you can make copies and edit the copies.
  • This icon in a table of documents indicates that it's a ready-made document.

For more about ready-made documents, see Ready-made documents.

Manage notebooks

Create, duplicate

To create a new notebook, see Create a notebook

To duplicate a notebook

  1. At the top of the notebook, open the menu next to the notebook name.
  2. Select Make a copy from the menu.

Alternatively, you can also trigger the same action in the Recently modified section of the sidebar. Select > Make a copy.

Delete

To delete a notebook

  1. At the top of the notebook, open the menu next to the notebook name.
  2. Select Delete from the menu.

Alternatively, you can also trigger the same action in the Recently modified section of the sidebar. Select > Delete.

To delete multiple notebooks, select All notebooks and use the buttons in the table.

Export

To export a notebook

  1. At the top of the notebook, open the menu next to the notebook name.
  2. Select Download from the menu.

Alternatively, you can also trigger the same action in the Recently modified section of the sidebar. Select > Export as JSON.

Import

To import a notebook from a JSON file

  1. Select All notebooks in the document sidebar.

  2. In the upper-left corner of the page, select Upload. A file browser window opens.

  3. Find and open the notebook JSON definition file.

The definition is imported as a new notebook and listed on the Notebooks page with Last modified set to the import date and time.

The easiest way to search for a notebook is through the global search.

The search can be triggered from any context using the Cmd/⌘+K keyboard shortcut. Notebooks with matching titles will show up in the results.

Alternatively, select All notebooks in the sidebar. Enter a search term to list only matching notebooks.

Copy a task from another document

Using Open with, you can copy tasks from other documents to reuse in your workflows.

Example

In this example, we have a Grail query in a dashboard that we want to run as a task in a workflow.

To copy a Grail query from a dashboard to Workflows as a task in a workflow

  1. In the dashboard, select the query tile that you want to copy to a workflow.

  2. Select > Open with.

  3. In the Open with… window, select the Automate DQL Query Workflows option.

    A Select destination box is displayed.

  4. In Select destination, you can create a new workflow or select an existing workflow.

  5. Select Add.

    The Workflows application opens with the selected query added as a workflow task.

  6. Edit the workflow as needed.

For more details, see Open with.