Python APM module not loading exceptions

Kibana version: 8.18.1

Elasticsearch version: 8.18.1 (three nodes cluster)

APM Server version: 8.18.1

APM Agent language and version: Python, 6.23.0

Browser version: Brave

Original install method (e.g. download page, yum, deb, from source, etc.) and version: deb

Fresh install or upgraded from other version?: Fresh install

Is there anything special in your setup?: No

Description of the problem including expected versus actual behavior. Please include screenshots (if relevant):

I'm building a web application using Python 3.11 and the Pyramid framework. Pyramid integration is not included natively in Elastic-APM, so I created a custom tween which I use for a long time, since Python 3.5 (with Elasticsearch 7.17 and Elastic-APM 5.10.1).

Actually, all transactions are visible as usual into Kibana APM dashboard, but I can't see any exception into the "Errors" tab. I don't have any error into web application logs or into APM server journal. When an exception is raised, I only get this line into application logs:

DEBUG [elasticapm.transport.http][eapm event processor thread] Sent request, url=https://apm-server.xxxx.fr:8200/intake/v2/events?flushed=true size=23.96kb status=202

Packet size (23.96kb) is far higher than classic transactions packets size, so I suspect that the exception data is sent to APM server, but nothing is visible in the dashboards...

Hello @tflorac,

To better understand your situation, please provide the versions of Elasticsearch, APM Server, and the APM Python Agent that you're currently using.

I'm not an expert in APM Python Agent, so I can primarily advise you on the APM Server. From the logs you've provided, it appears that the events sent by the python agents were successfully accepted by the APM Server. However, to confirm that everything was indexed correctly, please also check the APM Server logs for any errors. Additionally, since it's a custom instrumentation that you maintain, I suspect there might be an issue with the structure of the events sent to the APM Server. Documents with exceptions usually contain the error.exception field, so please ensure that the relevant documents are returned from the service in question when the following query is run in Elasticsearch.

GET /*apm*/_search
{
    "query": {
        "exists": {
            "field": "error.exception"
        }
    }
}