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

Pass if the query doesn't have Builder or Settings #138

Merged
merged 1 commit into from Jan 24, 2023
Merged

Pass if the query doesn't have Builder or Settings #138

merged 1 commit into from Jan 24, 2023

Conversation

ghost
Copy link

@ghost ghost commented Jan 24, 2023

Why?

Sometime Grafana would invoke the plugin without the Builder or the Settings field. This usually happens before the user has entered any query at all.
In this case, we just pass the query evaluation.
Details on the bug can be found the below linked issue

The invalid query looks like this,

{
    "builder": null,
    "datasource": {
        "type": "grafadruid-druid-datasource",
        "uid": "P274814F1A96FB52D"
    },
    "datasourceId": 1,
    "expr": "{\"builder\":null,\"settings\":{}}",
    "intervalMs": 20000,
    "maxDataPoints": 1198,
    "refId": "A",
    "settings": {}
}

Issues Fixed

#133

Testing

  • Mostly manually tested this. Here's the log I see when we hit an invalid query now.
logger=plugin.grafadruid-druid-datasource t=2023-01-24T14:46:45.6802033Z level=info msg="Invalid query issued to Druid Plugin: missing builder or settings" query:="{\"builder\":null,\"datasource\":{\"type\":\"grafadruid-druid-datasource\",\"uid\":\"P274814F1A96FB52D\"},\"datasourceId\":1,\"expr\":\"{\\\"builder\\\":null,\\\"settings\\\":{}}\",\"intervalMs\":20000,\"maxDataPoints\":1198,\"refId\":\"A\",\"settings\":{}}"

  • Apart from this, I was able to run a successful build and test out panel creation and querying from the Grafana UI

Side note

The build experience in this repo is very smooth. Kudos to the author!

@jbguerraz
Copy link
Contributor

Thank you a lot @MohammadGhazanfar 🥇
LGTM!

@jbguerraz jbguerraz merged commit 6818ead into grafadruid:master Jan 24, 2023
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.

2 participants