Export: include alerts, thumbnails, usage stats, and short urls (#51938)

This commit is contained in:
Ryan McKinley
2022-07-11 16:25:40 -07:00
committed by GitHub
parent 0e066dd5f8
commit 3003a48dc6
15 changed files with 454 additions and 211 deletions
+18 -16
View File
@@ -105,24 +105,26 @@ func exportAnnotations(helper *commitHelper, job *gitExportJob) error {
}
}
frame := data.NewFrame("", f_ID, f_DashboardID, f_PanelID, f_Epoch, f_EpochEnd, f_Text, f_Tags)
js, err := jsoniter.ConfigCompatibleWithStandardLibrary.MarshalIndent(frame, "", " ")
if err != nil {
return err
}
if f_ID.Len() > 0 {
frame := data.NewFrame("", f_ID, f_DashboardID, f_PanelID, f_Epoch, f_EpochEnd, f_Text, f_Tags)
js, err := jsoniter.ConfigCompatibleWithStandardLibrary.MarshalIndent(frame, "", " ")
if err != nil {
return err
}
err = helper.add(commitOptions{
body: []commitBody{
{
fpath: filepath.Join(helper.orgDir, "annotations", "annotations.json"),
body: js, // TODO, pretty?
err = helper.add(commitOptions{
body: []commitBody{
{
fpath: filepath.Join(helper.orgDir, "annotations", "annotations.json"),
body: js, // TODO, pretty?
},
},
},
when: time.Now(),
comment: "Exported annotations",
})
if err != nil {
return err
when: time.Now(),
comment: "Exported annotations",
})
if err != nil {
return err
}
}
return err
})