{"id":26194314,"url":"https://github.com/active-group/active-grafana","last_synced_at":"2026-04-20T22:01:51.041Z","repository":{"id":218707527,"uuid":"715964835","full_name":"active-group/active-grafana","owner":"active-group","description":null,"archived":false,"fork":false,"pushed_at":"2025-12-01T11:34:46.000Z","size":62,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-12-27T08:23:42.606Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/active-group.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-11-08T07:38:17.000Z","updated_at":"2025-12-01T11:34:50.000Z","dependencies_parsed_at":"2024-03-25T17:20:46.946Z","dependency_job_id":null,"html_url":"https://github.com/active-group/active-grafana","commit_stats":null,"previous_names":["active-group/active-grafana"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/active-group/active-grafana","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/active-group%2Factive-grafana","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/active-group%2Factive-grafana/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/active-group%2Factive-grafana/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/active-group%2Factive-grafana/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/active-group","download_url":"https://codeload.github.com/active-group/active-grafana/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/active-group%2Factive-grafana/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32067626,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T21:26:33.338Z","status":"ssl_error","status_checked_at":"2026-04-20T21:26:22.081Z","response_time":94,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-12T01:56:09.589Z","updated_at":"2026-04-20T22:01:51.029Z","avatar_url":"https://github.com/active-group.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# active-grafana\n\nA Clojure script/project designed to help dealing with Grafana.\n\n## Features\n\n- Copying a grafana dashboard from one instance to another instance.\n- Copying alert-rules associated with this grafana dashboard.\n- Copying library-panels associated with this grafana dashboard.\n\n- Adjusting library-panels where a specific target structure needs repetition\n  with different datasources.\n\n## Usage\n### Babashka\n\nIf you check out this repository you can use [babashka](https://book.babashka.org/).\n\nThis project contains two main-functions:\n\n```\nactive-grafana.main-copy\nactive-grafana.main-adjust\n```\n\nWith babaskha-tasks (see `bb.edn` or https://book.babashka.org/#tasks) you can start at the root of the project with:\n\n```\nactive-grafana $ bb copy -h\n```\nor\n\n```\nactive-grafana $ bb adjust -h\n```\n\nIf this does not work try:\n\n```\nactive-grafana $ bb -m active-grafana.main-copy -- -h\nactive-grafana $ bb -m active-grafana.main-adjust -- -h\n```\n\nThe help shows variables like `URL`, `FROM_URL` or `TO_MESSAGE`, which can\nalternatively be provided by environment variables. For example:\n\n```\n$ export FROM_URL=http://localhost:3000\n$ export FROM_TOKEN=glsa_FcOPTbFuJ9ZO0q6AzdTSoKjVLHaxsBw5_4ece1975\nactive-grafana $ TO_URL=http://localhost:3001 \\\n                 TO_TOKEN=glsa_sr9e9M1JI0ARODVP347uVKm7L1wqKvGa_3543afe4 \\\n                 TO_MESSAGE=\"Changes to the speed-check-panel.\" \\\n                 bb -m active-grafana.main-copy -- \\\n                 -b -a --board-uid=b3b41ced-1237-45a1-9f63-08d8b4191c57 \\\n                 --to-board-folder-uid=afb10bf4-f0b1-4e2b-af04-1061844be119 \\\n                 --to-alerts-folder-uid=afb10bf4-f0b1-4e2b-af04-1061844be119\n```\n\nAll variables can be found in `active-grafana.settings`.\n\n### Leiningen\n\nIf you check out this repository you can use lein.\n\nThis project contains two main-functions:\n\n```\nactive-grafana.main-copy\nactive-grafana.main-adjust\n```\n\nTo start, type at the root of the repository:\n\nFor main-copy:\n```\nactive-grafana $ lein run -m active-grafana.main-copy -- -h\n```\nor\n```\nactive-grafana $ lein with-profile as-copy run -- -h\n```\n\nFor main-adjust:\n```\nactive-grafana $ lein run -m active-grafana.main-adjust -- -h\n```\nor\n\n```\nactive-grafana $ lein with-profile as-adjust run -- -h\n```\n\nThe help shows variables like `URL`, `FROM_URL` or `TO_MESSAGE`, which can\nalternatively be provided by environment variables. For example:\n\n```\n$ export FROM_URL=http://localhost:3000\n$ export FROM_TOKEN=glsa_FcOPTbFuJ9ZO0q6AzdTSoKjVLHaxsBw5_4ece1975\nactive-grafana $ TO_URL=http://localhost:3001 \\\n                 TO_TOKEN=glsa_sr9e9M1JI0ARODVP347uVKm7L1wqKvGa_3543afe4 \\\n                 TO_MESSAGE=\"Changes to the speed-check-panel.\" \\\n                 lein run -m active-grafana.main-copy -- \\\n                 -b -a --board-uid=b3b41ced-1237-45a1-9f63-08d8b4191c57 \\\n                 --to-board-folder-uid=afb10bf4-f0b1-4e2b-af04-1061844be119 \\\n                 --to-alerts-folder-uid=afb10bf4-f0b1-4e2b-af04-1061844be119\n```\n\nAll variables can be found in `active-grafana.settings`.\n\n### Babashka-Pod\n\nThis project can also be used as a [babashka-pod](https://github.com/babashka/pods).\nThe pod-interface can be found in `active-grafana.pod`.\n\nA usage example with [docker](https://www.docker.com/).\nCheck out this repository as `active-grafana`.`\n\n```\nactive-grafana $ docker build -t active-grafana -f Dockerfile-pod .\nactive-grafana $ docker run active-grafana\nactive-grafana $ docker run active-grafana copy --help\nactive-grafana $ docker run active-grafana adjust --help\n```\n\n### Standalone Applications\n\nWith the help of [GraalVM](https://www.graalvm.org/) we can create a [native\nimage](https://www.graalvm.org/latest/reference-manual/native-image/).\n\nA usage example with [docker](https://www.docker.com/).\nCheck out this repository as `active-grafana`.`\n\n#### For copy:\n\n```\nactive-grafana $ docker build -t active-grafana-copy -f Dockerfile-standalone-copy .\nactive-grafana $ docker run -it active-grafana-copy sh\n# ./active-grafana-copy --help\n```\n\nNote: The Dockerfile contains this line:\n\n```\nRUN wget https://github.com/active-group/active-grafana/releases/download/v0.1/active-grafana-copy.jar\n```\n\nCheck https://github.com/active-group/active-grafana/releases for other releases.\n\n#### For adjust:\n\n```\nactive-grafana $ docker build -t active-grafana-adjust -f Dockerfile-standalone-adjust .\nactive-grafana $ docker run -it active-grafana-adjust sh\n# ./active-grafana-adjust --help\n```\n\nNote: The Dockerfile contains this line:\n\n```\nRUN wget https://github.com/active-group/active-grafana/releases/download/v0.1/active-grafana-adjust.jar\n```\n\nCheck https://github.com/active-group/active-grafana/releases for other releases.\n\n## Adjusting library-panels `--i-am-an-expert`-argument\n\nThe standard way of adjusting a library-panel is:\n- get the library-panel with the given `PANEL_UID`\n- take the first `target` as reference target\n- create the new target list by repeating the reference target adjusted for the\n  datasource-uid and the reference-id based on the provided `DATASOURCE-UIDS`.\n- update the library panel with the newly created target list\n\nSometimes one or more targets need more adjustments than the datasource-uid and\nthe reference-id. Use the `--i-am-an-expert` argument to achieve more advanced\nadjustments. Example:\n\n```\nadjust --adjust --url=\u003cgrafana-url\u003e --token=\u003cgrafana-token\u003e --panel-uid=\u003cpanel-uid\u003e \\\n       --datasource-uids=\"\u003cdatasource-uid-1\u003e,\u003cdatasource-uid-2\u003e,...,\u003cdatasource-uid-n\u003e\" \\\n       --i-am-an-expert=\"{:path \\\"\u003cpath-to-f-target-\u003etarget\u003e\\\" :data \u003cdata\u003e}\"\n```\n\nThe `i-am-an-expert` argument gets transformed to a map using\n`clojure.edn/read-string`. The `path` is processed with `(load-string (slurp\npath))`. That is, the path should lead to a file containing a function like the\nfollowing:\n\n```\n(defn f-target-\u003etarget\n  [reference-target uid data]\n  (assoc (assoc-in reference-target [\"datasource\" \"uid\"] uid) \"refId\" (get data uid)))\n```\nThe `data` is provided to this loaded function, e.g.:\n\n```\n{\"\u003cdatasource-uid-1\u003e\" \"ref-id-1\"\n \"\u003cdatasource-uid-2\u003e\" \"ref-id-2\"\n \"...\"                \"...\"\n \"\u003cdatasource-uid-n\u003e\" \"ref-id-n\"}\n```\n\nThe result of this example is, that the target does not use the datasource-uid\nas reference-id, but a reference-id provided as {\"uid\" \"ref-id\"}-map via the\ncommand-line.\n\nNote: make sure to escape strings in the `--i-am-an-expert`\ncommand-line-argument in the proper way, e.g.:\n```\nadjust --adjust ... --i-am-an-expert=\"{:path \\\"file.path\\\" :data {\\\"uid-1\\\" \\\"my-uid-1-data\\\"}}\"\n```\n\n## Known Issues and 'good to know'\n\n- The application uses the environment variable `BABASHKA_POD` (as described\n  [here](https://github.com/babashka/pods?tab=readme-ov-file#environment)) to\n  determine, whether the application should behave as a pod.\n\n- Error handling:\n  If something goes wrong, you are immediately provided with the plain\n  grafana-api-error-messages. Currently, there is no fallback or further help\n  provided.\n\n- Testing:\n  There is no testing within the project.\n\n- Logging and Debugging:\n  The current logging and debugging system is rudimentary and might even be\n  confusing.\n\n## License\n\nCopyright © 2023-2026 Active Group GmbH\n\nThis program and the accompanying materials are made available under the\nterms of the Eclipse Public License 2.0 which is available at\nhttp://www.eclipse.org/legal/epl-2.0.\n\nThis Source Code may also be made available under the following Secondary\nLicenses when the conditions for such availability set forth in the Eclipse\nPublic License, v. 2.0 are satisfied: GNU General Public License as published by\nthe Free Software Foundation, either version 2 of the License, or (at your\noption) any later version, with the GNU Classpath Exception which is available\nat https://www.gnu.org/software/classpath/license.html.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factive-group%2Factive-grafana","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Factive-group%2Factive-grafana","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factive-group%2Factive-grafana/lists"}