# How to monitor the beats using prometheus

**URL:** <https://discuss.elastic.co/t/how-to-monitor-the-beats-using-prometheus/275394>\
**Category:** Beats\
**Tags:** beats-development, metricbeat\
**Created:** [June 9, 2021, 7:59am UTC](https://discuss.elastic.co/t/how-to-monitor-the-beats-using-prometheus/275394 "2021-06-09T07:59:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![PeterFulier](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@PeterFulier](https://discuss.elastic.co/u/PeterFulier)\
**Post date:** [June 9, 2021, 7:59am UTC](https://discuss.elastic.co/t/how-to-monitor-the-beats-using-prometheus/275394/1 "2021-06-09T07:59:57Z")

</div>

Hello,

I am trying to find a way to expose beats (especially the metricbeat) statistics to prometheus to have the option to monitor the correct functionality of metricbeat in terms of its connection to elastic.  
Currently we observed, that in case of disconnection of pods with elastic, the issue is visible in the pod logfile, but this is silent - pods stays running, so the issue is not detected.

Idea would be to detect either the errors directly by prometheus, or alternatively monitor data flow (eg create event when processing is stuck / buffering ...).

Please is there anything you could you eventually advise to use for this scenario?

Many thanks for your help/advices in advance

Kind regards,

Peter

Peter Fulier

---

<div class="post-metadata">

**Author:** ![Mario\_Castro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mario_castro/32/35107_2.png) [@Mario\_Castro](https://discuss.elastic.co/u/Mario_Castro)\
**Post date:** [June 15, 2021, 8:29am UTC](https://discuss.elastic.co/t/how-to-monitor-the-beats-using-prometheus/275394/2 "2021-06-15T08:29:57Z")

</div>

Hi @PeterFulier 🙂 Welcome to the forum

Well, you'll have to write an exporter for Beats, I have no idea if there's one already. But probably you'll find it easier to monitor Metricbeat with another instance of Metricbeat [Use Metricbeat to send monitoring data | Metricbeat Reference [7.13] | Elastic](https://www.elastic.co/guide/en/beats/metricbeat/current/monitoring-metricbeat-collection.html)

---

<div class="post-metadata">

**Author:** ![PeterFulier](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@PeterFulier](https://discuss.elastic.co/u/PeterFulier)\
**Post date:** [June 15, 2021, 10:26am UTC](https://discuss.elastic.co/t/how-to-monitor-the-beats-using-prometheus/275394/3 "2021-06-15T10:26:11Z")

</div>

Hi Mario,

many thanks for the welcome and your reply 🙂

I believe, the additional metricbeat instance will allow sending the information to elastic, but I need to have the issue with metricbeat transformed to the Prometheus alert...

In the meantime I managed to to expose the stats/state json statistics using the http endpoint

> **[Configure an HTTP endpoint for metrics | Metricbeat Reference \[7.13\] | Elastic](https://www.elastic.co/guide/en/beats/metricbeat/current/http-endpoint.html)**

In case of

- running metric beat in standalone mode via configuration
- as docker container using override "-E http.enabled=true" when running it
- and same was achieved when running the metricbeat as kubernetes pod - but here I was expecting the metricbeat configuration propagated to pod via config map (http.enabled: true) would be sufficient, but it was ignored at all, so had to again update the calling the docker to make it work...

With the stats exposed, it should be now hopefully possible to use the available exporters  
[https://hub.docker.com/r/sepa/beats-exporter](https://hub.docker.com/r/sepa/beats-exporter) / [GitHub - trustpilot/beat-exporter: Elastic beat-exporter for Prometheus](https://github.com/trustpilot/beat-exporter)  
to process them to prometheus format and let them scrape via prometheus for alerting...

Kind regards,

Peter

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 13, 2021, 12:26pm UTC](https://discuss.elastic.co/t/how-to-monitor-the-beats-using-prometheus/275394/4 "2021-07-13T12:26:31Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
