Unable to create top-level subsegment in image Lambda
@wangzlei ci sta già lavorando.
Dal 24/5/2021.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
I have a Lambda deployed as a Docker image that instantiates a class in the global context. This class is used in various other functions.
I wanted to see how much of the time during instantiation (cold start) was taken up by this class instantiation. However, I can't seem to make a (sub)segment that shows me this in the console.
Minimal reproducible code:
from aws_xray_sdk.core import xray_recorder
from my_classes import BigClass
# Instantiate big class up-front.
xray_recorder.configure(sampling=False)
with xray_recorder.in_segment("instantiate class") as segment: # Have also tried without this line.
with xray_recorder.in_subsegment("instantiate class") as subsegment:
subsegment.put_annotation("key", "value")
big_class = BigClass()
The X-Ray decorators work in other parts of my code so it's not an issue with requirements.txt or my Dockerfile.
Here's the Dockerfile anyway.
FROM public.ecr.aws/lambda/python:3.8
# Install dependencies.
COPY requirements.txt ./
RUN python3.8 -m pip --no-cache-dir install --upgrade pip && python3.8 -m pip --no-cache-dir install -r requirements.txt
# Copy application code and provide entrypoint.
COPY src/index.py ./
CMD ["index.handler"]
How should I trace the instantiation of global objects (top level of a script)?
- Lingua principale
- Python
- Stelle
- 339
- Fork
- 147
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di aws/aws-xray-sdk-python
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
aws/aws-xray-sdk-python#490 · 1 commento ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 1/100
aws/aws-xray-sdk-python#460 ·
-
Next release Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
aws/aws-xray-sdk-python#457 · 1 reazione ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
aws/aws-xray-sdk-python#453 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
aws/aws-xray-sdk-python#452 · 1 reazione ·
Tutte le issue di aws/aws-xray-sdk-python
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
stephrobert/dsoxlab#238 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
sublimehq/package_control#1780 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
nwg-piotr/nwg-displays#145 ·