AzureMonitor: Remove workaround in Logs editor (#48104)

pull/46372/head
Andres Martinez Gotor 4 years ago committed by GitHub
parent cb2c6fe6bc
commit 7cfab77650
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      public/app/plugins/datasource/grafana-azure-monitor-datasource/azure_log_analytics/azure_log_analytics_datasource.test.ts
  2. 13
      public/app/plugins/datasource/grafana-azure-monitor-datasource/azure_log_analytics/response_parser.ts

@ -138,10 +138,7 @@ describe('AzureLogAnalyticsDatasource', () => {
it('should include template variables as global parameters', async () => {
const result = await ctx.ds.azureLogAnalyticsDatasource.getKustoSchema('myWorkspace');
expect(result.globalParameters.map((f: { name: string }) => f.name)).toEqual([
`$${singleVariable.name}`,
'$__timeFilter',
]);
expect(result.globalParameters.map((f: { name: string }) => f.name)).toEqual([`$${singleVariable.name}`]);
});
});

@ -236,8 +236,8 @@ export function transformMetadataToKustoSchema(
{
name: 'timeColumn',
type: 'System.String',
defaultValue: 'TimeGenerated',
cslDefaultValue: 'TimeGenerated',
defaultValue: '""',
cslDefaultValue: '""',
},
],
},
@ -291,15 +291,6 @@ export function transformMetadataToKustoSchema(
};
});
// It's not possible to define optional paramaters in Kusto
// and it's not possible to define the same function twice so
// we are defining $__timeFilter also as a parameter when used
// with no arguments as a workaround
globalParameters.push({
name: `$__timeFilter`,
type: 'boolean',
});
return {
clusterType: 'Engine',
cluster: {

Loading…
Cancel
Save