sdk icon indicating copy to clipboard operation
sdk copied to clipboard

[ Breaking Change Request ] Remove Observatory from the Dart VM

Open bkonyi opened this issue 3 years ago • 43 comments

The Observatory developer tooling was developed during the early days of the Dart project to allow for developers to debug, dive into CPU and memory performance characteristics, and inspect program structure of Dart programs. This tool was developed and maintained solely by Dart VM engineers without much input from UX designers, making it powerful for Dart SDK developers but difficult to use by the average Dart developer.

With the development of Dart DevTools by a dedicated team, it no longer makes sense to continue work on Observatory with the associated compatibility and maintenance burdens, especially now that Dart DevTools is at near feature parity with Observatory.

Impact:

Pre-Dart 3.0, users wishing to continue using Observatory will need to pass an --enable-observatory flag for Observatory to be served by the VM. For Dart 3.0, this flag will be removed and remaining Observatory users will be required to move to the new Dart DevTools developer tooling.

Dart DevTools is at near feature parity with Observatory and should meet the needs of the vast majority of Dart developers. Any missing functionality in DevTools that's critical to an individual's workflow should be documented in a new issue on the DevTools issue tracker.

Proposal:

  • Pre-Dart 3.0: place Observatory behind --enable-observatory, making Observatory disabled by default by still available.
  • Dart 3.0: remove the --enable-observatory flag and remove Observatory completely from the SDK.

cc @a-siva @kenzieschmoll @mit-mit

bkonyi avatar Oct 17 '22 13:10 bkonyi

//cc @zanderso

a-siva avatar Oct 18 '22 14:10 a-siva

The --enable-observatory flag should be made available before it is required. This is so that we can make changes to pass the flag without losing access to the Observatory.

zanderso avatar Oct 18 '22 21:10 zanderso

The --enable-observatory flag should be made available before it is required. This is so that we can make changes to pass the flag without losing access to the Observatory.

SGTM.

bkonyi avatar Oct 19 '22 13:10 bkonyi

CL adding support for --[no-]serve-observatory is up for review. Default behavior currently is to implicitly set --serve-observatory.

bkonyi avatar Nov 03 '22 16:11 bkonyi

@vsmenon @Hixie @grouma @zanderso it seems like the comments here have been addressed by @bkonyi . How do we feel about this breaking change request?

itsjustkevin avatar Nov 08 '22 17:11 itsjustkevin

I'm not sure the timeline is achievable, but otherwise the plan sgtm. I also added https://github.com/flutter/devtools/issues/4711 to the tracker.

zanderso avatar Nov 08 '22 18:11 zanderso

lgtm with the caveat that the performance of devtools is acceptable to the engineers who currently use observatory

a-siva avatar Nov 09 '22 17:11 a-siva

lgtm

vsmenon avatar Nov 09 '22 17:11 vsmenon

@bkonyi do you find you have enough time to implement this?

itsjustkevin avatar Nov 09 '22 17:11 itsjustkevin

The initial work needed to allow for disabling Observatory by default is already up for review. Once that change lands and flutter_tools has the right plumbing for --serve-observatory, we can go ahead and change the default behavior to not serve Observatory.

bkonyi avatar Nov 09 '22 17:11 bkonyi

Thanks @bkonyi, only thing left to address here is the comment by @a-siva.

itsjustkevin avatar Nov 09 '22 17:11 itsjustkevin

@bkonyi --serve-observatory needs to be a flag that the Engine can pass to Dart_SetVMFlags. Is that what your change did?

zanderso avatar Nov 09 '22 20:11 zanderso

@bkonyi --serve-observatory needs to be a flag that the Engine can pass to Dart_SetVMFlags. Is that what your change did?

@zanderso I think we'll just need to make a change here in the engine to allow for this option to be set.

bkonyi avatar Nov 15 '22 18:11 bkonyi

@bkonyi That sounds plausible to me, but you'd be the expert on where and when the new flag needs to be set in the service isolate code.

zanderso avatar Nov 15 '22 23:11 zanderso

