diff --git a/grafana-plugin/src/pages/insights/variables.ts b/grafana-plugin/src/pages/insights/variables.ts index 199bcfd96f..b8dbd6e2fd 100644 --- a/grafana-plugin/src/pages/insights/variables.ts +++ b/grafana-plugin/src/pages/insights/variables.ts @@ -15,13 +15,18 @@ const DEFAULT_VARIABLE_CONFIG: Partial ({ - datasource: new DataSourceVariable({ - name: 'datasource', - label: 'Data source', - pluginId: 'prometheus', - value: 'grafanacloud-usage', - }), +const getVariables = ({ isOpenSource, datasource, stack }: InsightsConfig) => ({ + // Selectable + ...(isOpenSource + ? { + datasource: new DataSourceVariable({ + name: 'datasource', + label: 'Data source', + pluginId: 'prometheus', + value: 'grafanacloud-usage', + }), + } + : {}), team: new QueryVariable({ ...DEFAULT_VARIABLE_CONFIG, name: 'team',