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

FR: Dashboard restored from previous versions #4638

Closed
utkarshcmu opened this Issue Apr 10, 2016 · 11 comments

Comments

Projects
None yet
4 participants
@utkarshcmu
Contributor

utkarshcmu commented Apr 10, 2016

One should be able to restore a dashboard from a previous version of it if needed. If we can save the history of the dashboard in a history table, then we can always restore it back from any previous version. This will also allow us to see what changes were made in every version by doing a JSON diff.

Also, this feature might get heavy on the database so we can keep this feature configurable for the user if he wants to turn this feature or not.

Somewhat related to #1504

@utkarshcmu

This comment has been minimized.

Show comment
Hide comment
@utkarshcmu

utkarshcmu Apr 11, 2016

Contributor

@torkelo
Started some work in https://github.com/utkarshcmu/grafana/tree/history
It would be great if you can create a history branch in grafana/grafana, where I can merge my changes one by one, and then can be easily reviewed by you and other project collaborators.
Thanks!!!

Contributor

utkarshcmu commented Apr 11, 2016

@torkelo
Started some work in https://github.com/utkarshcmu/grafana/tree/history
It would be great if you can create a history branch in grafana/grafana, where I can merge my changes one by one, and then can be easily reviewed by you and other project collaborators.
Thanks!!!

@torkelo

This comment has been minimized.

Show comment
Hide comment
@utkarshcmu

This comment has been minimized.

Show comment
Hide comment
@utkarshcmu

utkarshcmu Apr 21, 2016

Contributor

@torkelo @bergquist

I have implemented the following in #4653

  1. While saving a dashboard json in the dashboard table, your dashboard json will also be saved in dashboard history table.
  2. When deleting a dashboard, rows corresponding to that dashboard in the dashboard history table will also be deleted automatically.

Now, how should we give the user the option to restore his dashboard from the history and compare any of the previous versions with the current version? This is somewhat tricky!!!

IMO, as the first version of the dashboard history feature,

  1. We can give the user an option to download historical JSON.
  2. Show a JSON diff between current and any historical version - https://github.com/flitbit/diff

Any thoughts?

Contributor

utkarshcmu commented Apr 21, 2016

@torkelo @bergquist

I have implemented the following in #4653

  1. While saving a dashboard json in the dashboard table, your dashboard json will also be saved in dashboard history table.
  2. When deleting a dashboard, rows corresponding to that dashboard in the dashboard history table will also be deleted automatically.

Now, how should we give the user the option to restore his dashboard from the history and compare any of the previous versions with the current version? This is somewhat tricky!!!

IMO, as the first version of the dashboard history feature,

  1. We can give the user an option to download historical JSON.
  2. Show a JSON diff between current and any historical version - https://github.com/flitbit/diff

Any thoughts?

@torkelo

This comment has been minimized.

Show comment
Hide comment
@torkelo

torkelo Apr 22, 2016

Member

think a simple "restore" and "open" open should good (restore = save over current with old version, open works similar to import, it will open a unsaved dashboard).

json diff would be nice but not needed for v1 of the feature I think .

Member

torkelo commented Apr 22, 2016

think a simple "restore" and "open" open should good (restore = save over current with old version, open works similar to import, it will open a unsaved dashboard).

json diff would be nice but not needed for v1 of the feature I think .

@smalik03

This comment has been minimized.

Show comment
Hide comment
@smalik03

smalik03 Jun 20, 2016

Contributor

any updates on this?

Contributor

smalik03 commented Jun 20, 2016

any updates on this?

@utkarshcmu

This comment has been minimized.

Show comment
Hide comment
@utkarshcmu

utkarshcmu Jun 20, 2016

Contributor

@smalik03 Will work on this as soon as I get some time. Some initial work is done.

Contributor

utkarshcmu commented Jun 20, 2016

@smalik03 Will work on this as soon as I get some time. Some initial work is done.

@utkarshcmu

This comment has been minimized.

Show comment
Hide comment
@utkarshcmu

utkarshcmu Nov 11, 2016

Contributor

I want to use Github repo to store dashboard history, then user can have the whole history in a github repo and we store only the version -> commit mapping in the db.

Any thoughts?

Contributor

utkarshcmu commented Nov 11, 2016

I want to use Github repo to store dashboard history, then user can have the whole history in a github repo and we store only the version -> commit mapping in the db.

Any thoughts?

@torkelo

This comment has been minimized.

Show comment
Hide comment
@torkelo

torkelo Nov 11, 2016

Member

Not sure, sounds like an external plugin that does that, dashboard history if built will be built into grafana.

Member

torkelo commented Nov 11, 2016

Not sure, sounds like an external plugin that does that, dashboard history if built will be built into grafana.

@utkarshcmu

This comment has been minimized.

Show comment
Hide comment
@utkarshcmu

utkarshcmu Nov 28, 2016

Contributor

Dashboard history can be version controlled in Git using wizzy - https://utkarshcmu.github.io/wizzy/

Contributor

utkarshcmu commented Nov 28, 2016

Dashboard history can be version controlled in Git using wizzy - https://utkarshcmu.github.io/wizzy/

@jayannah

This comment has been minimized.

Show comment
Hide comment
@jayannah

jayannah commented Jan 13, 2017

+1

@torkelo torkelo added this to the 4.4.0 milestone Jun 7, 2017

@torkelo

This comment has been minimized.

Show comment
Hide comment
@torkelo

torkelo Jun 7, 2017

Member

This is now implemented via PR, #8472 , big thanks to Walmart Labs for this contribution.

Some screenshots:
image

Summary diff
image

Json diff:
image

Member

torkelo commented Jun 7, 2017

This is now implemented via PR, #8472 , big thanks to Walmart Labs for this contribution.

Some screenshots:
image

Summary diff
image

Json diff:
image

@torkelo torkelo closed this Jun 7, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment