Closed
Description
Describe the bug: ...
[host: noj-59dfd94498-45jdw|pid: 24294|timestamp: 1564716068.956608] [ERROR|elasticapm.errors:188] Exception during timing of request
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/elasticapm/contrib/django/middleware/__init__.py", line 185, in process_response
elasticapm.set_context(lambda: self.client.get_user_info(request), "user")
File "/usr/local/lib/python3.7/dist-packages/elasticapm/traces.py", line 410, in set_context
transaction.context[key].update(data)
TypeError: 'function' object is not iterable
Related codes:
apm-agent-python/elasticapm/traces.py
Lines 615 to 631 in ae1c777
And when I print data
when meeting exception, the output is:
<function TracingMiddleware.process_response.<locals>.<lambda> at 0x7f39e36a00e0>
I guess maybe we have to deal with the situation that data
is callable and transaction.is_sampled == False
.
Expected behavior:
set_context()
should handle data
in lambda type well.
Environment (please complete the following information)
- OS: Linux
- Python version: 3.7.4
- Framework and version: Django 2.1.9
- APM Server version: -
- Agent version: 4.2.2
Metadata
Metadata
Assignees
Labels
No labels