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: Split fetch data topic in two #1115

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

josmperez
Copy link
Contributor

Split fetch data with data proxy into two: data source plugins and app plugins.

Fixes: #977

@josmperez josmperez added type/docs Changes only affect the documentation documentation Changes only affect the documentation labels Sep 12, 2024
@josmperez josmperez self-assigned this Sep 12, 2024
@josmperez josmperez requested a review from a team as a code owner September 12, 2024 20:49
@josmperez josmperez requested review from mckn and removed request for a team September 12, 2024 20:49
Copy link

github-actions bot commented Sep 12, 2024

Hello! 👋 This repository uses Auto for releasing packages using PR labels.

✨ This PR can be merged. It will not be considered when calculating future versions of the npm packages and will not appear in the changelogs.

@josmperez josmperez added no-changelog Don't include in changelog and version calculations and removed documentation Changes only affect the documentation labels Sep 12, 2024
@@ -0,0 +1,132 @@
---
id: fetch-data-from-frontend-to-app
title: Fetch data from frontend code to app plugin using the data proxy
Copy link
Member

@academo academo Sep 13, 2024

Choose a reason for hiding this comment

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

This title is a bit confusing to read for me, it makes it looks like the frontend code and the app plugin are two different things that interact with each other. which though they technically are, it is not what we trying to show here.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe change it to the following?

Suggested change
title: Fetch data from frontend code to app plugin using the data proxy
title: Fetch data from frontend code in app plugin using the data proxy


This guide explains how the data proxy works in app plugins and explores common issues in its usage. For usage related to data source plugins, refer to our [documentation](../data-source-plugins/fetch-data-from-frontend.md)

## How does it work?
Copy link
Member

Choose a reason for hiding this comment

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

I noted that most or all of the content here until the specific app example is a copy of the other article. could you instead create a shared file and use it here? that way we don't have to maintain two different articles with the same content.

Copy link
Collaborator

@mckn mckn left a comment

Choose a reason for hiding this comment

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

Great work on this! I left some comments worth to consider but overall it looks great!

@@ -0,0 +1,132 @@
---
id: fetch-data-from-frontend-to-app
title: Fetch data from frontend code to app plugin using the data proxy
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe change it to the following?

Suggested change
title: Fetch data from frontend code to app plugin using the data proxy
title: Fetch data from frontend code in app plugin using the data proxy


- for overcoming cross-site (CORS) limitations, or
- for performing authenticated requests, or
- for sending other sensitive data from your plugin configuration to Grafana.
Copy link
Collaborator

Choose a reason for hiding this comment

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

It could also be to external services/resources. E.g. if your plugin configure an authentication token that you need to use to interact with a third party API. Then you can use the data proxy to append that token before sending the request to the third party API without leaking the token to the frontend.

@@ -1,7 +1,7 @@
---
id: fetch-data-from-frontend
title: Fetch data from frontend code using the data proxy
description: Learn how to use the data proxy API to fetch data from frontend code in data source and app plugins in Grafana
title: Fetch data from frontend code to data source plugin using the data proxy
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
title: Fetch data from frontend code to data source plugin using the data proxy
title: Fetch data from frontend code in a data source plugin using the data proxy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-changelog Don't include in changelog and version calculations type/docs Changes only affect the documentation
Projects
Status: 🔬 In review
Development

Successfully merging this pull request may close these issues.

Docs: Split content in "Fetch data from frontend" topic
3 participants