MCPcopy Index your code
hub / github.com/esnet/gdg

github.com/esnet/gdg @v0.9.3

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.9.3 ↗ · + Follow
2,647 symbols 7,985 edges 203 files 1,167 documented · 44%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Grafana Dash-n-Grab (GDG) -- Resource Manager. The purpose of this project is to provide an easy-to-use CLI to interact with the grafana API allowing you to backup and restore dashboard, connections, and other resources.

Build Status Build Status Go Report Card GoDoc codecov GitHub release

The following remote backup locations are supported: - AWS S3 - Google Storage - Azure Storage - S3 Compatible Storage (Minio, Ceph, etc)

Please find the generated documentation here and the code for updating the docs is available here

Quickstart

Quickstart screen

Supported Versions

GDG community will try to support the last 2 major version of grafana. Though there is nothing preventing you from using it with any version of grafana you are dependent on what the API supports/doesn't support and changes that have been added since then.

New features particularly related to Orgs, ACLs, roles etc are far less likely to work the older your version is.

Current Entities supported (See official docs for more details)

Resource sub-component Status Regex Filtering Authorization Enterprise Only
Connections Supported Available Token/Basic
Dashboards Supported Available Token/Basic
Folders Supported Optional Token/Basic
Organization Supported N/A Basic Grafana Admin
Teams Supported N/A Token/Basic
Users Supported N/A Basic
Library Elements Supported Available Token/Basic
Connections Permissions Supported Token/Basic X
Alerting contacts Supported N/A Token/Basic
Alerting mute-timings Supported N/A Token/Basic
Alerting policies Supported N/A Token/Basic
Alerting rules Supported Available Token/Basic
Alerting templates Supported N/A Token/Basic

Release conventions.

GDG mostly follows the semver conventions with some minor modifications.

For those that are unfamiliar semver references to X.Y.Z version patterns with

  • X = Major version
  • Y = Minor version
  • Z= patch

Most regular releases will increment the patch number. ie. 0.4.5 is a regular release, and next normal release would be 0.4.6.

Minor version change will likely introduce some breaking change. For example, renaming datasources to connections or some configuration changes that are not backward compatible etc.

Major version: Is a major feature set change for example, removing cloud support in the base release and introducing a plugin system would be 1.X release. Splitting the GDG binary into a tools and backup cli, or introducing a diff tooling that allow you to compare contexts. i.e. gdg diff dashboards prod staging is a major divergences from the current expectations so it'll be a major version bump.

For more info, please see the release notes and documentation both available here


GDG is powered by the Grafana OpenAPI Client. Any feature exposed by the API could be added to GDG if desired, feel free to fill out a feature request on our GitHub issue tracker.

Extension points exported contracts — how you extend this code

OrgPreferencesApi (Interface)
OrgPreferencesApi Contract definition [7 implementers]
internal/ports/grafana_api.go
GetVersion (Interface)
(no doc) [6 implementers]
pkg/tools/version_check.go
RootOption (FuncType)
RootOption used to configure the Root Command struct
cli/domain/root.go
CloudTestOpt (FuncType)
(no doc)
pkg/test_tooling/containers.go
RetryFunc (FuncType)
(no doc)
test/main_test.go
InputValidation (FuncType)
(no doc)
internal/domain/filters.go
NewClientOpts (FuncType)
(no doc)
internal/adapter/grafana/api/login.go
GDGAppConfigurationOption (FuncType)
(no doc)
internal/config/config_domain/gdg_config.go

Core symbols most depended-on inside this repo

Return
called by 167
internal/ports/mocks/GrafanaService.go
ConfigSvc
called by 130
cli/domain/root.go
GrafanaSvc
called by 90
cli/domain/root.go
Run
called by 85
internal/ports/mocks/GrafanaService.go
String
called by 83
internal/adapter/storage/const.go
String
called by 76
internal/domain/filters.go
Return
called by 72
internal/ports/mocks/Storage.go
GetClient
called by 66
internal/adapter/grafana/api/login.go

Shape

Method 1,568
Function 680
Struct 347
Interface 30
TypeAlias 13
FuncType 9

Languages

Go100%
TypeScript1%

Modules by API surface

internal/ports/mocks/GrafanaService.go514 symbols
internal/ports/mocks/AlertingApi.go124 symbols
internal/ports/mocks/OrganizationsApi.go94 symbols
internal/ports/grafana_api.go83 symbols
internal/ports/mocks/AuthenticationApi.go64 symbols
internal/ports/mocks/Filter.go58 symbols
internal/ports/mocks/ConnectionsApi.go52 symbols
internal/ports/mocks/ServiceAccountApi.go46 symbols
internal/ports/mocks/FoldersApi.go46 symbols
internal/config/config_domain/grafana_config_test.go44 symbols
internal/config/config_crud_internal_test.go43 symbols
internal/config/config_crud_helpers_test.go43 symbols

For agents

$ claude mcp add gdg \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page