AzureMonitor: Fix bug detecting app insights queries (#88572)

Make regexp case insensitive
This commit is contained in:
Andreas Christou
2024-06-04 16:16:31 +01:00
committed by GitHub
parent 0af2931672
commit f787418e4b
2 changed files with 80 additions and 2 deletions
@@ -226,7 +226,7 @@ func buildLogAnalyticsQuery(query backend.DataQuery, dsInfo types.DatasourceInfo
func (e *AzureLogAnalyticsDatasource) buildQueries(ctx context.Context, queries []backend.DataQuery, dsInfo types.DatasourceInfo, fromAlert bool) ([]*AzureLogAnalyticsQuery, error) {
azureLogAnalyticsQueries := []*AzureLogAnalyticsQuery{}
appInsightsRegExp, err := regexp.Compile("providers/Microsoft.Insights/components")
appInsightsRegExp, err := regexp.Compile("(?i)providers/microsoft.insights/components")
if err != nil {
return nil, fmt.Errorf("failed to compile Application Insights regex")
}