Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Docs: Enhance datasource READMEs #254

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

Conversation

josmperez
Copy link
Contributor

Enhance READMEs for datasource plugins. Note that installation information was missing for a few of these plugins and I have drafted some content based on similar plugins, but this needs to be checked for accuracy.

@josmperez josmperez added the documentation Improvements or additions to documentation label Mar 17, 2024
@josmperez josmperez self-assigned this Mar 17, 2024
@josmperez josmperez requested review from a team as code owners March 17, 2024 23:55
@josmperez josmperez requested review from Ukochka, wbrowne, oshirohugo and xnyo and removed request for a team March 17, 2024 23:55
Copy link
Contributor

@sympatheticmoose sympatheticmoose left a comment

Choose a reason for hiding this comment

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

Some initial comments

examples/datasource-basic/README.md Outdated Show resolved Hide resolved
examples/datasource-basic/README.md Outdated Show resolved Hide resolved
examples/datasource-basic/README.md Show resolved Hide resolved
examples/datasource-http-backend/README.md Outdated Show resolved Hide resolved
examples/datasource-http/README.md Outdated Show resolved Hide resolved
examples/datasource-streaming-backend-websocket/README.md Outdated Show resolved Hide resolved
examples/datasource-streaming-backend-websocket/README.md Outdated Show resolved Hide resolved
examples/datasource-streaming-backend-websocket/README.md Outdated Show resolved Hide resolved
examples/panel-datalinks/README.md Show resolved Hide resolved
Copy link
Contributor Author

@josmperez josmperez left a comment

Choose a reason for hiding this comment

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

Incorporated feedback from reviewers.

examples/datasource-basic/README.md Show resolved Hide resolved
examples/datasource-http/README.md Outdated Show resolved Hide resolved
examples/datasource-http/README.md Outdated Show resolved Hide resolved
examples/datasource-logs/README.md Outdated Show resolved Hide resolved
@josmperez
Copy link
Contributor Author

I found a PR that dropped off my radar screen. I've incorporated feedback from reviwers.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.


This example queries data from an HTTP API. The HTTP API returns data in JSON format, which is then converted to data frames.

This differs from the `datasource-http` example because the data fetching happens in the plugin backend rather than going through Grafana's data source HTTP proxy.
This plugin differs from the `datasource-http` example because the data fetching happens in the plugin backend rather than going through Grafana's data source HTTP proxy.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
This plugin differs from the `datasource-http` example because the data fetching happens in the plugin backend rather than going through Grafana's data source HTTP proxy.
This plugin differs from the `datasource-http` example because the data fetching happens in the plugin backend rather than the front end code fetching through Grafana's data source HTTP proxy.


This example queries data from an HTTP API.
This repository contains a data source plugin that uses HTTP through Grafana's data source HTTP proxy.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
This repository contains a data source plugin that uses HTTP through Grafana's data source HTTP proxy.
This repository contains a data source plugin that fetches data in the front end through Grafana's data source HTTP proxy.

This repository contains a data source plugin that uses HTTP through Grafana's data source HTTP proxy.
## Overview

The Grafana HTTP Data Source Plugin shows the integration of a backend HTTP service as a custom data source within Grafana. This plugin serves as a reference implementation for developers seeking to incorporate HTTP-based data sources into their Grafana dashboards.
Copy link
Member

Choose a reason for hiding this comment

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

better remove the mention of "backend http service" and simply it call it "API" or "HTTP API" to not confuse people that might think there's backend code in this example.

Suggested change
The Grafana HTTP Data Source Plugin shows the integration of a backend HTTP service as a custom data source within Grafana. This plugin serves as a reference implementation for developers seeking to incorporate HTTP-based data sources into their Grafana dashboards.
The Grafana HTTP Data Source Plugin shows the integration of a HTTP API as a custom data source within Grafana. This plugin serves as a reference implementation for developers seeking to incorporate frontend HTTP-based data sources into their Grafana dashboards.


Grafana supports a wide range of data sources, including Prometheus, MySQL, and Datadog. There’s a good chance you can already visualize metrics from the systems you have set up. In some cases, though, you already have an in-house metrics solution that you’d like to add to your Grafana dashboards. Grafana data source plugins enable you to integrate such solutions with Grafana.

This plugin differs from the `datasource-http-backend` example because the data fetching happens through Grafana's data source HTTP proxy rather than going through the plugin backend.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
This plugin differs from the `datasource-http-backend` example because the data fetching happens through Grafana's data source HTTP proxy rather than going through the plugin backend.
This plugin differs from the `datasource-http-backend` example because the data fetching happens in the frontend through Grafana's data source HTTP proxy rather than going through the plugin backend.

npm run dev
```

3. Build plugin in production mode:
Copy link
Member

Choose a reason for hiding this comment

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

We don't need to call for users to run both npm run dev and npm run build. We can ask them simply to run npm run build and that will be it.

These instructions are also missing calling npm run server which starts a docker container with grafana running the server.

The mockserver required for testing has been included in the Docker Compose file

Add a new data source in Grafana using the following URL:
```
http://host.docker.internal:10000/metrics
```

Copy link
Member

Choose a reason for hiding this comment

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

We are missing the instructions to run the docker container so one can see the plugin running npm run server do we want to add that?

```bash
$ npm install
$ npm run build
Copy link
Member

