Hi @infofcc3 /Team , Thanks for the quick response and for always helping us troubleshoot these issues.
Unfortunately, the change did not fix the problem. Since I am not very familiar with the codebase, I am not entirely sure whether I modified the exact section you were referring to. From what I can see, there are some slight differences, and I’m not sure whether those differences are relevant.
Anyway, please refer to the details below for reference.
Original file:
unction*(){var e;const t=yield this.callHealthCheck();if("error"===(null===(e=t.status)||void 0===e?void 0:e.toLowerCase()))return Promise.reject({status:"error",message:t.message,error:new ae.HealthCheckError(t.message,t.details)});const r=yield y_(this.uid);try{yield r.getProjects()}catch(e){var n,o,i;return Promise.reject({status:"error",message:(null===(n=e.data)||void 0===n?void 0:n.message)||"Error connecting to resource manager.",error:new ae.HealthCheckError(null===(o=e.data)||void 0===o?void 0:o.message,null===(i=e.data)||void 0===i?void 0:i.details)})}return{status:"OK",message:"Data source is working"}}).call(this)}applyTemplateVariables(e,t){const r=(0,ae.getTemplateSrv)().replace(e.rawSql,t,l_);return{refId:e.refId,hide:e.hide,key:e.key,queryType:e.queryType,datasource:e.datasource,rawSql:r,format:e.format,connectionArgs:{dataset:e.dataset,table:e.table,location:e.location,enableStorageAPI:e.enableStorageAPI||!1}}}constructor(e){super(e),aw(this,"instanceSettings",void 0),aw(this,"jsonData",void 0),aw(this,"authenticationType",void 0),aw(this,"annotations",void 0),this.instanceSettings=e,this.annotations={},this.jsonData=e.jsonData,this.authenticationType=e.jsonData.authenticationType||ce.JWT,this.variables={getType:()=>R.VariableSupportType.Custom,editor:nw,query:e=>{const t=e.targets.map(e=>lw(uw({},e),{refId:e.refId||(0,qE.uniqueId)("tempVar")}));return this.query(lw(uw({},e),{targets:t}))}}}}const pw=new R.DataSourcePlugin(cw).setConfigEditor(e=>{const{options:t,onOptionsChange:r}=e,{jsonData:n}=t,o=n.authenticationType===ce.JWT||n.authenticationType===ce.GCE;return C().createElement(C().Fragment,null,C().createElement(ne,{dataSourceName:"Google BigQuery",docsLink:" Google BigQuery plugin for Grafana | Grafana Labs ",hasRequiredFields:!1}),C().createElement(me,null),C().createElement(ye,null),C().createElement(me,null),C().createElement(ee,{options:t,onOptionsChange:e=>{r(_e(Oe({},e),{jsonData:_e(Oe({},e.jsonData),{authenticationType:e.jsonData.authenticationType,oauthPassThru:e.jsonData.authenticationType===ce.ForwardOAuthIdentity})}))},authOptions:de,showServiceAccountImpersonationConfig:o}),n.authenticationType===
After making the changes:
unction*(){var e;const t=yield this.callHealthCheck();if("error"===(null===(e=t.status)||void 0===e?void 0:e.toLowerCase()))return Promise.reject({status:"error",message:t.message,error:new ae.HealthCheckError(t.message,t.details)});const r=yield y_(this.uid);try{yield r.getProjects()}catch(e){var n,o,i;return Promise.reject({status:"error",message:(null===(n=e.data)||void 0===n?void 0:n.message)||"Error connecting to resource manager.",error:new ae.HealthCheckError(null===(o=e.data)||void 0===o?void 0:o.message,null===(i=e.data)||void 0===i?void 0:i.details)})}return{status:"OK",message:"Data source is working"}}).call(this)}applyTemplateVariables(e,t){const r=(0,ae.getTemplateSrv)().replace(e.rawSql,t,l_);return{refId:e.refId,hide:e.hide,key:e.key,queryType:e.queryType,datasource:e.datasource,rawSql:r,format:e.format,connectionArgs:{dataset:e.dataset,table:e.table,location:e.location,enableStorageAPI:e.enableStorageAPI||!1}}}constructor(e){super(e),aw(this,"instanceSettings",void 0),aw(this,"jsonData",void 0),aw(this,"authenticationType",void 0),aw(this,"annotations",void 0),this.instanceSettings=e,this.annotations={},this.jsonData=e.jsonData,this.authenticationType=e.jsonData.authenticationType||ce.JWT,this.variables={getType:()=>R.VariableSupportType.Custom,editor:nw,getQueryDisplayText:(e)=>{return(e&&e.rawSql)?e.rawSql:“”},query:e=>{const t=e.targets.map(e=>lw(uw({},e),{refId:e.refId||(0,qE.uniqueId)("tempVar")}));return this.query(lw(uw({},e),{targets:t}))}}}}const pw=new R.DataSourcePlugin(cw).setConfigEditor(e=>{const{options:t,onOptionsChange:r}=e,{jsonData:n}=t,o=n.authenticationType===ce.JWT||n.authenticationType===ce.GCE;return C().createElement(C().Fragment,null,C().createElement(ne,{dataSourceName:"Google BigQuery",docsLink:" Google BigQuery plugin for Grafana | Grafana Labs ",hasRequiredFields:!1}),C().createElement(me,null),C().createElement(ye,null),C().createElement(me,null),C().createElement(ee,{options:t,onOptionsChange:e=>{r(_e(Oe({},e),{jsonData:_e(Oe({},e.jsonData),{authenticationType:e.jsonData.authenticationType,oauthPassThru:e.jsonData.authenticationType===ce.ForwardOAuthIdentity})}))},authOptions:de,showSe
/this.variables
It looks like this after the change.
Also, the plugins section and allow_loading_unsigned_plugins setting were not present in the configuration file, so I added them as mentioned below:
[dataproxy]
timeout = 300
[plugins]
allow_loading_unsigned_plugins = grafana-bigquery-datasource
After restarting Grafana, the entire data source stopped working and showed the error:
“Plugin disabled due to modified content”
Please see the attached screenshot for reference.
FYI, from my observations, the issue appears to be related to variables of type Query. It does not seem to matter which data source is selected; the same issue occurs across all data sources.
Thanks again for all your help and support. We look forward to getting this fixed, as without it, it is very difficult to cross-check each and every variable and verify what is being passed internally.
This display functionality is very basic but extremely useful, as it helps save a significant amount of time and effort during validation and troubleshooting.