Request URL is not consistent with Transaction name?


Kibana version: 6.6.0

Elasticsearch version:6.6.0

APM Server version:6.6.0

APM Agent language and version: python 4.1.0

My application is a Flask web application. When I'm discovering data in Kibana, I found some documents where the context.request.url.full seems inconsistent with the Is this normal?

(Benjamin Wohlwend @ APM) #2

Hi @fr0der1c

this definitely doesn't look normal, and I don't really have an idea what could cause this. But it does look like there might be some issues with context tracking. Do you per chance use threaded workers (e.g. gunicorn with --threads N)?


I use uWSGI with gevent (preforking+async), here is my configuration:

uwsgi.ini (unrelated code omitted):

# launcher
wsgi-file =
callable = app

# workers
master = true
processes = 4
gevent = 100
thunder-lock = true

lazy-apps = false (unrelated code omitted):

from gevent import monkey

import gc
from my_application import create_app

app = create_app()

my_application/ (unrelated code omitted):

__app = None

    import uwsgidecorators

    def init_log_handlers():
        from elasticapm.contrib.flask import ElasticAPM
        global __app

        # Elastic APM
        if __app.config['CONFIG_NAME'] in __app.config['APM_AVAILABLE_IN']:
  'APM is inited because you are in {} mode.'.format(__app.config['CONFIG_NAME']))

def create_app() -> Flask:
    app = Flask(__name__)

    from my_application.config import get_config
    _config = get_config()

    global __app
    __app = app

    return app

It might be a thread-local-related issue, but I didn't run into another similar issue except for this one.