Many gaps in functionality between Observatory and DevTools are filed under this tag

rmacnak-google avatar Nov 16 '22 23:11 rmacnak-google

Sorry for my ignorance, will we also remove the --observe= flag?

srawlins avatar Jan 31 '23 01:01 srawlins

@bkonyi and @rmacnak-google are we planning on keeping this open until all issues in this tag are resolved?

itsjustkevin avatar Feb 03 '23 14:02 itsjustkevin

@bkonyi and @rmacnak-google are we planning on keeping this open until all issues in this tag are resolved?

I don't know if we'll end up porting everything under that tag as some of the functionality isn't critical / widely used, so we'll need to make a judgement call at some point.

Sorry for my ignorance, will we also remove the --observe= flag?

@srawlins definitely not :-)

bkonyi avatar Mar 09 '23 15:03 bkonyi

CL to disable serving Observatory by default is up for review.

bkonyi avatar Mar 09 '23 15:03 bkonyi

Thanks @bkonyi.

CC: @XilaiZhang and @caseyhillers as this may impact flutter rolls.

itsjustkevin avatar Mar 09 '23 21:03 itsjustkevin

@bkonyi looks like this landed, but got reverted?

mit-mit avatar Apr 17 '23 08:04 mit-mit

@mit-mit that's correct. We were having issues getting this landed among all the other breaking changes and it was decided this was lower priority to get into 3.0. We're going to target the next stable release instead.

bkonyi avatar Apr 17 '23 12:04 bkonyi

OK, thanks

mit-mit avatar Apr 17 '23 12:04 mit-mit

@bkonyi is this still something we are considering?

itsjustkevin avatar Jun 09 '23 16:06 itsjustkevin

It is, there's just a long tail of issues that we're working through. We've already disabled Observatory by default in the SDK and Flutter, so the actual work to remove Observatory should hopefully happen in the next few quarters.

bkonyi avatar Jun 09 '23 16:06 bkonyi

While I was aware of the intent to direct Dart developers to use DevTools instead of Observatory I didn't realise there was also the intent to completely remove the Observatory 😞

@mit-mit What is the recommendation for developers wanting to use functionality that was previously in Observatory that is not available in DevTools in the "VMTools" tab with "VM Developer Mode" enabled?

And given this has happened, why on earth is the above labelling used in DevTools?? I am pretty sure I am not doing any "VM development" yet I find it very necessary to use the tooling that is still available for Isolates in my Dart cli app project that involves using Isolates heavily.

maks avatar Aug 23 '23 04:08 maks

@maks please file feature request issues for what functionality you are missing, describing the use case you would use them for.

mit-mit avatar Aug 23 '23 14:08 mit-mit

@mit-mit What is the recommendation for developers wanting to use functionality that was previously in Observatory that is not available in DevTools in the "VMTools" tab with "VM Developer Mode" enabled?

And given this has happened, why on earth is the above labelling used in DevTools?? I am pretty sure I am not doing any "VM development" yet I find it very necessary to use the tooling that is still available for Isolates in my Dart cli app project that involves using Isolates heavily.

@maks We went with "VM Developer Mode" since the vast majority of the features behind that flag are only relevant to individuals working on the Dart VM. As Michael suggested, if there's any features that you use in Observatory that haven't been migrated to DevTools, please file an issue in the DevTools repo describing the feature (screenshots from Observatory would be very helpful!) and how you use it in your workflow. Feel free to cc me on the issue.

Also, if you need access to Observatory for tooling that isn't available in DevTools yet, you can either pass --serve-observatory to dart or navigate to http://<vm_service_uri>/_serveObservatory to enable Observatory.

bkonyi avatar Aug 23 '23 17:08 bkonyi

Checking in again with @Hixie @vsmenon and @grouma for this breaking change.

itsjustkevin avatar Aug 28 '23 20:08 itsjustkevin

I'm a bit confused as to what is being proposed here. Are --enable-observatory and --serve-observatory different? Does this actually remove observatory or will it still be there but less accessible?

Hixie avatar Aug 28 '23 23:08 Hixie