Code Monkey home page Code Monkey logo

amazon-managed-grafana-migrator's People

Contributors

amazon-auto avatar bonclay7 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

amazon-managed-grafana-migrator's Issues

[Bug]: migrating from 8.4 Grafana workspace shows confusing error message for alerts

Did you search for similar issues before submitting?

  • Yes, I've searched similar issues on GitHub and didn't find any.

Release version

0.1.3 (though this was downloaded via the 0.1.4 release tag)

Is it a permission issue?

What is your environment, configuration and the example used?

$ 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

Additional Information

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.

[Bug]: discover command fails when Grafana workspace is creating

Did you search for similar issues before submitting?

  • Yes, I've searched similar issues on GitHub and didn't find any.

Release version

0.1.3

Is it a permission issue?

What is your environment, configuration and the example used?

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 ~]$

Additional Information

No response

[Bug]: grafana go sdk cannot unmarshal number -1 into Go struct field FolderDashboardSearchResponse.folderId of type uint

Did you search for similar issues before submitting?

  • Yes, I've searched similar issues on GitHub and didn't find any.

Release version

0.1.9

Is it a permission issue?

What is your environment, configuration and the example used?

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.

Additional Information

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

[Question] Support for migration of Library Elements?

Please describe your question here

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?

Provide link to the example related to the question

For reference, it appears that the Library Elements are simply not being migrated, based on the top level App code:

func (a *App) Run(srcCustomGrafanaClient CustomGrafanaClient) error {

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/

Additional context

We are using AWS Managed Grafana v9.4.

Please let me know if any further detail is needed.

More

  • Yes, I have checked the repo for existing issues before raising this question

[Bug]: 404 Folder Not Found

Did you search for similar issues before submitting?

  • Yes, I've searched similar issues on GitHub and didn't find any.

Release version

0.1.10

Is it a permission issue?

What is your environment, configuration and the example used?

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.

Additional Information

No response

[Bug]: Alert evaluation interval overriden

Did you search for similar issues before submitting?

  • Yes, I've searched similar issues on GitHub and didn't find any.

Release version

v0.1.8

Is it a permission issue?

What is your environment, configuration and the example used?

Migrating alerting rules from Grafana server overrides the evaluation period and set to 1m

Additional Information

No response

EC2 Grafana(v9.2.0) to Amazon Manage Grafana(v9.4.7) dashboard transfer issue

Did you search for similar issues before submitting?

  • Yes, I've searched similar issues on GitHub and didn't find any.

Release version

go install github.com/aws-observability/amazon-managed-grafana-migrator@latest

Is it a permission issue?

What is your environment, configuration and the example used?

Getting error while transfering EC2 Grafana(v9.2.0) to Amazon Manage Grafana(v9.4.7)

Additional Information

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.

[Bug]: API key expires if migrating enough resources

Did you search for similar issues before submitting?

  • Yes, I've searched similar issues on GitHub and didn't find any.

Release version

0.1.3

Is it a permission issue?

What is your environment, configuration and the example used?

Grafana v8.4.7 -> Grafana v9.4.7

Get this error:

	warning: status: 401, body: {"message":"Expired API key"}

Additional Information

No response

[Feature] ability to output dashboard/alerts configuration

Is your feature request related to a problem? Please describe

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. 😸

Describe the solution you'd like

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 😆 )

Describe alternatives you've considered

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).

Additional context

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 👍

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.