---
title: Visualize Data Using Grafana
slug: manufacturing-connect-edge-v2/visualize-data-using-grafana
docTags: 
createdAt: 2022-12-07T14:30:56.000Z
---

You can use Grafana to visualize data in Manufacturing Connect Edge.&#x20;

# Step 1: Install Docker Container

You have two options to install the Docker container.&#x20;

## Option 1: Deploy Grafana from Manufacturing Connect

If you have access to Manufacturing Connect (MC), you can use MC to deploy Grafana in your Manufacturing Connect Edge instance.&#x20;

**To deploy Grafana from Manufacturing Connect:**

1. In Manufacturing Connect, follow the steps to [Manage Applications](docId:7SNmDZRkQasYmykaafjZ5). For Grafana, follow the steps to [Deploy an Application to Edge Devices](docId:6gp9vK1JYhRFfxZdSx6hP).
   - For *Step 2: Application Settings*, if the default port number is already in use, you will need to enter another port.
2. In Manufacturing Connect Edge, navigate to **Applications&#x20;**> **Containers**.
   The *Containers&#x20;*&#x70;ane appears.&#x20;
3. Verify that the Grafana Docker Container is running.

::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/WaAOMIYw3jqvo2U3FPKiX_image.png" size="80" width="1710" height="176" caption="Operational Grafana Docker Container" position="center" showCaption="true"}

## Option 2: Run Grafana Container in Manufacturing Connect Edge

If you don't have access to Manufacturing Connect, you can run the Grafana container in Manufacturing Connect Edge.&#x20;

**To run the Grafana container in Manufacturing Connect Edge:**

1. Navigate to **Applications&#x20;**> **Containers**.
   The *Containers&#x20;*&#x70;ane appears.&#x20;
2. From the *Containers* pane, click **Run**.&#x20;
   The *Enter command to run&#x20;*&#x66;ield appears.&#x20;
3. Enter the following Docker run command and click **Run**.

```linux
docker run -d --name=grafana --restart=always -u root -v grafana-storage:/var/lib/grafana -v grafana-config:/etc/grafana -p 3000:3000 grafana/grafana
```

&#x20;         If needed, replace `-p 3000:3000` with a different port.&#x20;

&#x20;     4\. Verify that the Grafana Docker Container is running.

::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/nDu33rzpXZih5O3N3dqYJ_image.png" size="80" width="1710" height="176" caption="Operational Grafana Docker Container" position="center" showCaption="true"}

# Step 2: Access Grafana

To connect to Grafana, you will use your Manufacturing Connect Edge IP address and the port configured in the Grafana container.&#x20;

::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/xlFo9WkjMu6rC7sexHBbc_image.png" size="80" width="1166" height="303" caption="Grafana port" position="center" showCaption="true"}

**To access Grafana:&#x20;**

1. In a new browser window, enter the URL to connect to Grafana using this format: \[Manufacturing Connect Edge IP address]:\[port]. For example, if your Manufacturing Connect Edge instance uses the IP address https\://192.168.0.146, and the Grafana container uses port 3000, enter **192.168.0.146:3000**.
   The Grafana login screen appears.&#x20;
2. Enter **admin&#x20;**&#x61;s the username and password, and then change the password.
   The *Grafana Home&#x20;*&#x73;creen appears.&#x20;

# Step 3: Set up Database

Grafana needs a database to extract from to display results. Manufacturing Connect Edge allows you to configure the internal timeseries database (tsdata) to connect to Grafana.

You also have the option to set up a database to your specific requirements.&#x20;

## Step 1: Create DB User

You will need to create a user that has read access to the database.

**To create a DB user:**

1. In Manufacturing Connect Edge, navigate to **DataHub&#x20;**> **DB Users**.&#x20;
2. Click the **Add (+)&#x20;**&#x69;con.&#x20;
   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/06bx5oM63JqXKUVijy6t4_add-usermce.png" size="80" width="1029" height="498" caption="The Add user icon" position="center" showCaption="true"}
3. Configure the user details.&#x20;
   - **Username**
   - **Password**: Copy and save this for later use.&#x20;
   - **Database**: Select **tsdata**.&#x20;
   - **Privilege**: Select **Read**.&#x20;
4. Click **Add User**.&#x20;

## Step 2: Ensure Database Has a Measurement

The database will not connect successfully to Grafana unless at least one measurement is in the database.&#x20;

To confirm if the database has a measurement, navigate to **DataHub&#x20;**> **DB Management** and click the arrow to expand the tsdata database.&#x20;

::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/-3iT429vb4meioitPTFjt_image.png" size="80" width="1069" height="565" caption="Expand the tsdata database" position="center" showCaption="true"}

If there are no measurements listed, follow the steps below.&#x20;

### Step 2a: Connect Device

Follow the steps to [Connect a Device](docId\:SqalV8ImyZmn8xA-56gno) and do the following:

- Select the Device Type **Simulator&#x20;**&#x61;nd the Driver Name **Generator**.&#x20;
- Select the **Enable Data Store** check box in the device configuration.&#x20;
- Enter a value in the **Retention Hours** field.&#x20;

### Step 2b: Add Tag to Device

Follow the steps to [Add Tags](docId:-5nFrBQ-uriWOY3GACnPt) and add at least one tag to the device you created.&#x20;

After connecting the device and adding the tag, navigate to **DataHub&#x20;**> **DB Management** and click the arrow to expand the tsdata database again to confirm a measurement is now available.

::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/YVu1Fr6hPmNkB4GFB75_u_image.png" size="80" width="948" height="327" caption="tsdata measurement" position="center" showCaption="true"}

# Step 4: Add a Data Source in Grafana

You will need to add a data source in Grafana that connects to the database you created. See the [Influx data source](https://grafana.com/docs/grafana/latest/datasources/influxdb/) documentation from Grafana to learn more.&#x20;

When configuring the data source, do the following:

- Select the **InfluxDB** time-series database.&#x20;
- In the **URL&#x20;**&#x66;ield, enter `http://10.30.50.1:8086`. 10.30.50.1 is the IP address of Manufacturing Connect Edge on the internal docker network by default.&#x20;
- In the **Database&#x20;**&#x66;ield, enter `tsdata`.&#x20;
- In the **User&#x20;**&#x66;ield, enter the username you configured for the DB user in Manufacturing Connect Edge. &#x20;
- In the **Password&#x20;**&#x66;ield, paste or enter the password you configured for the DB user in Manufacturing Connect Edge.&#x20;

# Step 5: Add a Dashboard in Grafana

Now that the database is successfully connected to Grafana, you can start visualizing the data by using a dashboard. See the [Create a dashboard ](https://grafana.com/docs/grafana/latest/dashboards/build-dashboards/create-dashboard/)documentation from Grafana to learn more.&#x20;

