How to use datasource-v2 plugin in Grafana

How to configure and utilize the new datasource-v2 plugin in Grafana

The new umh-datasource-v2 plugin for Grafana mimics an ISA95-compliant data model, but still using our old database model. This tutorial will guide you through configuring and using the plugin.

Configuration

  1. In Grafana, navigate to the Data sources configuration panel.

    Untitled

  2. Scroll to the bottom of the list and select datasource-v2. Don’t worry about the Unsigned error message, as long as you have followed our tutorials to setup the united manufacturing hub.

  3. Insert all the correct configuration:

    1. Base URL: the URL for the factoryinsight backend. Defaults to http://united-manufacturing-hub-factoryinsight-service/.
    2. Enterprise name: previously customerID for the old datasource plugin. Defaults to factoryinsight.
    3. API Key: authenticates the API calls to factoryinsight. Can be found with UMHLens by going to Secrets → factoryinsight-secret → apiKey. It should follow the format Basic xxxxxxxx.

    Untitled

  4. Press Save & test.

Usage

  1. When creating a new panel, select datasource-v2 from the Data source drop-down menu. It will then fetch the resources from the database. The loading time may depend on your internet speed.

    Untitled

  2. Select the resources in the cascade menu to build your query. DefaultArea and DefaultProductionLine are placeholders for the future implementation of the new data model.

    ezgif-5-1105b66e7e.gif

  3. Only the available values for the specified work cell will be fetched from the database. You can then select which data value you want to query.

    Screenshot_2022-10-19_15-44-12.png

  4. Next you can specify how to transform the data, depending on what value you selected.

    For example, all the custom tags will have the aggregation options available:

    Untitled

  5. Select the right visualization type in the upper right corner and hit Apply to save you new panel.

Conclusions

Now you have set up our new datasource plugin and are able to query data from the old database model in a more ISA95-compliant way. Note that this is just a preview of what the future implementation of the Historian functionalities and ISA95 data models (more on that in the blog article) will be.

Keep in mind that this plugin is still in development, and could have some bugs. If you encounter any problem, please feel free to open an issue on our GitHub repository or ask for help in our Discord server

Last modified February 17, 2023: update (#208) (ea731fc)