grafana / explore-logs

Repo for the Loki log exploration app
GNU Affero General Public License v3.0
236 stars 7 forks source link

Exposed service logs view #498

Open kozhuhds opened 3 days ago

kozhuhds commented 3 days ago

Exposed service logs view for other Grafana plugins to consume.

CLAassistant commented 3 days ago

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

gtk-grafana commented 3 days ago

Please note that this PR will probably need some updates after the https://github.com/grafana/explore-logs/pull/477 is merged

kozhuhds commented 3 days ago

yeah, after #477 is merged it is becoming a way harder to expose the service logs view since now it contains browser history pushes/redirects everywhere. Not sure how to approach this since at the end of the day it will be just a copy of existing scene components (but without redirects)

cc @gtk-grafana @jarben

jarben commented 3 days ago

yeah, after #477 is merged it is becoming a way harder to expose the service logs view since now it contains browser history pushes/redirects everywhere. Not sure how to approach this since at the end of the day it will be just a copy of existing scene components (but without redirects)

cc @gtk-grafana @jarben

Outch

gtk-grafana commented 3 days ago

yeah, after #477 is merged it is becoming a way harder to expose the service logs view since now it contains browser history pushes/redirects everywhere. Not sure how to approach this since at the end of the day it will be just a copy of existing scene components (but without redirects)

I'll discuss this with the squad tomorrow morning, but with #477 we were addressing user feedback that it's super frustrating that the entire app has a single entry in the browser history, i.e. going back in history would delete everything you did in the app and take you to the last page before entering the app, and there's no way to go forward again after going back so users were forced to manually re-add their filters every time they went back.

I would expect that this would work the same way as split panes in explore, where url parameters are stored in an array of panes, and state changes are pushed to location history and can be traversed in the same order as the user's actions in the any of the panes. This should allow the embedding application to sync state between panes without degrading the UX.

The only functional part of the URL right now is the slug (last part of the path), I imagine it wouldn't be too much work to update the code to store/retrieve the slug from the search parameters instead.

Is there a design doc for embedding scene apps within other apps/core?

jarben commented 3 days ago

yeah, after #477 is merged it is becoming a way harder to expose the service logs view since now it contains browser history pushes/redirects everywhere. Not sure how to approach this since at the end of the day it will be just a copy of existing scene components (but without redirects)

I'll discuss this with the squad tomorrow morning, but with #477 we were addressing user feedback that it's super frustrating that the entire app has a single entry in the browser history, i.e. going back in history would delete everything you did in the app and take you to the last page before entering the app, and there's no way to go forward again after going back so users were forced to manually re-add their filters every time they went back.

I would expect that this would work the same way as split panes in explore, where url parameters are stored in an array of panes, and state changes are pushed to location history and can be traversed in the same order as the user's actions in the any of the panes. This should allow the embedding application to sync state between panes without degrading the UX.

The only functional part of the URL right now is the slug (last part of the path), I imagine it wouldn't be too much work to update the code to store/retrieve the slug from the search parameters instead.

Is there a design doc for embedding scene apps within other apps/core?

An option is also if the extension does its own routing using extension params by bypassing the url routing and using components directly..

kozhuhds commented 14 hours ago

hey, prepared a product DNA for this feature.

@jarben @gtk-grafana