aws-observability / amazon-managed-grafana-migrator Goto Github PK
View Code? Open in Web Editor NEWCLI migration utility to migrate Grafana content to Amazon Managed Grafana
License: Apache License 2.0
CLI migration utility to migrate Grafana content to Amazon Managed Grafana
License: Apache License 2.0
0.1.3 (though this was downloaded via the 0.1.4 release tag)
$ go version
go version go1.19.4 darwin/arm64
and this is at the end of the output from the migrate
command
Migrating alerting rules:
Removing temporary API key for g-6b10aaa20e
Removing temporary API key for g-909b33678e
error: alerting API version not supported for src, minimum supported is v8.4
the source workspace is on version 8.4, and the destination is on version 9.4.
I expected it to fail on alerts migration, due to the requirement that the alerts migration is only supported for version 9.4, which is why I was confused by the output stating "minimum supported is v8.4", since if that's true, then I wouldn't expect to see this error message.
0.1.3
If an AMG workspace is being created, the tool has the following error:
[ec2-user@ip-172-31-0-89 ~]$ ./amazon-managed-grafana-migrator discover --region us-east-2
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x8a72e5]
goroutine 1 [running]:
github.com/aws-observability/amazon-managed-grafana-migrator/internal/pkg/aws.(*AMG).ListWorkspaces(0xc000061f80)
/github/workspace/internal/pkg/aws/aws.go:68 +0x125
github.com/aws-observability/amazon-managed-grafana-migrator/internal/pkg/cli.discover({0x7ffe92411628, 0x9})
/github/workspace/internal/pkg/cli/discover.go:28 +0xca
github.com/aws-observability/amazon-managed-grafana-migrator/internal/pkg/cli.BuildDiscoverCmd.func1(0x0?, {0x0?, 0x0?, 0x0?})
/github/workspace/internal/pkg/cli/discover.go:58 +0x4c
github.com/aws-observability/amazon-managed-grafana-migrator/internal/pkg/cli.runCmdE.func1(0xc000004c00?, {0xc00006b2a0?, 0x2?, 0x2?})
/github/workspace/internal/pkg/cli/discover.go:73 +0x7b
github.com/spf13/cobra.(*Command).execute(0xc000004c00, {0xc00006b280, 0x2, 0x2})
/go/pkg/mod/github.com/spf13/[email protected]/command.go:940 +0x862
github.com/spf13/cobra.(*Command).ExecuteC(0xc000004900)
/go/pkg/mod/github.com/spf13/[email protected]/command.go:1068 +0x3bd
github.com/spf13/cobra.(*Command).Execute(...)
/go/pkg/mod/github.com/spf13/[email protected]/command.go:992
main.main()
/github/workspace/main.go:22 +0x1e
Once the workspace completes creation, it works as expected:
[ec2-user@ip-172-31-0-89 ~]$ ./amazon-managed-grafana-migrator discover --region us-east-2
✔ Discovered 1 workspaces
Version: 9.4
Name: grafana
Endpoint: g-123456789.grafana-workspace.us-east-2.amazonaws.com
[ec2-user@ip-172-31-0-89 ~]$
No response
0.1.9
Two grafana 8.4 instances trying to migrate from src to dst in order to upgrade the 'secondary' workspace first and be able to validate 9.4 works for us.
migrate
throws an error for migrating dashboards. Seems to be thrown by https://github.com/aws-observability/amazon-managed-grafana-migrator/blob/main/internal/pkg/app/dashboards.go#L13
✔ Migrated 6 folders
Migrating dashboards:
Removing temporary API key for g-<src>
Removing temporary API key for g-<dst>
error: json: cannot unmarshal number -1 into Go struct field FolderDashboardSearchResponse.folderId of type uint
When attempting to use amazon-managed-grafana-migrator
v0.1.11
to migrate an AWS Managed Grafana Workspace from one AWS account to another AWS account, we are getting errors relating to connecting Library panels to dashboards in the destination workspace. Although we are running this across AWS accounts, we can also reproduce this when attempting to run the command within the same AWS account.
Here is an example of the command that we are running:
amazon-managed-grafana-migrator migrate --src-url https://<redacted-A>.grafana-workspace.<redacted>.amazonaws.com --src-api-key <redacted> --dst <redacted-B>.grafana-workspace.<redacted>.amazonaws.com --verbose
Skipping API key creation for https://<redacted-A>.grafana-workspace.<redacted>.amazonaws.com
Creating temporary API key for <redacted-B>
Migrating data sources:
Data source: account-A-source
✔ Migrated 1 data sources
Migrating folders:
Source Grafana folders found: 1
[DEBUG] [{5 gqxpT0bSk Sites }]
Folder: Sites
[DEBUG] &{[{5 gqxpT0bSk Sites }] [{1 gqxpT0bSk Sites /dashboards/f/gqxpT0bSk/sites}] [{1 gqxpT0bSk Sites }]}
✔ Migrated 1 folders
Migrating dashboards:
Found 3 dashboards in src
Dashboard: /d/8d1wpnhIk/dashboard-1
searching Folder ID [src folder ID/UID/Title] [5/8d1wpnhIk/Sites] for dashboard in dst grafana: 1
error: status: 500, body: {"message":"Error while connecting library panels","traceID":""}
Dashboard: /d/MCfVOxbIk/dashboard-2
searching Folder ID [src folder ID/UID/Title] [5/MCfVOxbIk/Sites] for dashboard in dst grafana: 1
error: status: 500, body: {"message":"Error while connecting library panels","traceID":""}
Dashboard: /d/G6vVCxxSz/dashboard-3
searching Folder ID [src folder ID/UID/Title] [5/G6vVCxxSz/Sites] for dashboard in dst grafana: 1
✔ Migrated 1 dashboards
Skipping alert rules migration
Removing temporary API key for <redacted-B>
It appears that because the Library Elements are not being migrated, and 2/3 of our Dashboard elements have references to Library elements, we are seeing a 500 error occur at some point in the creation of the Dashboard Element in the destination Grafana workspace.
Is this use case supported? If it is known to not be supported, can support for this be added?
For reference, it appears that the Library Elements are simply not being migrated, based on the top level App
code:
For further reference, it does appear that the Library Element API is well supported on this version of Grafana: https://grafana.com/docs/grafana/v9.4/developers/http_api/library_element/
We are using AWS Managed Grafana v9.4
.
Please let me know if any further detail is needed.
0.1.10
Trying to migrate Grafana 8 up to Grafana 9, and got this message for practically every dashboard migration.
All the folders migrated successfully, but only a few of the dashboards did, and it's unclear why. The majority of the dashboards failed with this message:
warning: status: 404, body: {"message":"Folder not found","traceID":""}
I'm on MacOS, moving from Grafana 8.4 to Grafana 9.4.
No response
v0.1.8
Migrating alerting rules from Grafana server overrides the evaluation period and set to 1m
No response
go install github.com/aws-observability/amazon-managed-grafana-migrator@latest
Getting error while transfering EC2 Grafana(v9.2.0) to Amazon Manage Grafana(v9.4.7)
Cureently we are using in-house grafana with AWS EC2 instances and we are planning to tansfer to AMG (amazon manage grafana) and getting dail tcp : lookup no such host error.
0.1.3
Grafana v8.4.7 -> Grafana v9.4.7
Get this error:
warning: status: 401, body: {"message":"Expired API key"}
No response
I used this tool very successfully for migrating workspaces, though during the process, I also realized that we don't currently store any "backups" of our dashboard/alert configuration. I've used other OSS tooling for dealing with dashboards in an automated way, but nothing is as slick as this one, so I was thinking about modelling something on it to get us an output of our entire workspace configuration...but if there's a way to do it in this tool, then that would be even better.
It's highly likely this isn't appropriate for the nature of this project, but I thought I'd ask anyway. 😸
I'd love a secondary command to output to a local directory the configuration of our dashboards and alerts. Something like:
amazon-managed-grafana-migrator output \
--src g-abcdef1234.grafana-workspace.eu-central-1.amazonaws.com \
--folder workspace-backup
and I suppose that would be even more useful if there were some way to configure dashboards/alerts in a fresh workspace based on local configuration (but now this is serious scope creep 😆 )
I've considered using other tooling like https://github.com/Beam-Connectivity/grafana-dashboard-manager, but that doesn't seem to support alerts, and it's also not as smooth of a DX as this tool.
I've also considered just rolling my own, probably heavily based on the implementation here, because there are lots of nice things about it (progress in the terminal, temporary credentials, handles both dashboards and alerts).
As I mentioned, I'm expecting this request won't be appropriate for this particular project, since it's only titled "amazon-managed-grafana-migrator", but no harm in asking. I'd even be willing to submit a PR myself, though I'm definitely by no means an expert Go developer.
Thanks again for this super cool tool...it saved me a lot of time 👍
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.