# Adding additional Prometheus exporter to PMM

**URL:** <https://forums.percona.com/t/adding-additional-prometheus-exporter-to-pmm/8322>\
**Category:** PMM 2.x\
**Tags:** pmm\
**Created:** [November 27, 2020, 11:39am UTC](https://forums.percona.com/t/adding-additional-prometheus-exporter-to-pmm/8322 "2020-11-27T11:39:45Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrewkew](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/andrewkew/32/1475_2.png) [@andrewkew](https://forums.percona.com/u/andrewkew)\
**Post date:** [November 27, 2020, 11:39am UTC](https://forums.percona.com/t/adding-additional-prometheus-exporter-to-pmm/8322/1 "2020-11-27T11:39:45Z")

</div>

1. I want to add another prometheus exporter to PMM so that I can track another service, in my case apache on ubuntu

2. Make it into a service
3. The exporter by default delivers stats on the following URL: http://ip:9117/metrics
4. run a pmm-admin add command to add it

I have tried the following without success

```auto
sudo pmm-admin add external:service apache --service-port 9117 <server_name> (that command doesnt run)
sudo pmm-admin add external --listen-port=9117 (this command run and added something but its not right)

```

can someone please help how do I add another prometheus exporter so that its being consumed by PMM

---

<div class="post-metadata">

**Author:** ![Ivan\_Groenewold](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ivan_groenewold/32/6299_2.png) [@Ivan\_Groenewold](https://forums.percona.com/u/Ivan_Groenewold)\
**Post date:** [November 27, 2020, 11:53am UTC](https://forums.percona.com/t/adding-additional-prometheus-exporter-to-pmm/8322/2 "2020-11-27T11:53:52Z")

</div>

Hi, please have a look at the following: [https://www.percona.com/doc/percona-monitoring-and-management/2.x/setting-up/client/external.html](https://www.percona.com/doc/percona-monitoring-and-management/2.x/setting-up/client/external.html) and try specifying --service-name.

---

<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:** [November 27, 2020, 4:13pm UTC](https://forums.percona.com/t/adding-additional-prometheus-exporter-to-pmm/8322/3 "2020-11-27T16:13:31Z")

</div>

Hi Andrew,

Could you try the next command?

_pmm-admin add external --listen-port=9117 --metrics-path=metrics_

---

<div class="post-metadata">

**Author:** ![andrewkew](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/andrewkew/32/1475_2.png) [@andrewkew](https://forums.percona.com/u/andrewkew)\
**Post date:** [November 30, 2020, 4:05am UTC](https://forums.percona.com/t/adding-additional-prometheus-exporter-to-pmm/8322/4 "2020-11-30T04:05:16Z")

</div>

Hi

Thanks both of you for the help, I have tried both of your suggestions and this is the outcome

I ran the following command

```auto
pmm-admin add external --listen-port=9117 --metrics-path=metrics --service-name=apache

```

With the following output checking the exporters on the machine

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

I am getting an Unknown status on the external exporter. Checking the service running I get the following

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

In PMM in the Prometheus Exporters Overview dashboard it shows the exporter

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

But I am now not sure if this is actually working and where would I try and search for some of the stats?

Thanks for your help in advance

BTW @igroene - the help on CLI does not give me the --service-name as an option, could be a version issue or its not been updated properly?

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

Thanks

---

<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:** [November 30, 2020, 4:27am UTC](https://forums.percona.com/t/adding-additional-prometheus-exporter-to-pmm/8322/5 "2020-11-30T04:27:49Z")

</div>

New metrics can be checked on Prometheus UI (http:///prometheus)

You may use the next query

_{service\_name=“apache”}_

e.g.

 ![Screenshot_20201130_115332.png](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/1X/91a846c17bdadd2daf2f6c0d263900d9ae02c8b2.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:** [November 30, 2020, 4:31am UTC](https://forums.percona.com/t/adding-additional-prometheus-exporter-to-pmm/8322/6 "2020-11-30T04:31:19Z")

</div>

The flag “–service-name” is shown if help command is requested for “add external” command

 ![Screenshot_20201130_115706.png](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/1X/375e8a05242548601f50cf427242b4acb00fd336.png)

---

<div class="post-metadata">

**Author:** ![andrewkew](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/andrewkew/32/1475_2.png) [@andrewkew](https://forums.percona.com/u/andrewkew)\
**Post date:** [November 30, 2020, 5:03am UTC](https://forums.percona.com/t/adding-additional-prometheus-exporter-to-pmm/8322/7 "2020-11-30T05:03:17Z")

</div>

Hi @adivinho

Thank you for your help that is exactly what I was after, I am able to see these new stats in Prometheus console and view them on a graph.

According to the prometheus apache exporter though there is a Grafana dashboard I can add

[Apache dashboard for Grafana](https://grafana.com/grafana/dashboards/3894)

Do you know if this will work with PMM and the new external exporter?

Thanks

---

<div class="post-metadata">

**Author:** ![andrewkew](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/andrewkew/32/1475_2.png) [@andrewkew](https://forums.percona.com/u/andrewkew)\
**Post date:** [November 30, 2020, 5:16am UTC](https://forums.percona.com/t/adding-additional-prometheus-exporter-to-pmm/8322/8 "2020-11-30T05:16:12Z")

</div>

I just tried adding it to PMM and it doesnt pick up any of the hosts? Any ideas on how we can fix this? Would be great to use that dashboard, or can I create a dashboard myself or can I only use the Prometheus console to see these stats?

---

<div class="post-metadata">

**Author:** ![andrewkew](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/andrewkew/32/1475_2.png) [@andrewkew](https://forums.percona.com/u/andrewkew)\
**Post date:** [November 30, 2020, 5:40am UTC](https://forums.percona.com/t/adding-additional-prometheus-exporter-to-pmm/8322/9 "2020-11-30T05:40:38Z")

</div>

Just an FYI - I edited that dashboard with the query you mentioned above

```auto
{service_name="apache"}

```

And now all the graphs are working, I just need to work out why its not pulling out the host name and then I think we have a working dashboard  
😃  
For arguments sake if you edit the apache scorecard dashboard and change the query as follows

```auto
apache_scoreboard{service_name="apache"}

```

It now works

(This is more for anyone else’s sake if they come onto this while searching)

Thanks

---

<div class="post-metadata">

**Author:** ![andrewkew](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/andrewkew/32/1475_2.png) [@andrewkew](https://forums.percona.com/u/andrewkew)\
**Post date:** [November 30, 2020, 8:42am UTC](https://forums.percona.com/t/adding-additional-prometheus-exporter-to-pmm/8322/10 "2020-11-30T08:42:22Z")

</div>

Again for anyone that is interested I have resolved the grafana dashboard allowing more than 1 node to be monitored using the apache exporter.

First thing I did was edit the Host variable and pulled out the node name

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

I then edited the graph queries to include this new variable so that the would all switch when changing the node I am looking at

```auto
apache_scoreboard{service_name=~"apache.*",node_name="$host"}

```

What you will notice is that I changed the service name to be a regex (=~) this allows me to add the service to each node I am monitoring and give them all a unique name like apache-hostname1 and then finally added the host variable to the query too so that each graph switches when I updated the variable on the dashboard

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

Hope this helps someone else out there trying to add Prometheus Apache Exporter to their PMM instance.

---

<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:** [November 30, 2020, 9:09am UTC](https://forums.percona.com/t/adding-additional-prometheus-exporter-to-pmm/8322/11 "2020-11-30T09:09:54Z")

</div>

Thank you Andrew.

IMHO service\_name can be removed from formulas. Hardly it will be used more than one apache exporter on the same node.
