Python flask agent - nfailed to submit message


(sebastian) #1

Hello all,

i installed the apm server and runing

after using a flask app only for testing the apm agent
i'm getting an error from the agent perspective

Connection to APM Server timed out (url: http://X.X.X.X:8200/v1/errors, timeout: None seconds)
Failed to submit message: ''
Connection to APM Server timed out (url: http://X.X.X.X:8200/v1/transactions, timeout: None seconds)
Failed to submit message: ''

in the app view, i'm not using a token in the apm

configure to use ELASTIC_APM in your application's settings from elasticapm.contrib.flask import ElasticAPM

app.config['ELASTIC_APM'] = {
# allowed app_name chars: a-z, A-Z, 0-9, -, _, and space from elasticapm.contrib.flask
'APP_NAME': 'yourApplicationName',
#'SECRET_TOKEN': 'yourToken', #if you set on the APM server configuration
'SERVER_URL': 'http://X.X.X.X:8200' # your APM server url
}

the status in the apm server of firewalld is stopped

so how can i debug this event to see the real cause that the apm server is not receiving the message from the agent?
please can you help me with this?


(sebastian) #2

it was running the the loopback, u changed it to 0.0.0.0 in the apm-server options to run it
thanks!!

but right now i have this error http400 - Problem Validation JSON Document
expected string, but got nul

do i have to change a setting in the .yaml of the server??


(Benjamin Wohlwend @ APM) #3

Hi @sebasd44

judging from the schema validation error, you need to set a service_name for your Flask app, either by setting an ELASTIC_APM_SERVICE_NAME environment variable, or by configuring the ElasticAPM object directly as shown in our Flask docs.


(sebastian) #4

Thanks a lot mate, that was the missing part! you were extremely helpful!


(Benjamin Wohlwend @ APM) #5

Awesome! I will look into how we can make the experience a bit better when the service name isn't set (we should print a proper warning instead of the somewhat cryptic schema validation).

Let us know if you hit any other problems!


(sebastian) #6

Excellent, thanks a lot for your help!!
very criptic schema validation! hahaha
have a good day Beniwohli
Best Regards


(system) #7

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