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

POC: Generate query spec #291

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

POC: Generate query spec #291

wants to merge 14 commits into from

Conversation

ryantxu
Copy link
Member

@ryantxu ryantxu commented Feb 17, 2024

Using grafana/grafana-plugin-sdk-go#897 to generate a query spec

@ryantxu ryantxu requested a review from a team as a code owner February 17, 2024 03:35
@ryantxu ryantxu requested review from gabor, yesoreyeram and zoltanbedi and removed request for a team February 17, 2024 03:35
@gabor
Copy link
Contributor

gabor commented Feb 19, 2024

hi @ryantxu , sorry are you looking for feedback in this PR? (i assume you're not, but want to be sure 😄 )

@ryantxu
Copy link
Member Author

ryantxu commented Feb 19, 2024

@gabor Only in the context of https://docs.google.com/document/d/1la4XW9BZ5XXyU91ZjbzEPE4jvPAyusE0dfJdsrCbbPI/edit#heading=h.5sybau7waq2q. -- trying to get a feeling if this is a reasonable approach or not. Github is interesting because "options" means something different for each query type

@@ -0,0 +1,891 @@
{
"kind": "QueryTypeDefinitionList",
Copy link
Contributor

Choose a reason for hiding this comment

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

trying to understand this better. How this kind:QueryTypeDefinitionList maps to queryType:Issues in the actual payload? Am I missing any other contract here? Even if we argue queryType is not owned by the plugin but by the grafana(??), at least plugins should pass if they really use queryType and if it use, the schema should have details of all the possible query types.

image

Comment on lines +2 to +3
"kind": "QueryTypeDefinitionList",
"apiVersion": "query.grafana.app/v0alpha1",
Copy link
Member

Choose a reason for hiding this comment

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

Might not understand everything here, but this feels a bit limited if all plugins share the same apiVersion and colliding kinds?

Copy link
Member Author

Choose a reason for hiding this comment

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

In this case the apiVersion defines how to read this JSON file. The apiVersion for each datasource is independent.

This is the equivalent to the apiVersion on a CRD file, not the custom resource (where the apiVersion is defined inside the CRD!)

Copy link
Member Author

Choose a reason for hiding this comment

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

the schema for this file is the same across all data sources. If/when we need to make breaking changes to the QueryTypeDefinitionList then the apiVersion would update.

Copy link
Member

Choose a reason for hiding this comment

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

Got it 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

4 participants