-
Notifications
You must be signed in to change notification settings - Fork 549
feat(tracing): Initial tracing experiments #342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
(This is not intended for merging, just for experimenting) |
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 |
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 |
@@ -47,9 +48,15 @@ def dummy_task(x, y): | |||
foo = 42 # noqa | |||
return x / y | |||
|
|||
span_context = SpanContext.start_trace() |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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 thinkrealistically speaking we probably want to use attributes for this.