# Use of PMM dashboard on external Grafana

**URL:** <https://forums.percona.com/t/use-of-pmm-dashboard-on-external-grafana/18045>\
**Category:** MongoDB® General Discussion\
**Tags:** grafana\
**Created:** [October 17, 2022, 5:28pm UTC](https://forums.percona.com/t/use-of-pmm-dashboard-on-external-grafana/18045 "2022-10-17T17:28:20Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![patdung100\_percona](https://avatars.discourse-cdn.com/v4/letter/p/bc8723/32.png) [@patdung100\_percona](https://forums.percona.com/u/patdung100_percona)\
**Post date:** [October 17, 2022, 5:28pm UTC](https://forums.percona.com/t/use-of-pmm-dashboard-on-external-grafana/18045/1 "2022-10-17T17:28:20Z")

</div>

I have use the converter [grafana-dashboards/convert-dash-from-PMM.py at main · percona/grafana-dashboards · GitHub](https://github.com/percona/grafana-dashboards/blob/main/misc/convert-dash-from-PMM.py)

to convert the PMM json for use with Grafana

> **[grafana-dashboards/dashboards/MongoDB at main · percona/grafana-dashboards](https://github.com/percona/grafana-dashboards/tree/main/dashboards/MongoDB)**
>
> main/dashboards/MongoDB

But the dashboard is displaying with random/dummy data.  
The Grafana is able to access Prometheus as data source.  
The Service Monitor is configured with the mongodb exporter.  
The mongodb exporter is able to get the metrics from the mongodb instance.

The question is how to display the metrics via the converted dashboard.’

 ![image](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/9/97108927ec46fc31e3586352963cb98d75c04c03.png)  
I can also query the mongodb\_ss\_\* metrics

---

<div class="post-metadata">

**Author:** ![Vadim\_Yalovets](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/vadim_yalovets/32/43_2.png) [@Vadim\_Yalovets](https://forums.percona.com/u/Vadim_Yalovets)\
**Post date:** [October 18, 2022, 8:23am UTC](https://forums.percona.com/t/use-of-pmm-dashboard-on-external-grafana/18045/2 "2022-10-18T08:23:29Z")

</div>

Hi @patdung100_percona,

The purpose of converting procedure is replacing PMM2 labels (node\_name, service\_name) with default labels (instance). But according to the provided image node\_name and service\_name are provided. So it looks like you may use the original dashboard.

---

<div class="post-metadata">

**Author:** ![patdung100\_percona](https://avatars.discourse-cdn.com/v4/letter/p/bc8723/32.png) [@patdung100\_percona](https://forums.percona.com/u/patdung100_percona)\
**Post date:** [October 18, 2022, 1:40pm UTC](https://forums.percona.com/t/use-of-pmm-dashboard-on-external-grafana/18045/3 "2022-10-18T13:40:33Z")

</div>

The picture you see is  
cluster=“coral-mongodb-cluster”  
container=“mongodbexporter”  
endpoint=“metrics”  
instance=“10.42.0.50:9216”  
job=“mongodb-exporter”  
namespace=“coralproject”  
node\_name=“node-with-coral-mongodb”  
pod=“mongodb-exporter-77866f8f68-dsxcc”  
service=“mongodb-exporter”  
service\_name=“coral-mongodb”  
service\_type=“mongodb”

But I manually added it in the targetLabels of Service Monitor.  
Without adding labels. it would have:

container=“mongodbexporter”  
endpoint=“metrics”  
instance=“10.42.0.50:9216”  
job=“mongodb-exporter”  
namespace=“coralproject”  
pod=“mongodb-exporter-77866f8f68-dsxcc”  
service=“mongodb-exporter”

I am pretty sure I am using the converted json/dashboard because the file size is larger than the un-converted json/dashboard.

---

<div class="post-metadata">

**Author:** ![Vadim\_Yalovets](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/vadim_yalovets/32/43_2.png) [@Vadim\_Yalovets](https://forums.percona.com/u/Vadim_Yalovets)\
**Post date:** [October 19, 2022, 2:26pm UTC](https://forums.percona.com/t/use-of-pmm-dashboard-on-external-grafana/18045/4 "2022-10-19T14:26:58Z")

</div>

Could you provide some screenshots of elements that show dummy data?  
You may verify formulas in Explore.

e.g.

 ![Screenshot 2022-10-19 at 17.23.46](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/9/9bda917d3509c80f4b9101e31e5ed4efcf8cb0f1.png)

 ![Screenshot 2022-10-19 at 17.24.22](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/0/0a6e564ff8729466d5a76d13ab5f9f772a3ed66b.png)

---

<div class="post-metadata">

**Author:** ![patdung100\_percona](https://avatars.discourse-cdn.com/v4/letter/p/bc8723/32.png) [@patdung100\_percona](https://forums.percona.com/u/patdung100_percona)\
**Post date:** [October 19, 2022, 5:38pm UTC](https://forums.percona.com/t/use-of-pmm-dashboard-on-external-grafana/18045/5 "2022-10-19T17:38:09Z")

</div>

@Vadim_Yalovets

Here is some graphs

1. Explore, avg by (service\_name) (mongodb\_instance\_uptime\_seconds)

 ![image](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/a/a8777945ef3327b31ba4ed41100bdd09ed4dfc03.png)

1. Explore, avg by (service\_name) (mongodb\_instance\_uptime\_seconds{service\_name=~“$service\_name”})

No output

 ![image](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/d/d7e518977f0066fb83eb6b8caaa0ab3756f91a24.png)

But there is output if I use  
avg by (service\_name) (mongodb\_instance\_uptime\_seconds{service\_name=~“coral-mongodb”})

1. Note I use data source Prometheus  
Prometheus has a service monitor to mongodb-exporter. The screen shot is given in the beginning of this forum post.

2. Here’s some screen shot with dummy graphs  
[Grafana](https://grafana.cloudnative.quest/dashboard/snapshot/Zn6XuN9bhVUcpSi3UWGBbZB5hIjSabuh?orgId=0&refresh=1m)

 ![image](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/e/e84e96404b12074bd4e1ae7e805af843d27a3359.png)

I don’t have such A/B/J series in my mongodb system.

Thank you in advance.

---

<div class="post-metadata">

**Author:** ![Vadim\_Yalovets](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/vadim_yalovets/32/43_2.png) [@Vadim\_Yalovets](https://forums.percona.com/u/Vadim_Yalovets)\
**Post date:** [October 20, 2022, 8:49am UTC](https://forums.percona.com/t/use-of-pmm-dashboard-on-external-grafana/18045/6 "2022-10-20T08:49:28Z")

</div>

You may change datasource to Prometheus for all elements.  
 ![Screenshot 2022-10-20 at 11.44.55](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/0/0e9dc83ef6ba2f2e20c99b1108d8a274f7b9b3da.png)

Or it can be created a copy of your Prometheus datasource with name Metrics.

 ![Screenshot 2022-10-20 at 11.47.48](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/a/ac00624d8388b018eddaf015bb81b13c8406fc9c.png)

---

<div class="post-metadata">

**Author:** ![patdung100\_percona](https://avatars.discourse-cdn.com/v4/letter/p/bc8723/32.png) [@patdung100\_percona](https://forums.percona.com/u/patdung100_percona)\
**Post date:** [October 20, 2022, 12:39pm UTC](https://forums.percona.com/t/use-of-pmm-dashboard-on-external-grafana/18045/7 "2022-10-20T12:39:26Z")

</div>

@Vadim_Yalovets

I had created a data source ‘Metrics’ same as data source Prometheus.  
The I select the data source in Metrics in the dashboard.

But it is still showing dummy data.  
Then I stopped my mongodb instance.  
It kept on showning dummy data.

 ![image](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/1/1d6ffacf68c575f2209a4202da8419fc455a9235.png)

---

<div class="post-metadata">

**Author:** ![Vadim\_Yalovets](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/vadim_yalovets/32/43_2.png) [@Vadim\_Yalovets](https://forums.percona.com/u/Vadim_Yalovets)\
**Post date:** [October 21, 2022, 9:01am UTC](https://forums.percona.com/t/use-of-pmm-dashboard-on-external-grafana/18045/8 "2022-10-21T09:01:45Z")

</div>

It looks like elements are still using Grafana datasource (A built-in data source that generates random walk data.) Could you open elements in edit mode and set Prometheus datasource?

---

<div class="post-metadata">

**Author:** ![patdung100\_percona](https://avatars.discourse-cdn.com/v4/letter/p/bc8723/32.png) [@patdung100\_percona](https://forums.percona.com/u/patdung100_percona)\
**Post date:** [October 21, 2022, 1:21pm UTC](https://forums.percona.com/t/use-of-pmm-dashboard-on-external-grafana/18045/9 "2022-10-21T13:21:52Z")

</div>

@Vadim_Yalovets

1. 

I have edit an individual panel of a dashboard:  
After selecting DS to Metrics/Prometheus and then refresh, there is no data, output is N/A.

 ![image](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/d/d31efb43b1985ee9c3fbddc0e3102bf6dd806ce2.png)

1. Is it related to the variables setting?  
Some variables cannot be automatically filled.

 ![image](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/c/cfe59df22bf452aba14b5c3fbd7e788f56ce894d.png)

---

<div class="post-metadata">

**Author:** ![Vadim\_Yalovets](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/vadim_yalovets/32/43_2.png) [@Vadim\_Yalovets](https://forums.percona.com/u/Vadim_Yalovets)\
**Post date:** [October 24, 2022, 11:45am UTC](https://forums.percona.com/t/use-of-pmm-dashboard-on-external-grafana/18045/10 "2022-10-24T11:45:48Z")

</div>

> [@patdung100\_percona](#):
>
> I have edit an individual panel of a dashboard:  
> After selecting DS to Metrics/Prometheus and then refresh, there is no data, output is N/A.

Could you check in Explore provided parameters for metric **mongodb\_up**?

> [@patdung100\_percona](#):
>
> Is it related to the variables setting?  
> Some variables cannot be automatically filled.

It’s not related to the issue. Missing variables are not used on this dashboard.

---

<div class="post-metadata">

**Author:** ![patdung100\_percona](https://avatars.discourse-cdn.com/v4/letter/p/bc8723/32.png) [@patdung100\_percona](https://forums.percona.com/u/patdung100_percona)\
**Post date:** [October 24, 2022, 12:32pm UTC](https://forums.percona.com/t/use-of-pmm-dashboard-on-external-grafana/18045/11 "2022-10-24T12:32:07Z")

</div>

@Vadim_Yalovets

1. If I use the Explore on the left hand side of the sidebar:

 ![image](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/f/fe81d71a52e55418130a131fa20fa63e3f9ebe2c.png)

1. If I edit the panel of a dashboard and select Expore:  
The default screen, it is loading Grafana random walk

 ![image](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/9/9139b272cd4c9abd22480d24ee2d5cc1608087ab.png)

There is no formula or calculation in the panel, so changing data source to Prometheus would not give any output.

Thanks.

---

<div class="post-metadata">

**Author:** ![patdung100\_percona](https://avatars.discourse-cdn.com/v4/letter/p/bc8723/32.png) [@patdung100\_percona](https://forums.percona.com/u/patdung100_percona)\
**Post date:** [October 26, 2022, 3:19pm UTC](https://forums.percona.com/t/use-of-pmm-dashboard-on-external-grafana/18045/12 "2022-10-26T15:19:27Z")

</div>

@Vadim_Yalovets

For the converted json dashboards, I have to replace “datasource”: “$datasource” to “datasource”: “Metrics” manually before import.

Then I can see most of the Dashboards are having data. But some panels still have problems like $service\_name not found.
