Skip to content

[APM] Kibana errors on "constructor" keyword in APM stack trace documents #99526

@adpeters

Description

@adpeters

Versions
Kibana: 7.12.1
APM Server: 7.12.1
Elasticsearch: 7.12.1

Kibana cannot view certain error documents sent by APM. I am using the latest python APM agent (6.1.3) with a Flask application. When there are error stack traces sent by APM the documents contain the variables at the time of the error, which sometimes contain a "constructor" field. In particular, in my case this is true for SQL-Alchemy errors, but it could exist in many cases. With recent changes to the elasticsearch-js library, Kibana errors when trying to parse these documents, so they cannot be viewed in the APM error view. I believe this is related to elastic/elasticsearch-js#1408. There is a configuration value for that library to get around this issue by allowing the "constructor" keyword, but I'm not sure if there's a way to specify this configuration in Kibana.

A simple way to reproduce this is:

  • Run latest Elastic stack with Elastic, Kibana, APM-Server
  • Run a python application with the python APM agent
  • Trigger an error within a function that has a parameter called "constructor"
  • Attempt to view that particular error in the Kibana APM error view (it displays in the list view fine, but cannot be displayed in detail).

The error in the Kibana logs is:
{"type":"log","@timestamp":"2021-05-06T16:43:44+00:00","tags":["error","http"],"pid":6,"message":"WrappedElasticsearchClientError: Object contains forbidden prototype property\n at /usr/share/kibana/x-pack/plugins/observability/server/utils/unwrap_es_response.js:66:11\n at runMicrotasks (<anonymous>)\n at processTicksAndRejections (internal/process/task_queues.js:93:5)\n at /usr/share/kibana/x-pack/plugins/apm/server/lib/errors/get_error_group_sample.js:75:18\n at /usr/share/kibana/x-pack/plugins/apm/server/routes/create_api/index.js:180:26\n at Router.handle (/usr/share/kibana/src/core/server/http/router/router.js:163:30)\n at handler (/usr/share/kibana/src/core/server/http/router/router.js:124:50)\n at exports.Manager.execute (/usr/share/kibana/node_modules/@hapi/hapi/lib/toolkit.js:60:28)\n at Object.internals.handler (/usr/share/kibana/node_modules/@hapi/hapi/lib/handler.js:46:20)\n at exports.execute (/usr/share/kibana/node_modules/@hapi/hapi/lib/handler.js:31:20)\n at Request._lifecycle (/usr/share/kibana/node_modules/@hapi/hapi/lib/request.js:370:32)\n at Request._execute (/usr/share/kibana/node_modules/@hapi/hapi/lib/request.js:279:9) {\n originalError: DeserializationError: Object contains forbidden prototype property\n at Serializer.deserialize (/usr/share/kibana/node_modules/@elastic/elasticsearch/lib/Serializer.js:43:13)\n at onBody (/usr/share/kibana/node_modules/@elastic/elasticsearch/lib/Transport.js:299:41)\n at IncomingMessage.onEnd (/usr/share/kibana/node_modules/@elastic/elasticsearch/lib/Transport.js:260:11)\n at IncomingMessage.emit (events.js:327:22)\n at endReadableNT (internal/streams/readable.js:1327:12)\n at processTicksAndRejections (internal/process/task_queues.js:80:21)..."}

I'm not sure exactly where the best place to address this issue is, or if there is a configuration workaround of some sort.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Team:APM - DEPRECATEDUse Team:obs-ux-infra_services.bugFixes for quality problems that affect the customer experience

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions