Giter Club home page Giter Club logo

xrayvision's Introduction

NOTE

AWS has released the beta version of their Python X-ray SDK - check it out here: https://aws.amazon.com/about-aws/whats-new/2017/08/aws-x-ray-sdk-for-python-beta/

xrayvision

Utilities and wrappers for using AWS X-Ray with Python

WSGI Apps

Simply add the middleware to your app. For example, if you use Flask:

from xrayvision.ext.wsgi import XRayMiddleware

app = Flask(__name__)
app.wsgi_app = XRayMiddleware(app.wsgi_app)

You can add subsegments with the global_segment:

from xrayvision import global_segment

...

with global_segment.add_subsegment('my custom loop') as segment:
    try:
        # do stuff
    except:
        segment.add_exception()

Requests

Requests must be patched as early as possible in your code.

import requests
import xrayvision

xrayvision.patch('requests')

xrayvision's People

Contributors

mathom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

xrayvision's Issues

OPTIONS Method thorw 500 error

Hi. I'm using Zappa with xrayvision.

It works almost normarlly, But when i requested with OPTIONS method throw exception.

Response

"{u'message': u'An uncaught exception happened while servicing this request. You can investigate this with the `zappa tail` command.', u'traceback': ['Traceback (most recent call last):\\n', '  File \"/var/task/handler.py\", line 433, in handler\\n    response = Response.from_app(self.wsgi_app, environ)\\n', '  File \"/var/task/werkzeug/wrappers.py\", line 859, in from_app\\n    return cls(*_run_wsgi_app(app, environ, buffered))\\n', '  File \"/var/task/werkzeug/test.py\", line 886, in run_wsgi_app\\n    buffer.append(next(app_iter))\\n', '  File \"/var/task/werkzeug/wsgi.py\", line 693, in __next__\\n    return self._next()\\n', 'StopIteration\\n']}"

But in the AWS X-Ray, I can see that request status is 200 OK.

Dose this problem happen only to me?

Needs sampling

Not every trace should make it to X-ray - implement a sampling algorithm

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.