Closed
Description
Describe the bug:
https://github.com/elastic/apm-agent-python/blob/main/elasticapm/traces.py#L1092
When neither Transaction nor client is present, elasticapm.label( . . .)
will fail while trying do print a warning.
This can happen for example when testing routes with fastapi.
Open Question would be whether the warning should be printed if no client is present.
I think it makes sense to do this since this is also the default from the config.
To Reproduce
import elasticapm
elasticapm.label(foo="foo")
Environment (please complete the following information)
- OS: Tested on Linux and Mac but should appear everywhere else
- Python version: Tested on 3.9/3.10
- Agent version: 6.10.1