# Weird specifc Flask App not sending monitoring data to APM

**URL:** <https://discuss.elastic.co/t/weird-specifc-flask-app-not-sending-monitoring-data-to-apm/127183>\
**Category:** APM\
**Created:** [April 8, 2018, 12:14am UTC](https://discuss.elastic.co/t/weird-specifc-flask-app-not-sending-monitoring-data-to-apm/127183 "2018-04-08T00:14:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maethorin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/maethorin/32/22825_2.png) [@Maethorin](https://discuss.elastic.co/u/Maethorin)\
**Post date:** [April 8, 2018, 12:14am UTC](https://discuss.elastic.co/t/weird-specifc-flask-app-not-sending-monitoring-data-to-apm/127183/1 "2018-04-08T00:14:30Z")

</div>

Hi all,

I have 3 Python Flask API running on AWS and a EC2 running ES and APM. 2 APIs are sending data to APM correctly, but one is not.

It's weird, because all 3 API uses same Flask, Flask-RESTful and elastic-apm[flask] versions. They use the same ELASTIC\_APM, changing only the SERVICE\_NAME. Im not using SECRET\_TOKEN. All EC2 are in the same region and they all use the same security group.

I can confirm that the EC2, where the bugged API is, can connect to APM server because I run an ipyhton on the API virtualenv and use the apm created by the API to send an apm.capture\_message() with success. If I put an apm.capture\_message() or an apm.capture\_exception(), these are sent correctly too. The automatic monitoring data is that are not going to the apm-server.

I tailed the apm-server log and the data are not getting there, so I'm strongly believing the problem is in the Flask API. There are differences between the APIs and I think some package in this API are not working well with APM Agent.

I need help to figure out what's going on. I can send more information if you needed. I don't want to put everything here to make this clean, but I can post the pip freeze and the general initialization of Flask API for both environments if this could help.

ty!

---

<div class="post-metadata">

**Author:** ![beniwohli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/beniwohli/32/21256_2.png) [@beniwohli](https://discuss.elastic.co/u/beniwohli)\
**Post date:** [April 9, 2018, 12:28pm UTC](https://discuss.elastic.co/t/weird-specifc-flask-app-not-sending-monitoring-data-to-apm/127183/2 "2018-04-09T12:28:23Z")

</div>

Hi Márcio!

The Python agent should log any issues it has sending data to an `elasticapm.errors` logger. Depending on how exactly your logging is set up (which tends to be different from Flask app to Flask app), you need to add a handler for this logger to see its output.

BTW, which app server do you use? If you're on uWSGI, make sure to [enable threading](http://uwsgi-docs.readthedocs.io/en/latest/Options.html#enable-threads).

Failing that, your requirements.txt and initialization code could indeed help with resolving your problem 🙂

Cheers  
Beni

---

<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:** [April 30, 2018, 8:29am UTC](https://discuss.elastic.co/t/weird-specifc-flask-app-not-sending-monitoring-data-to-apm/127183/3 "2018-04-30T08:29:04Z")

</div>

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