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

feat: add system field to data source instances #1161

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

darrenjaneczek
Copy link

@darrenjaneczek darrenjaneczek commented Dec 2, 2024

What this PR does / why we need it:

This PR proposes to add a System field to DataSourceInstanceSettings, which will be used by Grafana to indicate that the datasource instance should be hidden from view.

This PR is a dependency of the functionality here:

Example uses of "system" data sources

1:n proxies

Sometimes plugin developers need the ability to proxy to multiple services of the same type. By creating multiple data sources, an app plugin can achieve this. The app plugin would need to take responsibility for creating and configuring their system data sources.

General persistence

An additional functionality that hidden datasource instances could provide, is in persist bits of JSON data. In certain environments (like Grafana cloud), the provisioning mechanism will completely rewrite the jsonData of provisioned plugins -- having a data source instantiated allows an app plugin to store some state that will not be automatically deleted in instance refresh.

The desire to make them invisible

Currently data sources can be used to provide the above uses. However, it might not be suitable to view these along with other data sources in typical Grafana views. If there is no need to access these "data sources" in a dashboard, or in the Explore view, adding this "system" flag, a developer can hide these data sources.

@CLAassistant
Copy link

CLAassistant commented Dec 2, 2024

CLA assistant check
All committers have signed the CLA.

@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.

Copy link

This pull request has been automatically marked as stale because it has not had activity in the last 90 days. It will be closed in 2 weeks if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@github-actions github-actions bot added the stale Issue or PR without activity label Mar 11, 2025
Copy link
Member

@ryantxu ryantxu left a comment

Choose a reason for hiding this comment

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

if we do not need to update protobuf that would be better

@@ -38,6 +38,7 @@ message DataSourceInstanceSettings {
// The API version when the settings were saved.
// NOTE: this may be an older version than the current apiVersion
string apiVersion = 12;
bool system = 13;
Copy link
Member

Choose a reason for hiding this comment

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

I get why you may need this in the UI... but I do not get why the protobuf needs it

@github-actions github-actions bot removed the stale Issue or PR without activity label Mar 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants