Skip to content

Grafana#

Grafana widget icon.

Overview#

The Grafana widget is used within Critical Manufacturing MES but your original Grafana dashboard is initially created in a separate external page.

Warning

Given that Grafana is a server that can be deployed within the realm of the current customer environment (in a separate container sharing the same network and environment stack) or in an autonomous installation to be used by multiple environments, a configuration key is required to indicate the proper URL to be used for this specific environment. That key is /Cmf/Guis/Configuration/Urls/Grafana/ and should hold the value for the current Grafana server location (example: https://grafanaserver.companydomain.com:443/grafana). If the configuration entry is not filled in, the widget will display an error:

Screenshot showing a Grafana interface with missing URL.

General Steps#

To use the Grafana widget in a UI Page, follow the steps below:

  1. Drag and drop the Grafana widget into the desired place, expand it as needed, and then select Open Grafana:

    Screenshot showing the Grafana widget context menu with the Open Grafana option highlighted.

  2. The Grafana entry page looks like this:

    Screenshot of the Grafana entry page, showing the Welcome to Grafana home screen and the Need help? section.

    Note

    This page is very important because in the Need help? section you can access Documentation and other useful links to help you start creating your Grafana dashboard.

  3. Create your dashboard in Grafana and copy its address.

  4. In the created UI Page, select Settings either in the More dropdown or on the center page of the Grafana widget:

    Screenshot showing the Grafana widget context menu with the Settings option highlighted.

  5. In the General tab, provide a name (Grafana by default) and a description for the widget. Use the toggle buttons to specify whether the widget should be visible, display the header, or allow full screen mode. Additionally, determine if the widget can be opened as an image in a new tab or exported as an image.

    Screenshot of the Grafana widget Settings dialog, General tab, showing the Name and Description fields and the Display and Options toggles.

Widget Customization#

  1. Optionally, in the Style tab, you can define a Border Width and Color.

    Screenshot of the Grafana widget Settings dialog, Style tab, showing the Border Width and Border Color fields.

  2. Select the Setup tab and paste the complete address of your recently created Grafana dashboard into the Dashboard Url field.

    If Show Controls and Menu is not enabled, the URL will contain &kiosk.

    Screenshot of the Grafana widget Settings dialog, Setup tab, showing the Dashboard Url field with the &kiosk parameter highlighted, along with the Theme and Show Controls and Menu options.

  3. In the Setup tab, you can also select the Theme (Light, Dark, or Standard), and choose whether or not to Show the Controls or the Menu.

    Screenshot showing the Grafana interface with customization options for Light, Dark, and Standard themes.

    Screenshot showing a customized Grafana dashboard in dark mode with controls hidden.

  4. In the Variables tab, you can or override the variables created in Grafana, along with their details:

    Screenshot of the Grafana widget Settings dialog, Variables tab, showing a list of variables (Plan, TimeUnit, TimeFrame) and the Variable Details panel.

    Note

    The Variables you define in the settings are the default ones, but you can introduce other settings from the UI Page into Grafana.

  5. In the Inputs tab, you can inputs as needed. Note that the Name and Type are mandatory fields:

    Screenshot of the Grafana widget Settings dialog, Inputs tab, showing an Area input configured with its Name, Type, and Reference Type.

  6. In the Links tab, you can add links to make your UI Page more dynamic.

    Screenshot of the Grafana widget Settings dialog, Links tab, showing the Links tab where links can be added between widgets.

  7. By saving and closing the settings, the widget will be changed accordingly.

Real Use Case#

To fully utilize the Grafana widget, you can connect it to a Form widget. Follow the steps below to set it up.

  1. Drag and drop the Form widget into your UI Page and select its Settings:

    Screenshot showing the Form widget context menu with the Settings option highlighted, next to the Grafana widget.

  2. Go to the Fields tab, select to change the TimeUnit variable(Type: String), and then Save and Close:

    Screenshot of the Form widget Settings dialog, Fields tab, showing the TimeUnit field configured with the String value type.

  3. In the build mode of your UI Page, define a value for the new TimeUnit:

    Screenshot of the UI Page in build mode, showing the Form widget with the TimeUnit field set to a value, next to the Grafana widget.

  4. In the top ribbon, select Settings, then in the Properties tab, selected to add a new property for your TimeUnit label. Set the appropriate Name, Source, Type, and Value (key of the variable in Grafana), then Save and Close:

    Screenshot of the UI Page Settings dialog, Properties tab, showing the TimeUnitLabel property configured with its Name, Source, and Type.

  5. Select Links and drag and drop the Forms and Grafana widgets onto your page:

    Screenshot of the UI Page Links tab, showing the Connectable Items panel with the Form and Grafana widgets available to drag onto the canvas.

    It will look like this:

    Screenshot showing the Form and Grafana widgets placed on the Links diagram canvas, with their properties listed.

  6. Connect the Form and Grafana widget as shown below:

    Screenshot showing a connection between a Form and a Grafana widget.

  7. To send the result of the TimeUnitChange String to the variables input of the Grafana widget (a map), select the Converter Set Value in Map in Converter and the Property Key TimeUnitLabel, created earlier, in the Converters wizard:

    Screenshot of the Converters dialog, showing the Set Value in Map converter configured with the TimeUnitLabel property key for the link between the Form's TimeUnit Change and the Grafana widget's Variables.

  8. Ensure your Links Diagram resembles the image below.

    Screenshot showing a diagram of a "Links Diagram" resembling the 1B Form Hybrid Revenue Change.

  9. To verify your link configuration, select the Settings option of the Grafana widget, access the Links tab, and press icon. If no error message is displayed, your link is correctly configured.

    Screenshot of the Grafana widget Settings dialog, Links tab, showing the configured link between the Form and Grafana widgets after validation.

  10. By saving and closing the settings, the widget will be updated accordingly.

    Screenshot showing the UI Page after configuration is saved, with the Form's TimeUnitLabel field and the Grafana dashboard now linked and displaying data.

Info

For more information, see the Data Manager (Grafana Plugin) and Grafana Widget tutorials.