Plugins 〉Dynamic Text

Panel
community

Dynamic Text

  • Overview
  • Installation
  • Change log
  • Related content

Dynamic Text Panel for Grafana

Text

Grafana CI codecov

Introduction

A Dynamic Text panel is a plugin for Grafana for dynamic, data-driven text.

While the built-in Text panel in Grafana does support variables, that's about as dynamic it gets. This panel lets you define a text template using the data from your data source query.

Dynamic Text Plugin for Grafana | Markdown, HTML and Handlebars to transform data visualizations

Requirements

  • Grafana 8.5+, Grafana 9.0+ is required for version 2.X.
  • Grafana 7.0+ is required for version 1.X.

Getting Started

The Dynamic Text panel can be installed from the Grafana Catalog or use the grafana-cli tool to install from the command line:

grafana-cli plugins install marcusolsson-dynamictext-panel

Features

Panel Options

Content

A Handlebars template with support for Markdown.

To use display data from your query result, enter the name of the field surrounded by double braces. For example, to display the value from the Time field, enter {{Time}}.

Grafana renders the template for every row in the query result. If a query returns multiple query results, you can select the query result you wish to display from a drop-down menu.

You can even do basic text processing using one or more helpers inside your template.

Default content

Whenever the data source query returns an empty result, Grafana displays the template in Default content instead of Content.

This can be useful to provide users with instructions on what to do, or who to contact, when the query returns an empty result.

Even though there's no data from the data source, you can still use the available helpers.

Every row

By default, the template configured in the Content field is rendered for each record in the result.

You can render this template only once by turning this switch off. In this case, the query results are passed in as the data field to the template.

Handlebars provides a builtin-helper to iterate over these records.

Example

Let's say that your data source returns the following data:

| app  | description                  | cluster | tier     |
| ---- | ---------------------------- | ------- | -------- |
| auth | Handles user authentication. | prod    | frontend |

You can then write Markdown with placeholders for the data you want to use. The value inside each double brace expression refers to a field in the query result.

# {{app}}

{{description}}

{{#if (eq tier "frontend")}} https://{{cluster}}.example.com/{{app}} {{/if}}

The panel renders Handlebars → Markdown → HTML and displays the final result.

For more examples, take a look at

  • Helpers - functions that let you perform basic text transformation within your template.
  • Recipes - useful snippets that you can use in your templates.

Feedback

We love to hear from users, developers, and the whole community interested in this plugin. These are various ways to get in touch with us:

  • Ask a question, request a new feature, and file a bug with GitHub issues.
  • Sponsor our open-source plugins for Grafana with GitHub Sponsor.
  • Star the repository to show your support.

License

  • Apache License Version 2.0, see LICENSE.

Installing Dynamic Text on Grafana Cloud:

For more information, visit the docs on plugin installation.

Changelog

2.0.0 (2022-11-02)

Breaking changes

This release bumps the minimum required Grafana to >=8.5.

Features / Enhancements

  • Maintained by Volkov Labs (#100)
  • Updated based on Volkov Labs Panel Template (#100)
  • Update to Grafana 9.1.6 (#104)
  • Add "Dynamic Text Plugin for Grafana" video in README (#106)
  • Update CI to Node 16 and Synchronize with Release workflow (#107)
  • Update to Grafana 9.2.2 (#108)
  • Update screenshot and provisioning (#109)

1.9.0 (2022-01-09)

Features / Enhancements

  • Add an option to render template for each row or as a single template. Useful for when you want to create tables from the query result. (#53) Thanks @andykingking.

Bug fixes

  • The dropdown for selecting between multiple frames wasn't visible due to overflow. (#65)

1.8.0 (2021-11-19)

Features / Enhancements

  • Add contains helper (#48)
  • Upgrade dependencies

1.7.2 (2021-06-21)

Features / Enhancements

  • Improve error handling. Avoids having to refresh the dashboard on template errors.

1.7.1 (2021-06-15)

Features / Enhancements

  • Update docs and metadata
  • Upgrade dependencies

1.7.0 (2021-03-08)

Features / Enhancements

  • Add options for default content for empty query results (#15)

1.6.0 (2021-03-04)

Features / Enhancements

  • Improved error handling

1.5.0 (2021-02-16)

Features / Enhancements

  • Avoid recompiling templates on every render

1.4.0 (2021-01-08)

Features / Enhancements

  • Update @grafana/* packages
  • Improved styling for tables and blockquotes

1.3.0 (2021-01-08)

Features / Enhancements

  • Support for HTML tags in templates (#4)
  • Add additional conditional operator (#3)

1.2.1 (2020-11-27)

Features / Enhancements

  • Updated @grafana dependencies from ^7.0.0 to ^7.3.0
  • Improved release process using the new GitHub workflows for Grafana plugins
  • Add screenshot