Skip to content

Docs: Build a plugin with AI #2601

Open
urbiz-grafana wants to merge 34 commits into
mainfrom
urbiz-ai-tutorial
Open

Docs: Build a plugin with AI #2601
urbiz-grafana wants to merge 34 commits into
mainfrom
urbiz-ai-tutorial

Conversation

@urbiz-grafana
Copy link
Copy Markdown
Contributor

@urbiz-grafana urbiz-grafana commented Apr 29, 2026

Co-authored-by: Copilot <copilot@github.com>
@urbiz-grafana urbiz-grafana self-assigned this Apr 29, 2026
@urbiz-grafana urbiz-grafana requested a review from a team as a code owner April 29, 2026 15:50
Copilot AI review requested due to automatic review settings April 29, 2026 15:50
@urbiz-grafana urbiz-grafana added the type/docs Changes only affect the documentation label Apr 29, 2026
@urbiz-grafana urbiz-grafana requested a review from jackw April 29, 2026 15:50
@urbiz-grafana urbiz-grafana added the no-changelog Don't include in changelog and version calculations label Apr 29, 2026
@urbiz-grafana urbiz-grafana marked this pull request as draft April 29, 2026 15:50
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 29, 2026

Hello! 👋 This repository uses Auto for releasing packages using PR labels.

✨ This PR can be merged. It will not be considered when calculating future versions of the npm packages and will not appear in the changelogs.

@urbiz-grafana urbiz-grafana moved this from 📬 Triage to 🧑‍💻 In development in Grafana Catalog Team Apr 29, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new tutorial that guides readers through building a Grafana data source plugin and app plugin by using structured prompts with an AI coding assistant.

Changes:

  • Introduces a step-by-step workflow for scaffolding and iteratively implementing a data source plugin (with Go backend).
  • Adds structured prompt templates for building an app plugin (list view, map view) that consumes the data source.
  • Includes verification steps and troubleshooting guidance for frontend/backend iteration.

Comment thread docusaurus/docs/tutorials/build-ai-plugin.md Outdated
Comment thread docusaurus/docs/tutorials/build-ai-plugin.md Outdated
Comment thread docusaurus/docs/tutorials/build-ai-plugin.md Outdated
Comment thread docusaurus/docs/tutorials/build-ai-plugin.md Outdated
Comment thread docusaurus/docs/tutorials/build-ai-plugin.md Outdated
Comment on lines +44 to +58
### Useful tips to work with AI tools

:::important
**Do not let AI bootstrap the plugin. Make sure you're using `create-plugin`.**
:::

When working with AI, you're steering the wheel! Do not to let your AI tool guess. Instead, give it clear prompts with guidelines and constraints, keep it inside Grafana plugin patterns, and verify each milestone in Grafana before moving on.

These patterns help keep the AI useful:

- **Start with facts**: Give the API contract, plugin type, and hard constraints first.
- **Ask for a short plan**: This helps catch drift before the AI edits files.
- **Tell it what not to do**: For example, no invented API fields and no direct app-to-API calls.
- **Ask it to name files before editing**: This makes review easier.
- **Keep prompts milestone-sized**: One milestone for the data source, one for the list page, one for the map page.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this be better in a concepts section or broader than a tutorial?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well it's already a subsection in Before you begin...

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As an individual doc? I dunno... Not sure it's our "job" to be thorough about that.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather remove it.

Comment thread docusaurus/docs/tutorials/build-ai-plugin.md Outdated
Comment thread docusaurus/docs/tutorials/build-ai-plugin.md Outdated
Comment thread docusaurus/docs/tutorials/build-ai-plugin.md
Comment thread docusaurus/docs/tutorials/build-ai-plugin.md Outdated
Comment thread docusaurus/docs/tutorials/build-ai-plugin.md
Comment thread docusaurus/docs/tutorials/build-ai-plugin.md Outdated
Comment thread docusaurus/docs/tutorials/build-ai-plugin.md Outdated
@github-project-automation github-project-automation Bot moved this from 🔬 In review to 🧑‍💻 In development in Grafana Catalog Team May 15, 2026
urbiz-grafana and others added 2 commits May 15, 2026 15:48
Co-authored-by: David Harris <david.harris@grafana.com>
Co-authored-by: David Harris <david.harris@grafana.com>
Comment thread docusaurus/docs/tutorials/build-ai-plugin.md Outdated
Comment thread docusaurus/docs/tutorials/build-ai-plugin.md

In your Grafana instance, go to **Connections** and check the app plugin has been scaffolded.

## 4. Prompt your AI tool to build the app list view
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a missing link between app and datasources - we need to symlink the datasource into the app so that when you run the Grafana server in app folder it actually picks up / installs the datasource. This is happening here in our workshop https://github.com/grafana/grafana-con-2026-ai-inception-workshop/blob/8c51401c32fd06f765235ba9160b746efe64eaad/milestone2.sh#L64-L105

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can either be done manually or prompted in the app folder, something along the lines of

I want to add dist folder of ../myorg-bcapi-datasource plugin to volumes of this plugin so that when I start this app plugin it has the datasource installed. Also add it to run unsigned.

but the prompt can also be a bit more detailed ofc.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It worked for me but let me add it!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tolzhabayev - made some updates, LMK.

Comment thread docusaurus/docs/tutorials/build-ai-plugin.md Outdated
Comment thread docusaurus/docs/tutorials/build-ai-plugin.md Outdated
Comment thread docusaurus/docs/tutorials/build-ai-plugin.md Outdated
Comment thread docusaurus/docs/tutorials/build-ai-plugin.md Outdated
Comment thread docusaurus/docs/tutorials/build-ai-plugin.md Outdated
Comment thread docusaurus/docs/tutorials/build-ai-plugin.md Outdated
Comment thread docusaurus/docs/tutorials/build-ai-plugin.md Outdated
urbiz-grafana and others added 10 commits May 18, 2026 12:42
Co-authored-by: Timur Olzhabayev <timur.olzhabayev@grafana.com>
Co-authored-by: Timur Olzhabayev <timur.olzhabayev@grafana.com>
Co-authored-by: Timur Olzhabayev <timur.olzhabayev@grafana.com>
Co-authored-by: Timur Olzhabayev <timur.olzhabayev@grafana.com>
Co-authored-by: Timur Olzhabayev <timur.olzhabayev@grafana.com>
Co-authored-by: Timur Olzhabayev <timur.olzhabayev@grafana.com>
Co-authored-by: Timur Olzhabayev <timur.olzhabayev@grafana.com>
@urbiz-grafana urbiz-grafana requested a review from tolzhabayev May 19, 2026 09:46
@urbiz-grafana
Copy link
Copy Markdown
Contributor Author

@tolzhabayev @sympatheticmoose let's try to unblock this one.

Timur, can you take a quick look at the last changes?
David, if that's alright, I'll just remove our AI guidance, there's enough literature about this around.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog Don't include in changelog and version calculations type/docs Changes only affect the documentation

Projects

Status: 🧑‍💻 In development

Development

Successfully merging this pull request may close these issues.

4 participants