Use of PMM dashboard on external Grafana

I have use the converter grafana-dashboards/convert-dash-from-PMM.py at main · percona/grafana-dashboards · GitHub

to convert the PMM json for use with Grafana

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.’


I can also query the mongodb_ss_* metrics

1 Like

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.

1 Like

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.

1 Like

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

e.g.

1 Like

@Vadim_Yalovets

Here is some graphs

  1. Explore, avg by (service_name) (mongodb_instance_uptime_seconds)

  1. Explore, avg by (service_name) (mongodb_instance_uptime_seconds{service_name=~“$service_name”})

No output

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

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

Thank you in advance.

1 Like

You may change datasource to Prometheus for all elements.
Screenshot 2022-10-20 at 11.44.55

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

1 Like

@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.

1 Like

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?

1 Like

@Vadim_Yalovets

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.

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

1 Like

Could you check in Explore provided parameters for metric mongodb_up?

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

1 Like

@Vadim_Yalovets

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

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

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

Thanks.

1 Like

@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.

1 Like