Open jmarantz opened 5 years ago
@jmarantz my gut check is this should be an extension. Today I don't think we explicitly allow statically loadable admin extensions, but I think it would be pretty trivial to do.
I like the idea of allowing extensions to add custom admin endpoints. It seems like that might be pretty useful, though most of them probably can do what they need with added stats.
We do actually allow extensions to add endpoints, see admin.h exposed via most extension contexts. This would be potentially adding specific admin extensions that are statically registered.
As a reminder to myself, this functionality can also be mostly realized in an external site that just needs to be told where to fetch the Envoy admin json. I think we'd need to add access-control-allow-origin
to the stats json response headers.
In fact this could be serverless (running on Firebase or whatever), if the admin endpoint was accessible on the internet :)
This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or other activity occurs. Thank you for your contributions.
@yanavlasov
I've been mulling this over with respect to performance issues with 10k clusters or more, giving you ~ 1M stats.
It might be essential to offer a paginated interface, and/or a hierarchical one based on scopes.
The Envoy stats system is designed to be connected to a rich statistics visualization system via a stats-sink.
However it might be nice when looking on a single admin site, without having hooked up other visualization systems, to get a richer view of those stats. It's a balance of course because anything really rich should be handled by a dedicated system. But I just wanted to get a taste-test for the possibility of making the in-server stats endpoint potentially a little richer.
The PageSpeed stats system's default display of just raw counters might be cheap/simple enough to consider including by default:
One benefit of this over the raw text display is that you can click a button to toggle between sorting alphabetically and sorting between how many times that stat has changed on the server since the page was brought up -- it just keeps its state local in the browser in JS so it's pretty simple. That way you can monitor for stats getting bumped even if you have many thousands of them.
The main technical challenge bringing this into Envoy is maintaining the JS that does this and serving it statically. In PageSpeed that's done by "compiling" the JS into C strings which are linked into the server binary. Other than that, the data is already there and available via JSON so the JS has what it needs.
You can see this in action here: https://www.modpagespeed.com/pagespeed_admin/statistics -- just turn on auto-refresh and the checkbox next to "Number of changes". The UI isn't great but it works. You can make the server do something interesting while the stats page is up by (say) visiting rewrite_images in another tab and refreshing a few times.
I'd been thinking about doing this as a plane-project or something sometime, but figured I'd better see if folks think this would be worthwhile or not.