Choose a reason for hiding this comment

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

We are missing the instructions to run the docker container so one can see the plugin running npm run server do we want to add that?


## Build
The plugin connects to the backend through a streaming connection and the backend establishes a connection to an external WebSocket server.
Copy link
Member

@academo academo Nov 25, 2024

Choose a reason for hiding this comment

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

This whole sentence is strange

Suggested change
The plugin connects to the backend through a streaming connection and the backend establishes a connection to an external WebSocket server.
The plugin frontend connects to the backend through with a websocket and the backend establishes a connection to an external server.

@@ -15,7 +20,7 @@ npm install
npm run build
```

and run the Grafana and the example websocket server with Docker compose:
2. Run the Grafana and the example WebSocket server with Docker compose:

```sh
cd streaming-backend-websocket-plugin
Copy link
Member

@academo academo Nov 25, 2024

Choose a reason for hiding this comment

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

wrong path

Suggested change
cd streaming-backend-websocket-plugin
cd websocket-server

@@ -15,7 +20,7 @@ npm install
npm run build
```

and run the Grafana and the example websocket server with Docker compose:
2. Run the Grafana and the example WebSocket server with Docker compose:
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't run grafana. only the websocket server

Suggested change
2. Run the Grafana and the example WebSocket server with Docker compose:
2. Run the example WebSocket server with Docker compose:

@@ -15,7 +20,7 @@ npm install
npm run build
Copy link
Member

@academo academo Nov 25, 2024

Choose a reason for hiding this comment

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

Suggested change
npm run build
npm run build
npm run server

## Build
## Overview

The Streaming WebSocket Data Source Plugin illustrates the integration of WebSocket-based data sources into Grafana dashboards. This plugin serves as a reference implementation for developers aiming to incorporate real-time streaming data into their Grafana visualizations.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
The Streaming WebSocket Data Source Plugin illustrates the integration of WebSocket-based data sources into Grafana dashboards. This plugin serves as a reference implementation for developers aiming to incorporate real-time streaming data into their Grafana visualizations.
The Frontend Streaming WebSocket Data Source Plugin illustrates the integration of WebSocket-based data sources into Grafana dashboards. This plugin serves as a reference implementation for developers aiming to incorporate real-time streaming data into their Grafana visualizations.


The Streaming WebSocket Data Source Plugin illustrates the integration of WebSocket-based data sources into Grafana dashboards. This plugin serves as a reference implementation for developers aiming to incorporate real-time streaming data into their Grafana visualizations.

This server returns random numeric values at random intervals.
Copy link
Member

@academo academo Nov 25, 2024

Choose a reason for hiding this comment

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

Which server?

Copy link
Member

@academo academo left a comment

Choose a reason for hiding this comment

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

Thanks @josmperez for all the work in these READMEs but there's some work to be done:

  • We need to make sure all READMEs we are modifying are following the same format and contain the same amount of instructions. For example many examples call to run npm run server and some not. Some call to run the e2e tests as part of the instructions to "get started" but there's no reason at all to run the e2e tests if you want to run the example.
  • We must mention frontend and backend likewise to make sure people understand examples that are frontend-oriented and backend-oriented. specially in data sources.
  • There's this sentence we throw aroung sometimes Grafana supports a wide range of data sources, including Prometheus, MySQL, and even Datadog. There’s a... that doesn't really fit in an example readme (IMO). but we don't consistently use it. Let's either put it everywhere or remove it.
  • In the places we mention Grafana's data source HTTP proxy we must mention that the request happens in the frontend and THEN goes through the data source http proxy. So it is clear this is not a custom backend component.

There are a few places where the text is out of context or just not related at all with th example README. I wrote individual comments about those I found but there might be more.

@josmperez
Copy link
Contributor Author

Thanks @josmperez for all the work in these READMEs but there's some work to be done:

  • We need to make sure all READMEs we are modifying are following the same format and contain the same amount of instructions. For example many examples call to run npm run server and some not. Some call to run the e2e tests as part of the instructions to "get started" but there's no reason at all to run the e2e tests if you want to run the example.
  • We must mention frontend and backend likewise to make sure people understand examples that are frontend-oriented and backend-oriented. specially in data sources.
  • There's this sentence we throw aroung sometimes Grafana supports a wide range of data sources, including Prometheus, MySQL, and even Datadog. There’s a... that doesn't really fit in an example readme (IMO). but we don't consistently use it. Let's either put it everywhere or remove it.
  • In the places we mention Grafana's data source HTTP proxy we must mention that the request happens in the frontend and THEN goes through the data source http proxy. So it is clear this is not a custom backend component.

There are a few places where the text is out of context or just not related at all with th example README. I wrote individual comments about those I found but there might be more.

I'm happy to take another look at this PR and make the requested changes; however, recently at the offsite we discussed long-term plans that would involve removing many of these examples. For this reason, I'd like to pause work on this until I've had a chance to re-prioritize.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
Status: 🧑‍💻 In development
Development

Successfully merging this pull request may close these issues.

6 participants