Skip to content

Conversation

ryantxu
Copy link
Contributor

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

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
Contributor 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
Contributor 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

Choose a reason for hiding this comment

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

Got it 👍

@gabor gabor removed their request for review October 2, 2024 08:04
@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.

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.

5 participants