Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds Anatomy of a Plugin documentation which supercedes the Folder structure page #1120

Merged
merged 13 commits into from
Sep 30, 2024

Conversation

tomglenn
Copy link
Contributor

@tomglenn tomglenn commented Sep 17, 2024

This PR builds on the discussion here (https://docs.google.com/document/d/1QTEXzf2hWYW5PBewFfgSRBbfoWadFsaZ-0AKnodHtqQ/edit#heading=h.oi7jleblyrcn) to create a more fully fleshed out "Anatomy of a Plugin" documentation page that supercedes the existing "Folder Structure" page to provide a more complete overview of the different components that make up each plugin type.

Updated screenshot 2024-09-24
image

@tomglenn tomglenn requested a review from a team as a code owner September 17, 2024 13:30
@tomglenn tomglenn requested review from jackw and josmperez and removed request for a team and jackw September 17, 2024 13:30
Copy link

github-actions bot commented Sep 17, 2024

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.

@sympatheticmoose sympatheticmoose added type/docs Changes only affect the documentation no-changelog Don't include in changelog and version calculations labels Sep 17, 2024
Copy link
Collaborator

@mckn mckn left a comment

Choose a reason for hiding this comment

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

LGTM! Amazing work with this. Looks great 🙌🏻

docusaurus/docs/get-started/anatomy-of-a-plugin.md Outdated Show resolved Hide resolved
@tomglenn
Copy link
Contributor Author

@mckn Rather than remove the whole folder structure piece, I trimmed it down to just the important bits (removed all the fluff like .github and jest-setup.js etc) and then also added a note below it as per your suggestion.

Copy link
Contributor

@sympatheticmoose sympatheticmoose left a comment

Choose a reason for hiding this comment

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

Some comments for now, I'll take a look at the folder structure section next week

docusaurus/docs/get-started/anatomy-of-a-plugin.md Outdated Show resolved Hide resolved
docusaurus/docs/get-started/anatomy-of-a-plugin.md Outdated Show resolved Hide resolved
docusaurus/docs/get-started/anatomy-of-a-plugin.md Outdated Show resolved Hide resolved
docusaurus/docs/get-started/anatomy-of-a-plugin.md Outdated Show resolved Hide resolved
docusaurus/docs/get-started/anatomy-of-a-plugin.md Outdated Show resolved Hide resolved
docusaurus/docs/get-started/anatomy-of-a-plugin.md Outdated Show resolved Hide resolved
docusaurus/docs/get-started/anatomy-of-a-plugin.md Outdated Show resolved Hide resolved

### Query data

The Query Data method processes multiple queries and returns corresponding responses. Each query includes a `RefID`, which is mapped to its response in a `QueryDataResponse`. The method loops through the queries, processes them individually, and returns either the result or an error with an appropriate status code.
Copy link
Contributor

Choose a reason for hiding this comment

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

@andresmgot tagging just in case - would appreciate your review of this section, in particular was wondering about the parallel execution work and whether should be mentioned


Custom endpoints allow a data source plugin to expose custom HTTP API routes for server-side functionality. This is particularly useful when dealing with authentication, advanced queries, or processing large datasets. Custom endpoints can be created in the backend by using the `CallResourceHandler` method to handle requests and respond with data or status information.

For an example of implementing custom endpoints, see the [App with Backend example](https://github.com/grafana/grafana-plugin-examples/blob/main/examples/app-with-backend/pkg/plugin/resources.go).
Copy link
Contributor

Choose a reason for hiding this comment

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

docusaurus/docs/get-started/anatomy-of-a-plugin.md Outdated Show resolved Hide resolved
Copy link
Contributor

@josmperez josmperez left a comment

Choose a reason for hiding this comment

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

Love it! I've made a commit with some suggestions, mostly minor things. After this is published, I see a need for tweaks to the "Plugin types" topic and plugin tutorials, but we can deal with that later. Please review the commit.

docusaurus/docs/key-concepts/images/data-source-plugin.png Outdated Show resolved Hide resolved
@sympatheticmoose
Copy link
Contributor

@josmperez I can't see a commit from you? You may still need to push

@josmperez
Copy link
Contributor

@josmperez I can't see a commit from you? You may still need to push

Thanks. Done.

@tomglenn
Copy link
Contributor Author

Awesome, thanks for the edits @josmperez. I've updated the data source image text and will merge this now. Let's get this in and iterate where necessary. Thanks all! 🙏

@tomglenn tomglenn merged commit 9230b0f into main Sep 30, 2024
12 checks passed
@tomglenn tomglenn deleted the tom/anatomy branch September 30, 2024 10:54
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: 🚀 Shipped
Development

Successfully merging this pull request may close these issues.

4 participants