Skip to content

Latest commit

 

History

History
39 lines (26 loc) · 959 Bytes

README.md

File metadata and controls

39 lines (26 loc) · 959 Bytes

spoqa-aws-xray-flask-middleware

License PyPI

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/<int:id>/messages

Usage

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

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.