-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
cmd/trace: requires HTML imports, which doesn't work on any major browser anymore #34374
Comments
In this document, Google Chrome team describes the steps required to move a project from WemComponents v0. I think the change in existing trace-viewer was expected in catapult-project/catapult#4449 but it doesn't seem anything is moving now. |
With Chrome 80 now being stable, this means |
See also https://crbug.com/1021137 Workaround:
|
Perhaps, as a stop-gap, a member of the Go team could register such a token and commit it? I’m not sure if it’s okay for me to get a token and use it like that. |
Sigh. We can do that, but I often had to run multiple instances of execution trace viewer and allowing a single port limits its usability. Is it an option to fork the repo and apply changes like https://chromium-review.googlesource.com/c/1093433? |
Is the problem here how we get the data from the http request into a place where the trace viewer can render it? If so, one solution is to have go trace emit a single standalone file, with the data embedded in it. (See also the various links in that issue.) I did this as part of a different effort, killed by Russ, back around Go 1.8 days: josharian@a5a9f75#diff-f3a5f1780e7f702229cc143e633fd754R12. |
@josharian Reading the bug @stapelberg linked, the problem seems to be that the traceviewer itself heavily depends on the deprecated features and requires migration. traceviewer doesn't sound trivial reading https://crbug.com/1021137. I also tried to manually load the jsontrace output from @stapelberg does the workaround #34374 (comment) work for you? I still couldn't make it working :-( I found https://chromium-review.googlesource.com/c/catapult/+/1906771/10/tracing/tracing_examples/trace_viewer.html |
@egonelbre investigated rebuilding traceviewer in #11520. Hopefully it won't come to that, though. |
Yeah, it works for me. Did you register an origin trial for 127.0.0.1? Need to use that, not localhost. (Or open localhost:8003 explicitly in your browser.) |
Thanks. that works for me. I was told that the traceviewer dev is working on a fix which may be available within one or two weeks. Not sure if we can make it before 1.14 release though. We also need a long term transition plan. Chrome/android are moving away from trace viewer and transitioning to perfetto.dev. |
Ah, cool. Are you suggesting go tool trace does that? That’d solve the issue for a little while without restricting port selection.
I briefly looked at perfetto today and it seemed super complex. I’m guessing they mean a stripped-down, self-contained version of parts of perfetto’s ui? |
Change https://golang.org/cl/219117 mentions this issue: |
@stapelberg Looking at the cmd/internal/browser... I want to avoid all the browser launch business. It's tricky to start a chrome from mac with a complete new set of flag (without killing the existing instance). the cl/219117 follows your proposal. I am not sure whether the fix trace viewer team is talking about will address our issue. |
I am waiting for the progress on the trace viewer side - we are still not sure if that will fix our and other trace viewer users issue that depend on embedding the vulcanized trace viewer. For now, please fetch/build with https://golang.org/cl/219117 and use the ports 8000-8003 of 127.0.0.1. Or launch a chrome with the suggested flag: Sorry for the inconvenience. |
On safari 13.0.5, |
Hi, guys, I created a repository following Update: use official patches now, https://go-review.googlesource.com/q/Ib575f756f5e6b22ad904ede6e4d224a995ebe259 https://github.com/kumakichi/patch-go-tool-trace just go get and run (maybe sudo is needed) |
Change https://golang.org/cl/219997 mentions this issue: |
In case someone is on a rush, to apply the fix without delving in Gerrit, you can download the commit that fixes the issue of Go Trace from the official repository https://go.googlesource.com/go/+/47881b88c4f68bac7a002ea26753b7f042ee720a (download the .tgz)
Running |
I just submitted cl/219997. We think this is too risky to include to 1.14. We plan to add it to the first patch release. Meanwhile, you can compile or download the latest developer version of Go (e.g. https://godoc.org/golang.org/dl/gotip) and use the execution tracer included in it. @gopherbot please backport to 1.13 and 1.14 |
Backport issue(s) opened: #37342 (for 1.13), #37343 (for 1.14). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://golang.org/wiki/MinorReleases. |
Change https://golang.org/cl/220323 mentions this issue: |
Change https://golang.org/cl/220321 mentions this issue: |
…yfill Old trace viewer stopped working with Chrome M80+ because the old trace viewer heavily depended on WebComponents V0 which are deprecated. Trace viewer recently migrated to use WebComponents V0 polyfill (crbug.com/1036492). This CL brings in the newly updated trace_viewer_full.html (sync'd @ 9508452e) and updates the javascript snippet included in the /trace endpoint to use the polyfill. This brings in webcomponents.min.js copied from https://chromium.googlesource.com/catapult/+/9508452e18f130c98499cb4c4f1e1efaedee8962/third_party/polymer/components/webcomponentsjs/webcomponents.min.js That is necessary because the /trace endpoint needs to import the vulcanized trace_viewer_full.html. It's possible that some features are not working correctly with this polyfill. In that case, report the issue to crbug.com/1036492. There will be a warning message in the UI (yellow banner above the timeline) which can be hidden by clicking the 'hide' button. This allows to render the trace in browsers other than chrome in theory, but I observed some buttons and functions still don't work outside chrome. Updates #34374. Fixes #37342. Change-Id: Ib575f756f5e6b22ad904ede6e4d224a995ebe259 Reviewed-on: https://go-review.googlesource.com/c/go/+/219997 Run-TryBot: Hyang-Ah Hana Kim <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Austin Clements <[email protected]> (cherry picked from commit 75ea964) Reviewed-on: https://go-review.googlesource.com/c/go/+/220321 Run-TryBot: Dmitri Shuralyov <[email protected]>
…yfill Old trace viewer stopped working with Chrome M80+ because the old trace viewer heavily depended on WebComponents V0 which are deprecated. Trace viewer recently migrated to use WebComponents V0 polyfill (crbug.com/1036492). This CL brings in the newly updated trace_viewer_full.html (sync'd @ 9508452e) and updates the javascript snippet included in the /trace endpoint to use the polyfill. This brings in webcomponents.min.js copied from https://chromium.googlesource.com/catapult/+/9508452e18f130c98499cb4c4f1e1efaedee8962/third_party/polymer/components/webcomponentsjs/webcomponents.min.js That is necessary because the /trace endpoint needs to import the vulcanized trace_viewer_full.html. It's possible that some features are not working correctly with this polyfill. In that case, report the issue to crbug.com/1036492. There will be a warning message in the UI (yellow banner above the timeline) which can be hidden by clicking the 'hide' button. This allows to render the trace in browsers other than chrome in theory, but I observed some buttons and functions still don't work outside chrome. Updates #34374. Fixes #37343. Change-Id: I0f369b15349dd0f4718c261ec23dfab6a47ace2f Reviewed-on: https://go-review.googlesource.com/c/go/+/219997 Run-TryBot: Hyang-Ah Hana Kim <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Austin Clements <[email protected]> (cherry picked from commit 75ea964) Reviewed-on: https://go-review.googlesource.com/c/go/+/220323
thank you |
This is pretty cool, because it now works in Firefox as well 🎉 |
#34374 (comment) |
This affects "View trace" on the web UI when running
go tool trace
. It doesn't matter what the contents of the trace are; they can be from any test, for example viago test -trace=trace.out
.On Chromium 77.0.3865.75 it works, although with some warnings:
On Firefox 69.0, it simply doesn't work at all.
http://localhost:$PORT/trace
appears as a blank page. The log shows why:The underying cause is that FireFox, as well as many other browsers, don't support HTML imports. I'm not sure if they were ever widespread, but they're clearly deprecated and non-portable at the moment. See https://caniuse.com/#feat=imports and https://developer.mozilla.org/en-US/docs/Web/Web_Components/HTML_Imports.
I realise that the docs say:
However, I don't find that to be a good long-term plan. The tool shouldn't depend on deprecated non-portable features, and it should work on all major browsers.
I've been recommending that Go developers make use of
go tool trace
alongsidego tool pprof
, but it feels much less useful if it needs a "only works on Chrome" footnote :)/cc @hyangah
The text was updated successfully, but these errors were encountered: