grafana/docs/sources/developers/plugins/build-a-streaming-data-sour...

152 lines
4.5 KiB
Markdown
Raw Normal View History

---
title: Build a streaming data source plugin
---
# Build a streaming data source plugin
Docs: Plugin doc review for chunk 1-A (#67070) * Plugin doc review for chunk 1-A Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Group of fixes in response to review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Updates for review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixed extra space Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Additional doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc review fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More changes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix links and relrefs using doc-validator advice Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Publishing criteria update Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Markdown fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Link fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix to publishing criteria Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-logs-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/get-started-with-plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/sign-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> --------- Signed-off-by: Joe Perez <joseph.perez@grafana.com> Signed-off-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>
2023-05-09 05:33:39 +08:00
In Grafana, you can set your dashboards to automatically refresh at a certain interval, no matter what data source you use. Unfortunately, this means that your queries are requesting all the data to be sent again, regardless of whether the data has actually changed. Adding streaming to a plugin helps reduce queries so your dashboard is only updated when new data becomes available.
## Before you begin
This guide assumes that you're already familiar with how to [Build a data source plugin](/tutorials/build-a-data-source-plugin/).
Docs: Plugin doc review for chunk 1-A (#67070) * Plugin doc review for chunk 1-A Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Group of fixes in response to review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Updates for review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixed extra space Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Additional doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc review fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More changes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix links and relrefs using doc-validator advice Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Publishing criteria update Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Markdown fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Link fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix to publishing criteria Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-logs-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/get-started-with-plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/sign-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> --------- Signed-off-by: Joe Perez <joseph.perez@grafana.com> Signed-off-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>
2023-05-09 05:33:39 +08:00
Grafana uses [RxJS](https://rxjs.dev/) to continuously send data from a data source to a panel visualization.
> **Note:** To learn more about RxJs, refer to the [RxJS documentation](https://rxjs.dev/guide/overview).
Docs: Plugin doc review for chunk 1-A (#67070) * Plugin doc review for chunk 1-A Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Group of fixes in response to review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Updates for review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixed extra space Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Additional doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc review fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More changes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix links and relrefs using doc-validator advice Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Publishing criteria update Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Markdown fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Link fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix to publishing criteria Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-logs-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/get-started-with-plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/sign-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> --------- Signed-off-by: Joe Perez <joseph.perez@grafana.com> Signed-off-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>
2023-05-09 05:33:39 +08:00
## Add streaming to your data source
Enable streaming for your data source plugin to update your dashboard when new data becomes available.
For example, a streaming data source plugin can connect to a websocket, or subscribe to a message bus, and update the visualization whenever a new message is available.
Docs: Plugin doc review for chunk 1-A (#67070) * Plugin doc review for chunk 1-A Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Group of fixes in response to review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Updates for review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixed extra space Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Additional doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc review fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More changes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix links and relrefs using doc-validator advice Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Publishing criteria update Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Markdown fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Link fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix to publishing criteria Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-logs-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/get-started-with-plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/sign-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> --------- Signed-off-by: Joe Perez <joseph.perez@grafana.com> Signed-off-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>
2023-05-09 05:33:39 +08:00
### Step 1: Edit the `plugin.json` file
Enable streaming for your data source in the `plugin.json` file.
```json
{
"streaming": true
}
```
Docs: Plugin doc review for chunk 1-A (#67070) * Plugin doc review for chunk 1-A Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Group of fixes in response to review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Updates for review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixed extra space Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Additional doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc review fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More changes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix links and relrefs using doc-validator advice Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Publishing criteria update Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Markdown fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Link fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix to publishing criteria Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-logs-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/get-started-with-plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/sign-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> --------- Signed-off-by: Joe Perez <joseph.perez@grafana.com> Signed-off-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>
2023-05-09 05:33:39 +08:00
### Step 2: Change the signature of the `query` method
Docs: Plugin doc review for chunk 1-A (#67070) * Plugin doc review for chunk 1-A Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Group of fixes in response to review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Updates for review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixed extra space Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Additional doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc review fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More changes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix links and relrefs using doc-validator advice Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Publishing criteria update Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Markdown fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Link fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix to publishing criteria Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-logs-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/get-started-with-plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/sign-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> --------- Signed-off-by: Joe Perez <joseph.perez@grafana.com> Signed-off-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>
2023-05-09 05:33:39 +08:00
Modify the signature of the `query` method to return an `Observable` from the `rxjs` package. Make sure you remove the `async` keyword.
Docs: Plugin doc review for chunk 1-A (#67070) * Plugin doc review for chunk 1-A Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Group of fixes in response to review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Updates for review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixed extra space Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Additional doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc review fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More changes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix links and relrefs using doc-validator advice Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Publishing criteria update Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Markdown fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Link fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix to publishing criteria Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-logs-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/get-started-with-plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/sign-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> --------- Signed-off-by: Joe Perez <joseph.perez@grafana.com> Signed-off-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>
2023-05-09 05:33:39 +08:00
```ts
import { Observable } from 'rxjs';
```
Docs: Plugin doc review for chunk 1-A (#67070) * Plugin doc review for chunk 1-A Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Group of fixes in response to review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Updates for review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixed extra space Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Additional doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc review fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More changes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix links and relrefs using doc-validator advice Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Publishing criteria update Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Markdown fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Link fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix to publishing criteria Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-logs-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/get-started-with-plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/sign-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> --------- Signed-off-by: Joe Perez <joseph.perez@grafana.com> Signed-off-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>
2023-05-09 05:33:39 +08:00
```ts
query(options: DataQueryRequest<MyQuery>): Observable<DataQueryResponse> {
// ...
}
```
Docs: Plugin doc review for chunk 1-A (#67070) * Plugin doc review for chunk 1-A Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Group of fixes in response to review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Updates for review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixed extra space Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Additional doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc review fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More changes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix links and relrefs using doc-validator advice Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Publishing criteria update Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Markdown fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Link fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix to publishing criteria Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-logs-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/get-started-with-plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/sign-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> --------- Signed-off-by: Joe Perez <joseph.perez@grafana.com> Signed-off-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>
2023-05-09 05:33:39 +08:00
### Step 3: Create an `Observable` instance for each query
Docs: Plugin doc review for chunk 1-A (#67070) * Plugin doc review for chunk 1-A Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Group of fixes in response to review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Updates for review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixed extra space Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Additional doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc review fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More changes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix links and relrefs using doc-validator advice Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Publishing criteria update Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Markdown fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Link fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix to publishing criteria Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-logs-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/get-started-with-plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/sign-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> --------- Signed-off-by: Joe Perez <joseph.perez@grafana.com> Signed-off-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>
2023-05-09 05:33:39 +08:00
Create an `Observable` instance for each query, and then combine them all using the `merge` function from the `rxjs` package.
Docs: Plugin doc review for chunk 1-A (#67070) * Plugin doc review for chunk 1-A Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Group of fixes in response to review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Updates for review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixed extra space Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Additional doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc review fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More changes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix links and relrefs using doc-validator advice Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Publishing criteria update Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Markdown fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Link fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix to publishing criteria Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-logs-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/get-started-with-plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/sign-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> --------- Signed-off-by: Joe Perez <joseph.perez@grafana.com> Signed-off-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>
2023-05-09 05:33:39 +08:00
```ts
import { Observable, merge } from 'rxjs';
```
Docs: Plugin doc review for chunk 1-A (#67070) * Plugin doc review for chunk 1-A Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Group of fixes in response to review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Updates for review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixed extra space Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Additional doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc review fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More changes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix links and relrefs using doc-validator advice Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Publishing criteria update Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Markdown fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Link fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix to publishing criteria Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-logs-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/get-started-with-plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/sign-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> --------- Signed-off-by: Joe Perez <joseph.perez@grafana.com> Signed-off-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>
2023-05-09 05:33:39 +08:00
```ts
const observables = options.targets.map((target) => {
return new Observable<DataQueryResponse>((subscriber) => {
// ...
});
});
Docs: Plugin doc review for chunk 1-A (#67070) * Plugin doc review for chunk 1-A Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Group of fixes in response to review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Updates for review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixed extra space Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Additional doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc review fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More changes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix links and relrefs using doc-validator advice Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Publishing criteria update Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Markdown fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Link fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix to publishing criteria Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-logs-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/get-started-with-plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/sign-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> --------- Signed-off-by: Joe Perez <joseph.perez@grafana.com> Signed-off-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>
2023-05-09 05:33:39 +08:00
return merge(...observables);
```
Docs: Plugin doc review for chunk 1-A (#67070) * Plugin doc review for chunk 1-A Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Group of fixes in response to review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Updates for review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixed extra space Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Additional doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc review fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More changes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix links and relrefs using doc-validator advice Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Publishing criteria update Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Markdown fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Link fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix to publishing criteria Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-logs-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/get-started-with-plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/sign-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> --------- Signed-off-by: Joe Perez <joseph.perez@grafana.com> Signed-off-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>
2023-05-09 05:33:39 +08:00
### Step 4: Create a `CircularDataFrame` instance
Docs: Plugin doc review for chunk 1-A (#67070) * Plugin doc review for chunk 1-A Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Group of fixes in response to review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Updates for review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixed extra space Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Additional doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc review fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More changes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix links and relrefs using doc-validator advice Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Publishing criteria update Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Markdown fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Link fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix to publishing criteria Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-logs-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/get-started-with-plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/sign-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> --------- Signed-off-by: Joe Perez <joseph.perez@grafana.com> Signed-off-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>
2023-05-09 05:33:39 +08:00
In the `subscribe` function, create a `CircularDataFrame` instance.
Docs: Plugin doc review for chunk 1-A (#67070) * Plugin doc review for chunk 1-A Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Group of fixes in response to review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Updates for review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixed extra space Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Additional doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc review fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More changes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix links and relrefs using doc-validator advice Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Publishing criteria update Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Markdown fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Link fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix to publishing criteria Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-logs-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/get-started-with-plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/sign-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> --------- Signed-off-by: Joe Perez <joseph.perez@grafana.com> Signed-off-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>
2023-05-09 05:33:39 +08:00
```ts
import { CircularDataFrame } from '@grafana/data';
```
Docs: Plugin doc review for chunk 1-A (#67070) * Plugin doc review for chunk 1-A Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Group of fixes in response to review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Updates for review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixed extra space Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Additional doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc review fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More changes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix links and relrefs using doc-validator advice Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Publishing criteria update Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Markdown fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Link fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix to publishing criteria Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-logs-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/get-started-with-plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/sign-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> --------- Signed-off-by: Joe Perez <joseph.perez@grafana.com> Signed-off-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>
2023-05-09 05:33:39 +08:00
```ts
const frame = new CircularDataFrame({
append: 'tail',
capacity: 1000,
});
frame.refId = query.refId;
frame.addField({ name: 'time', type: FieldType.time });
frame.addField({ name: 'value', type: FieldType.number });
```
Docs: Plugin doc review for chunk 1-A (#67070) * Plugin doc review for chunk 1-A Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Group of fixes in response to review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Updates for review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixed extra space Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Additional doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc review fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More changes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix links and relrefs using doc-validator advice Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Publishing criteria update Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Markdown fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Link fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix to publishing criteria Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-logs-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/get-started-with-plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/sign-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> --------- Signed-off-by: Joe Perez <joseph.perez@grafana.com> Signed-off-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>
2023-05-09 05:33:39 +08:00
Circular data frames have a limited capacity. When a circular data frame reaches its capacity, the oldest data point is removed.
Docs: Plugin doc review for chunk 1-A (#67070) * Plugin doc review for chunk 1-A Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Group of fixes in response to review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Updates for review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixed extra space Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Additional doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc review fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More changes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix links and relrefs using doc-validator advice Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Publishing criteria update Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Markdown fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Link fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix to publishing criteria Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-logs-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/get-started-with-plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/sign-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> --------- Signed-off-by: Joe Perez <joseph.perez@grafana.com> Signed-off-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>
2023-05-09 05:33:39 +08:00
### Step 5: Send the updated data frame
Docs: Plugin doc review for chunk 1-A (#67070) * Plugin doc review for chunk 1-A Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Group of fixes in response to review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Updates for review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixed extra space Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Additional doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc review fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More changes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix links and relrefs using doc-validator advice Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Publishing criteria update Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Markdown fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Link fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix to publishing criteria Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-logs-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/get-started-with-plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/sign-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> --------- Signed-off-by: Joe Perez <joseph.perez@grafana.com> Signed-off-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>
2023-05-09 05:33:39 +08:00
Use `subscriber.next()` to send the updated data frame whenever you receive new updates.
Docs: Plugin doc review for chunk 1-A (#67070) * Plugin doc review for chunk 1-A Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Group of fixes in response to review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Updates for review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixed extra space Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Additional doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc review fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More changes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix links and relrefs using doc-validator advice Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Publishing criteria update Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Markdown fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Link fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix to publishing criteria Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-logs-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/get-started-with-plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/sign-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> --------- Signed-off-by: Joe Perez <joseph.perez@grafana.com> Signed-off-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>
2023-05-09 05:33:39 +08:00
```ts
import { LoadingState } from '@grafana/data';
```
Docs: Plugin doc review for chunk 1-A (#67070) * Plugin doc review for chunk 1-A Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Group of fixes in response to review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Updates for review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixed extra space Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Additional doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc review fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More changes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix links and relrefs using doc-validator advice Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Publishing criteria update Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Markdown fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Link fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix to publishing criteria Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-logs-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/get-started-with-plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/sign-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> --------- Signed-off-by: Joe Perez <joseph.perez@grafana.com> Signed-off-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>
2023-05-09 05:33:39 +08:00
```ts
const intervalId = setInterval(() => {
frame.add({ time: Date.now(), value: Math.random() });
Docs: Plugin doc review for chunk 1-A (#67070) * Plugin doc review for chunk 1-A Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Group of fixes in response to review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Updates for review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixed extra space Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Additional doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc review fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More changes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix links and relrefs using doc-validator advice Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Publishing criteria update Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Markdown fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Link fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix to publishing criteria Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-logs-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/get-started-with-plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/sign-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> --------- Signed-off-by: Joe Perez <joseph.perez@grafana.com> Signed-off-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>
2023-05-09 05:33:39 +08:00
subscriber.next({
data: [frame],
key: query.refId,
state: LoadingState.Streaming,
});
}, 500);
Docs: Plugin doc review for chunk 1-A (#67070) * Plugin doc review for chunk 1-A Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Group of fixes in response to review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Updates for review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixed extra space Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Additional doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc review fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More changes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix links and relrefs using doc-validator advice Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Publishing criteria update Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Markdown fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Link fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix to publishing criteria Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-logs-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/get-started-with-plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/sign-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> --------- Signed-off-by: Joe Perez <joseph.perez@grafana.com> Signed-off-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>
2023-05-09 05:33:39 +08:00
return () => {
clearInterval(intervalId);
};
```
Docs: Plugin doc review for chunk 1-A (#67070) * Plugin doc review for chunk 1-A Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Group of fixes in response to review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Updates for review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixed extra space Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Additional doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc review fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More changes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix links and relrefs using doc-validator advice Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Publishing criteria update Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Markdown fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Link fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix to publishing criteria Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-logs-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/get-started-with-plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/sign-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> --------- Signed-off-by: Joe Perez <joseph.perez@grafana.com> Signed-off-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>
2023-05-09 05:33:39 +08:00
> **Note:** In practice, you'd call `subscriber.next` as soon as you receive new data from a websocket or a message bus. In the example above, data is being received every 500 milliseconds.
Docs: Plugin doc review for chunk 1-A (#67070) * Plugin doc review for chunk 1-A Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Group of fixes in response to review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Updates for review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixed extra space Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Additional doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc review fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More changes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix links and relrefs using doc-validator advice Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Publishing criteria update Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Markdown fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Link fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix to publishing criteria Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-logs-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/get-started-with-plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/sign-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> --------- Signed-off-by: Joe Perez <joseph.perez@grafana.com> Signed-off-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>
2023-05-09 05:33:39 +08:00
### Example code for final `query` method
```ts
query(options: DataQueryRequest<MyQuery>): Observable<DataQueryResponse> {
const streams = options.targets.map(target => {
const query = defaults(target, defaultQuery);
return new Observable<DataQueryResponse>(subscriber => {
const frame = new CircularDataFrame({
append: 'tail',
capacity: 1000,
});
frame.refId = query.refId;
frame.addField({ name: 'time', type: FieldType.time });
frame.addField({ name: 'value', type: FieldType.number });
const intervalId = setInterval(() => {
frame.add({ time: Date.now(), value: Math.random() });
subscriber.next({
data: [frame],
key: query.refId,
state: LoadingState.Streaming,
});
}, 100);
return () => {
clearInterval(intervalId);
};
});
});
return merge(...streams);
}
```
Docs: Plugin doc review for chunk 1-A (#67070) * Plugin doc review for chunk 1-A Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Group of fixes in response to review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Updates for review comments Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixed extra space Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Additional doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More doc fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc review fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * More changes from doc review Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix links and relrefs using doc-validator advice Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Publishing criteria update Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Markdown fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Testing Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Link fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Fix to publishing criteria Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Doc fix Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-logs-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/build-a-streaming-data-source-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/get-started-with-plugins/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/publish-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/developers/plugins/sign-a-plugin.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> --------- Signed-off-by: Joe Perez <joseph.perez@grafana.com> Signed-off-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>
2023-05-09 05:33:39 +08:00
One limitation with this example is that the panel visualization is cleared every time you update the dashboard. If you have access to historical data, you can add it, or _backfill_ it, to the data frame before the first call to `subscriber.next()`.
For another example of a streaming plugin, refer to the [streaming websocket example](https://github.com/grafana/grafana-plugin-examples/tree/main/examples/datasource-streaming-websocket) on GitHub.