AzureMonitor: Remove workaround in Logs editor (#48104) (#48172)

(cherry picked from commit 7cfab77650)

Co-authored-by: Andres Martinez Gotor <andres.mgotor@gmail.com>
This commit is contained in:
Grot (@grafanabot)
2022-04-25 12:59:43 +02:00
committed by GitHub
co-authored by Andres Martinez Gotor
parent a3cbc6a272
commit 525fa7e9e5
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: {