AzureMonitor: Remove workaround in Logs editor (#48104)
This commit is contained in:
+1
-4
@@ -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}`]);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
+2
-11
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user