aws / aws/aws-xray-sdk-python

xray_recorder.capture decorator does not show anything on XRAY

Ouverte
#199 2 commentaires 2 réactions 0 personnes assignées Voir sur GitHub
stale
Langage dominant
Python
Étoiles
339
Forks
147
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

I am using Flask to handle requests in my application. My application is on ECS Fargate and I have a separated Docker container in which the XRay daemon resides on it. XRay console shows the requests coming to Flask correctly. So far so good. Here is the code snippet for using Flask middleware:

```
app = Flask(__name__)
xray_recorder.configure(
service="APP",
sampling=True,
context_missing='LOG_ERROR',
plugins=('ECSPlugin',),
daemon_address='127.0.0.1:2000'
)

XRayMiddleware(app, xray_recorder)
```

My problem is when I using `xray_recorder.capture` decorator to my function in other python files, XRay won't show me anything. Here is the code that I used:

```
from aws_xray_sdk.core import xray_recorder
class Test:
def __init__(self):
pass

@xray_recorder.capture('## run')
def run(self):
...
...
...

```

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Start with the Flask middleware configuration and the @xray_recorder.capture('## run') decorator on Test.run. Reproduce the request, then compare the middleware-created trace with the decorated method; done means the decorated call appears in the X-Ray console.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
aws, flask, python
Domaine
backend, cloud, observability-sre
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
À clarifier
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.