@elasticapm.capture_span not working in some modules

Decorator elasticapm.capture_span doesnt work in some modules while working in others. I dont do anything except importing elasticapm, so may be there are other dependencies?
Anyone knows how to debug decorators and can share an advice?

Hi Алексей

Can you provide some examples for when the decorator works and when it doesn't? Currently, there are a few limitations:

  • capture_span only captures data if there is a transaction going on (either an automatic transaction when using Django/Flask/Celery, or when starting a transaction manually)
  • Only spans in the main thread are captured
  • no support for asyncio

I just figured that out, I mean not working with async part.

capture_span works wherever async wasn't used. Thanx anyway.

btw any news on whether support for asyncio is planned or not?

We do plan to investigate how exactly we can support asyncio in the coming weeks. At the moment, the most promising approach is to use the newly released contextvars to store transaction state. Of course, this would limit support to Python 3.7+ only. Would that be a problem for you?

I hope not. I'll check that out, thank you very much.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.