elastic / elastic/apm-agent-python
Option to set Redis Leaf=False
- Vorherrschende Sprache
- Python
- Sterne
- 431
- Forks
- 239
- Ø Merge
- 5 T. 10 Std.
- Gemergte PRs (30 T.)
- 7
Beschreibung
Hello,
Just to mention that in some cases, Redis can be used as Lock mechanism. (ie https://pypi.org/project/python-redis-lock/).
In that case the code to monitor would look like follow :
```py
from redis_lock import Lock
with Lock("some key") :
#do something
```
In that case, you don't want Redis to be treated as a Leaf, so the rest can be tracked
Right now, all I have is a big redis span for the entire with.
I don't know what would be the best approach for this. perhaps having a class to handle BLPOP ?
https://github.com/ionelmc/python-redis-lock/blob/master/src/redis_lock/__init__.py#L249
https://github.com/redis/redis-py/blob/a87a750ed1a39138ba4526537335012fc95142c9/redis/commands/core.py#L1867
Thx
Beitragsleitfaden
Rechercherichtung
Beginne damit, die referenzierte redis_lock/__init__.py um Zeile 249 und redis-py core.py um Zeile 1867 zu lesen, um den auf BLPOP basierenden Lock-Pfad zu verstehen. Suche anschließend die Redis-Instrumentierung des Agents, um zu erfahren, wie Spans als Leaves markiert werden. Erledigt ist die Aufgabe, wenn die Verwendung von Redis-Locks so konfiguriert oder erkannt werden kann, dass die Arbeit innerhalb des with-Blocks durch Child-Spans statt durch einen einzigen umschließenden Redis-Span dargestellt wird.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python, redis
- Bereich
- databases, observability-sre
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100