Skip to content

feat(tracing): Initial tracing experiments#342

Merged
untitaker merged 10 commits into
masterfrom
feature/trace-experiments
Apr 29, 2019
Merged

feat(tracing): Initial tracing experiments#342
untitaker merged 10 commits into
masterfrom
feature/trace-experiments

Conversation

@mitsuhiko

Copy link
Copy Markdown
Contributor

This is the most basic hack I could come up with that gets us into the direction
of correlating errors. It currently uses a made up trace context but i think
realistically speaking we probably want to use attributes for this.

@mitsuhiko

Copy link
Copy Markdown
Contributor Author

(This is not intended for merging, just for experimenting)

@untitaker

untitaker commented Apr 16, 2019

Copy link
Copy Markdown
Member

I think we could infer span context from request headers so each server integration doesn't need to change. Possibly even backfill during event processing although if that is necessary tracing is already broken

@mitsuhiko

mitsuhiko commented Apr 16, 2019

Copy link
Copy Markdown
Contributor Author
from flask import Flask
import requests
import sentry_sdk
import sentry_sdk.integrations.flask


sentry_sdk.init(
    dsn='...',
    propagate_traces=['http://localhost:5000'],
    integrations=[sentry_sdk.integrations.flask.FlaskIntegration()]
)


app = Flask(__name__)


@app.route('/')
def call_out():
    return requests.get('http://localhost:5000/broken').json()['foo']


@app.route('/broken')
def broken():
    1 / 0

Comment thread sentry_sdk/integrations/celery.py
foo = 42 # noqa
return x / y

span_context = SpanContext.start_trace()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason why we just can do "new SpanContext"?
The ctor can set the values, since we are not measuring time, this can simplify the API.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For prosperity from a conversation in person: Mostly just so that the ctor will not attempt to auto generate. We can change this, that was just an early draft.

@untitaker
untitaker merged commit a843018 into master Apr 29, 2019
@untitaker
untitaker deleted the feature/trace-experiments branch April 29, 2019 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants