AzureMonitor: Remove workaround in Logs editor (#48104)

This commit is contained in:
Andres Martinez Gotor
2022-04-25 12:34:12 +02:00
committed by GitHub
parent cb2c6fe6bc
commit 7cfab77650
2 changed files with 3 additions and 15 deletions
@@ -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: {