An open API service indexing awesome lists of open source software.

https://github.com/spoqa/aws-xray-flask-middleware

Spoqa flavoured AWS X-Ray middleware for Flask
https://github.com/spoqa/aws-xray-flask-middleware

Last synced: 16 days ago
JSON representation

Spoqa flavoured AWS X-Ray middleware for Flask

Awesome Lists containing this project

README

          

# spoqa-aws-xray-flask-middleware

[![License](https://badgen.net/badge/license/MIT/cyan)](LICENSE)
[![PyPI](https://badgen.net/pypi/v/spoqa-aws-xray-flask-middleware)](https://pypi.org/project/spoqa-aws-xray-flask-middleware/)

Spoqa flavoured AWS X-Ray middleware for Flask

**Before**:

```
https://example.com/api/12345/messages
http://localhost:8000/api/32123/messages
http://127.0.0.1/api/43434/messages
...
```

**After**:

```
//service_name/api//messages
```

## Usage

Replace `aws_xray_sdk.ext.flask.middleware.XRayMiddleware` with `spoqa_aws_xray_flask_middleware.XRayMiddleware`

```python
from aws_xray_sdk.core import xray_recorder
from spoqa_aws_xray_flask_middleware import XRayMiddleware

app = Flask(__name__)

xray_recorder.configure(service='fallback_name', dynamic_naming='*mysite.com*')
XRayMiddleware(app, xray_recorder)
```

## License

_spoqa-aws-xray-flask-middleware_ is licensed under the terms of [MIT License](LICENSE).