-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
Return structured data for JS source file and source map Scraping attempts #1300
Comments
I would guess that we also want a "forbidden" or "disabled" result variant for when scraping is disabled. ETA: Actually I believe there are really two reasons for "not attempted": either we already have it or scraping is disabled. Consequently we should split up "not attempted" into two results and remove the reason. |
Also: does your data intentionally only include the URL of the source file, but not that of the sourcemap? |
I think "forbidden" can fall under
Ah, thanks. Good catch! Adjusted. |
Sorry, I intended "forbidden" and "disabled" to be the same thing, I just hadn't decided what the better name was yet (it's probably "disabled"). |
I opened #1311 as a strawman implementation so that we have something to discuss. The pub struct JsScrapingAttempt {
pub url: String,
pub result: JsScrapingResult,
}
pub enum JsScrapingResult {
NotAttempted,
Success,
Failure {
reason: JsScrapingFailureReason,
details: String,
},
}
pub enum JsScrapingFailureReason {
NotFound,
Disabled,
InvalidHost,
PermissionDenied,
Timeout,
DownloadError,
Other,
} So each scraping attempt has a Here is an example from out test fixtures (written in YAML, but you'd be getting it as JSON): scraping_attempts:
- url: "http://example.com/index.html"
result:
Failure:
reason: Disabled
- url: "http://example.com/test.min.js"
result: NotAttempted
- url: "http://example.com/test.min.js.map"
result: NotAttempted This differs from your design above in a few respects.
Are these differences acceptable to you? Is there anything you would like to see changed? |
@loewenheim Thank you! This is great <3 I have a few thoughts.
Is that the case in the event payload we store in eventstore? Would we have to also adjust Sentry to put the sourcemap URL into the stack frame object?
HTTP status isn't too important I would say. I have reservations about the returned payload schema though. IMO it would be cleaner to always return an object in the
That way we don't have to check for the type of Additionally, I would probably return the strings in a bit more pythonian manner, e.g. In general I think we are on the right track! My main concern lies in whether we can actually properly associate source map scraping attempts to the correct stack frame. |
The information already exists in the event JSON you can view on Sentry, if that's what you mean.
That sounds like a good idea and would be easy to change.
You're right, I'll change it to snake_case.
I'll send you an example event that I believe demonstrates that we can. |
What do you think of this? scraping_attempts:
- url: "http://example.com/index.html"
status: failure
reason: disabled
- url: "http://example.com/embedded.js"
status: not_attempted
- url: "http://example.com/embedded.js.map"
status: not_attempted
We could also do the |
Based on our discussion that
No this seems great! Let's do it exactly like that :)
I think a list is fine. It keeps us more flexible down the line. Of course, there is now the cost of having to iterate but the size is bounded anyhow so 🤷 No strong opinions. If we don't have a clear favorite I would opt for a list to be consistent with other mechanisms we have ( |
Makes sense, I'll leave it as a list then. |
For our Source Map Debugger (Blue Thunder Edition™) initiative we require information from Symbolicator about the JS source scraping attempts that have been conducted.
Solution brainstorm
Returned payload (could be nested somewhere):
(TypeScript notation because it's the only language I know 😶🌫️)
The text was updated successfully, but these errors were encountered: