From 348d50c56aa6bc1bacbf329081bdfe61f92998ca Mon Sep 17 00:00:00 2001 From: Joe Perez Date: Fri, 7 Jun 2024 14:49:41 -0700 Subject: [PATCH] Redirect fix --- .../create-a-plugin/develop-a-plugin/best-practices.md | 8 ++++---- docusaurus/docs/get-started/get-started.mdx | 2 +- docusaurus/website/docusaurus.config.base.js | 7 ++----- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/docusaurus/docs/create-a-plugin/develop-a-plugin/best-practices.md b/docusaurus/docs/create-a-plugin/develop-a-plugin/best-practices.md index b5662dc7f..3c5e5b3b3 100644 --- a/docusaurus/docs/create-a-plugin/develop-a-plugin/best-practices.md +++ b/docusaurus/docs/create-a-plugin/develop-a-plugin/best-practices.md @@ -54,10 +54,7 @@ Is something missing from this list? [Let us know](https://github.com/grafana/pl ### Backend plugins - **Add support for alerting** - Backend plugins have inherent support for [Grafana Alerting](https://grafana.com/docs/grafana/latest/alerting/) but this support needs to be enabled. Simply add `"alerting": true` to your `plugin.json` file. -- **Use the `CallResourceHandler` interface to serve custom HTTP requests** - For more, - information, refer to [Resource handlers](../../key-concepts/backend-plugins/#resources) - -```). This is useful, for example, when providing query builders, as shown in this [example](https://github.com/grafana/grafana-plugin-examples/blob/0532f8b23645251997088ac7a1707a72d3fd9248/examples/app-with-backend/pkg/plugin/app.go#L35). +- **Use the `CallResourceHandler` interface to serve custom HTTP requests**. For more information, refer to [Resource handlers](../../key-concepts/backend-plugins/#resources). This is useful, for example, when providing query builders, as shown in this [example](https://github.com/grafana/grafana-plugin-examples/blob/0532f8b23645251997088ac7a1707a72d3fd9248/examples/app-with-backend/pkg/plugin/app.go#L35). - **Add logs, metrics and traces to your data source.** Make it easier to diagnose and resolve issues for both plugin developers and Grafana operators. Find more information in our [documentation](/create-a-plugin/extend-a-plugin/add-logs-metrics-traces-for-backend-plugins). - **Keep cached connections** - This is an important optimization. To learn more, refer to our [documentation](/docusaurus/docs/key-concepts/backend-plugins/#caching-and-connection-pooling) and an [example](https://github.com/grafana/grafana-plugin-examples/blob/0532f8b23645251997088ac7a1707a72d3fd9248/examples/datasource-http-backend/pkg/plugin/datasource.go#L40-L66). - **Add macro support** - Macros are similar to variables, but they are typically evaluated in the backend and can return values based on environment data like the current time selection. It can be useful, for example, to evaluate alerts during a dynamic period. These are usually defined using the syntax `$__macroName` (for example, `$__timeFilter`). Refer to this [example](https://github.com/grafana/grafana-plugin-examples/blob/0532f8b23645251997088ac7a1707a72d3fd9248/examples/datasource-basic/pkg/query/macro.go) to discover how you can implement support. Some pre-defined macros are available in the [plugin SDK `macros` package](https://github.com/grafana/grafana-plugin-sdk-go/tree/main/experimental/macros). @@ -79,4 +76,7 @@ Is something missing from this list? [Let us know](https://github.com/grafana/pl - **Add a GitHub badge** - Follow [these steps](https://grafana.com/blog/2021/01/21/6-tips-for-improving-your-grafana-plugin-before-you-publish/#tip-4-add-dynamic-badges-to-your-readme) to help users find your plugin using GitHub badges. - **Add workflow automation** - If your plugin is available on GitHub, consider [adding the GitHub workflows](https://grafana.com/blog/2021/01/21/6-tips-for-improving-your-grafana-plugin-before-you-publish/#tip-5-automate-your-releases-using-github-actions) for plugin development to your repository. + +``` + ``` diff --git a/docusaurus/docs/get-started/get-started.mdx b/docusaurus/docs/get-started/get-started.mdx index a1e700fd8..eb9c80578 100644 --- a/docusaurus/docs/get-started/get-started.mdx +++ b/docusaurus/docs/get-started/get-started.mdx @@ -38,7 +38,7 @@ Scaffold a new plugin with a single command! Run the following and answer the pr ## Why create a Grafana plugin? -Grafana plugin development allows you to create many different types of user experiences using [supported](https://grafana.com/developers/plugin-tools/key-concepts/grafana-plugin-sdk-for-go) features. For example, you can make: +Grafana plugin development allows you to create many different types of user experiences using [supported](/key-concepts/backend-plugins/grafana-plugin-sdk-for-go) features. For example, you can make: - **Panel plugins** - new ways of visualizing data - **Data-source plugins** - connections to a new database or other source of data diff --git a/docusaurus/website/docusaurus.config.base.js b/docusaurus/website/docusaurus.config.base.js index 5d6c780c3..7e61a5103 100644 --- a/docusaurus/website/docusaurus.config.base.js +++ b/docusaurus/website/docusaurus.config.base.js @@ -79,11 +79,8 @@ const plugins = [ from: ['/introduction/data-frames.md', '/introduction/data-frames'], to: '/key-concepts/data-frames', - from: [ - '/docs/introduction/grafana-plugin-sdk-for-go.md', - '/introduction/backend-plugins/grafana-plugin-sdk-for-go', - ], - to: '/key-concepts/grafana-plugin-sdk-for-go', + from: ['/introduction/grafana-plugin-sdk-for-go.md'], + to: '/key-concepts/backend-plugins/grafana-plugin-sdk-for-go', from: ['/introduction/index.md', '/introduction'], to: '/key-concepts/',