appsignal/appsignal-python

Backtraces are not detected as Python backtraces

tombruijn opened this issue · 1 comments

When sending any kind of error backtrace the python language_integration_version isn't being picked up as Python for some reason.

The appsignal.log seems correct to list: language_integration_version: Some("python-0.1.1")
But the backtrace has the wrong format:

[2023-06-07T12:23:28 (agent) #413][Trace] Add OpenTelemetry exception to span: name: "ValueError" message: "Something went wrong" backtrace_json: "Traceback (most recent call last):\n  File \"/usr/local/lib/python3.11/site-packages/appsignal/cli.py\", line 299, in run\n    raise ValueError(\"Something went wrong\")\nValueError: Something went wrong\n"

It should be using backtrace, not backtrace_json, and not include lines that don't start with File.

Something must be wrong with the language detection, but we set the _APPSIGNAL_LANGUAGE_INTEGRATION_VERSION correctly.

The language integration is empty for the agent aggregator.

It should by default use the one from the config. Turns out the aggregator gets initialized with the language_integration_version from the config, but not the collector payload. We set it much later on the collector payload, so we can't use it to fetch the language integration version.

Either set it on the collector payload on initialization or have the HttpMessage handler check both the config and the OpenTelemetry resource attribute, and I prefer the former.