-
Notifications
You must be signed in to change notification settings - Fork 31
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
Conversation
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. |
There was a problem hiding this 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 🙌🏻
@mckn Rather than remove the whole folder structure piece, I trimmed it down to just the important bits (removed all the fluff like |
There was a problem hiding this 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
|
||
### 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. |
There was a problem hiding this comment.
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). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again unsure whether to link to http://grafana.com/developers/plugin-tools/how-to-guides/data-source-plugins/add-resource-handler
There was a problem hiding this 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.
@josmperez I can't see a commit from you? You may still need to push |
Thanks. Done. |
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! 🙏 |
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