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rC,kCAAmC,GACnC,qCAAsC,GACtC,4CAA6C,GAC7C,oCAAqC,GACrC,qCAAsC,EACxC,EAEaC,GAAgB,CAC3B,+BACA,kCACA,qCACA,kCACA,8BACA,oCACA,iDACA,+BACA,0CACA,8BACA,iCACA,mCACA,4DACA,gCACA,+BACA,0BACA,mCACA,4CACA,+CACA,6CACA,oCACA,gDACA,gDACA,wBACA,kCACA,kDACA,yBACA,uCACA,mDACA,2CACA,2CACA,wDACA,wDACA,yDACA,yDACA,kCACA,4BACA,8BACA,4CACA,uCACA,gDACA,kCACA,wCACA,0BACA,oCACA,4CACA,4DACA,sCACA,kDACA,wCACA,8CACA,8CACA,iDACA,yCACA,6CACA,kCACA,8CACA,8BACA,2CACA,yCACA,sCACA,kCACA,uCACA,mCACA,wCACA,+BACA,iCACA,uCACA,+BACA,4CACA,2CACA,oCACA,sCACA,4BACA,yCACA,+CACA,yCACA,wCACA,qCACA,gCACA,8CACA,8BACA,yCACA,sCACA,iCACA,wCACA,oCACA,mCACA,6BACA,8BACA,gCACA,yCACA,+BACA,oCACA,oDACA,mDACA,oDACA,qCACA,uDACA,2CACA,kDACA,uCACA,gCACA,+BACA,4BACA,iCACA,4BACA,yCACA,+CACA,2BACA,iDACA,4BACA,+CACA,+DACA,2EACA,kDACA,oDACA,gDACA,0BACA,gCACA,2CACA,mDACA,iCACA,iDACA,gDACA,kDACA,uEACA,6BACA,gDACA,wDACA,wCACA,mCACA,iCACA,gCACA,0CACA,iCACA,6BACA,yCACA,kDACA,yCACA,sCACA,+BACA,kCACA,gCACA,sCACA,8CACA,6CACA,oCACA,uDACA,mCACA,oCACA,qCACA,wCACA,sCACA,qCACA,2CACA,gCACA,2CACA,oCACA,mCACA,gCACA,4CACA,2CACA,kCACA,2CACA,mDACA,yDACA,2CACA,2CACA,oCACA,kCACA,gCACA,8BACA,6BACA,oCACA,2BACA,wCACA,6BACA,oCACA,6BACA,oCACA,kCACA,wCACA,0DACA,kCACA,2CACA,iDACA,mCACA,4CACA,qCACA,8CACA,iCACA,iCACA,kCACA,qCACA,kCACA,oCACA,iDACA,iDACA,8DACA,kDACA,iDACA,kDACA,iCACA,wCACA,gCACA,uCACA,4CACA,sCACA,0CACA,+BACA,4CACA,0CACA,0CACA,wCACA,4CACA,yDACA,8CACA,iDACA,8BACA,oCACA,mDACA,gDACA,4BACA,sBACA,4BACA,4BACA,mCACA,4BACA,+CACA,+CACA,8CACF,EC5nBaC,GAAoB,CAC/B,+BACA,kCACA,2BACA,qCACA,qCACA,kCACA,iDACA,+BACA,6CACA,0CACA,mDACA,oDACA,qDACA,8BACA,4DACA,gCACA,+BACA,yCACA,oCACA,mCACA,wBACA,kCACA,kDACA,yBACA,mCACA,uCACA,2CACA,iDACA,2CACA,uCACA,gDACA,0BACA,oCACA,4CACA,sCACA,8CACA,8CACA,yCACA,6CACA,kCACA,8CACA,2CACA,8BACA,2CACA,kCACA,yCACA,sCACA,kCACA,uCACA,mCACA,+BACA,iCACA,uCACA,+BACA,4CACA,2CACA,oCACA,sCACA,oDACA,4CACA,+CACA,6CACA,+CACA,4BACA,yCACA,+CACA,yCACA,wCACA,8BACA,wCACA,oCACA,mCACA,6BACA,8BACA,gCACA,iDACA,yCACA,+BACA,oCACA,oDACA,mDACA,uCACA,gCACA,yBACA,+BACA,iCACA,4BACA,yCACA,2BACA,sCACA,sCACA,iDACA,4BACA,+CACA,gCACA,2CACA,mDACA,iCACA,gDACA,wDACA,wCACA,mCACA,iCACA,gCACA,6BACA,yCACA,yCACA,sCACA,+BACA,kCACA,gCACA,sCACA,0CACA,8CACA,6CACA,oCACA,uDACA,mCACA,qCACA,wCACA,sCACA,2CACA,2CACA,oCACA,gCACA,mDACA,wCACA,yDACA,6CACA,2CACA,2CACA,oCACA,4BACA,uCACA,wCACA,6BACA,oCACA,6BACA,oCACA,mDACA,kCACA,yCACA,sCACA,kCACA,mCACA,qCACA,iCACA,iCACA,2CACA,kCACA,qCACA,oCACA,iDACA,iDACA,kDACA,kDACA,gCACA,4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gtB,EAAMhtB,EAAe,WAAW,EAAE,iBACxD,mBAAoBgtB,EAAMhtB,EAAe,WAAW,EAAE,MAGtD,0BAA2BgtB,EAAMhtB,EAAe,kBAAkB,EAAE,MACpE,4BAA6BgtB,EAAMhtB,EAAe,mBAAmB,EAAE,MACvE,uBAAwBgtB,EAAMhtB,EAAe,eAAe,EAAE,MAC9D,2BAA4BgtB,EAAMhtB,EAAe,kBAAkB,EAAE,MACrE,yBAA0BgtB,EAAMhtB,EAAe,gBAAgB,EAAE,MACjE,uBAAwBgtB,EAAMhtB,EAAe,eAAe,EAAE,MAC9D,sCAAuCgtB,EAAMhtB,EAAe,yBAAyB,EAAE,MACvF,sBAAuBgtB,EAAMhtB,EAAe,cAAc,EAAE,MAG5D,oBAAqBgtB,EAAM,QAAQ,KACrC,CAAC,CAEL,CACF,C","sources":["webpack://grafana/./node_modules/@grafana/experimental/dist/esm/QueryEditor/EditorHeader.js","webpack://grafana/./node_modules/@grafana/experimental/dist/esm/QueryEditor/InlineSelect.js","webpack://grafana/./public/app/plugins/datasource/azuremonitor/time_grain_converter.ts","webpack://grafana/./public/app/plugins/datasource/azuremonitor/azure_monitor/response_parser.ts","webpack://grafana/./public/app/plugins/datasource/azuremonitor/utils/common.ts","webpack://grafana/./public/app/plugins/datasource/azuremonitor/dataquery.gen.ts","webpack://grafana/./public/app/plugins/datasource/azuremonitor/types/types.ts","webpack://grafana/./public/app/plugins/datasource/azuremonitor/credentials.ts","webpack://grafana/./public/app/plugins/datasource/azuremonitor/e2e/selectors.ts","webpack://grafana/./public/app/plugins/datasource/azuremonitor/components/AzureCredentialsForm.tsx","webpack://grafana/./public/app/plugins/datasource/azuremonitor/components/DefaultSubscription.tsx","webpack://grafana/./public/app/plugins/datasource/azuremonitor/components/MonitorConfig.tsx","webpack://grafana/./public/app/plugins/datasource/azuremonitor/components/ConfigEditor.tsx","webpack://grafana/./public/app/plugins/datasource/azuremonitor/utils/messageFromError.ts","webpack://grafana/./public/app/plugins/datasource/azuremonitor/utils/useLastError.ts","webpack://grafana/./public/app/plugins/datasource/azuremonitor/components/ArgQueryEditor/QueryField.tsx","webpack://grafana/./public/app/plugins/datasource/azuremonitor/components/Field.tsx","webpack://grafana/./public/app/plugins/datasource/azuremonitor/components/ArgQueryEditor/SubscriptionField.tsx","webpack://grafana/./public/app/plugins/datasource/azuremonitor/components/ArgQueryEditor/ArgQueryEditor.tsx","webpack://grafana/./public/app/plugins/datasource/azuremonitor/components/FormatAsField.tsx","webpack://grafana/./public/app/plugins/datasource/azuremonitor/components/ResourcePicker/AdvancedMulti.tsx","webpack://grafana/./public/app/plugins/datasource/azuremonitor/components/ResourcePicker/types.ts","webpack://grafana/./public/app/plugins/datasource/azuremonitor/components/ResourcePicker/EntryIcon.tsx","webpack://grafana/./public/app/plugins/datasource/azuremonitor/components/ResourcePicker/styles.ts","webpack://grafana/./public/app/plugins/datasource/azuremonitor/components/ResourcePicker/NestedEntry.tsx","webpack://grafana/./public/app/plugins/datasource/azuremonitor/azure_monitor/url_builder.ts","webpack://grafana/./public/app/plugins/datasource/azuremonitor/components/ResourcePicker/utils.ts","webpack://grafana/./public/app/plugins/datasource/azuremonitor/components/ResourcePicker/NestedRow.tsx","webpack://grafana/./public/app/plugins/datasource/azuremonitor/components/ResourcePicker/Search.tsx","webpack://grafana/./public/app/plugins/datasource/azuremonitor/components/ResourcePicker/ResourcePicker.tsx","webpack://grafana/./public/app/plugins/datasource/azuremonitor/components/ResourceField/ResourceField.tsx","webpack://grafana/./public/app/plugins/datasource/azuremonitor/components/LogsQueryEditor/AdvancedResourcePicker.tsx","webpack://grafana/./public/app/plugins/datasource/azuremonitor/components/LogsQueryEditor/setQueryValue.ts","webpack://grafana/./public/app/plugins/datasource/azuremonitor/components/LogsQueryEditor/QueryField.tsx","webpack://grafana/./public/app/plugins/datasource/azuremonitor/components/LogsQueryEditor/TimeManagement.tsx","webpack://grafana/./public/app/plugins/datasource/azuremonitor/components/LogsQueryEditor/useMigrations.ts","webpack://grafana/./public/app/plugins/datasource/azuremonitor/components/LogsQueryEditor/LogsQueryEditor.tsx","webpack://grafana/./public/app/plugins/datasource/azuremonitor/components/RawQuery.tsx","webpack://grafana/./public/app/plugins/datasource/azuremonitor/components/syntax.ts","webpack://grafana/./public/app/plugins/datasource/azuremonitor/components/AzureCheatSheet.tsx","webpack://grafana/./public/app/plugins/datasource/azuremonitor/components/LogsQueryEditor/AzureCheatSheetModal.tsx","webpack://grafana/./public/app/plugins/datasource/azuremonitor/azureMetadata/resourceTypes.ts","webpack://grafana/./public/app/plugins/datasource/azuremonitor/azureMetadata/logsResourceTypes.ts","webpack://grafana/./public/app/plugins/datasource/azuremonitor/components/MetricsQueryEditor/AdvancedResourcePicker.tsx","webpack://grafana/./public/app/plugins/datasource/azuremonitor/components/MetricsQueryEditor/setQueryValue.ts","webpack://grafana/./public/app/plugins/datasource/azuremonitor/components/MetricsQueryEditor/AggregationField.tsx","webpack://grafana/./public/app/plugins/datasource/azuremonitor/components/MetricsQueryEditor/DimensionFields.tsx","webpack://grafana/./public/app/plugins/datasource/azuremonitor/components/MetricsQueryEditor/LegendFormatField.tsx","webpack://grafana/./public/app/plugins/datasource/azuremonitor/components/MetricsQueryEditor/MetricNameField.tsx","webpack://grafana/./public/app/plugins/datasource/azuremonitor/components/MetricsQueryEditor/MetricNamespaceField.tsx","webpack://grafana/./public/app/plugins/datasource/azuremonitor/components/MetricsQueryEditor/TimeGrainField.tsx","webpack://grafana/./public/app/plugins/datasource/azuremonitor/components/MetricsQueryEditor/TopField.tsx","webpack://grafana/./public/app/plugins/datasource/azuremonitor/utils/useAsyncState.ts","webpack://grafana/./public/app/plugins/datasource/azuremonitor/components/MetricsQueryEditor/dataHooks.ts","webpack://grafana/./public/app/plugins/datasource/azuremonitor/components/MetricsQueryEditor/MetricsQueryEditor.tsx","webpack://grafana/./public/app/plugins/datasource/azuremonitor/components/QueryHeader.tsx","webpack://grafana/./public/app/plugins/datasource/azuremonitor/components/TracesQueryEditor/Filter.tsx","webpack://grafana/./public/app/plugins/datasource/azuremonitor/components/TracesQueryEditor/consts.ts","webpack://grafana/./public/app/plugins/datasource/azuremonitor/components/TracesQueryEditor/setQueryValue.ts","webpack://grafana/./public/app/plugins/datasource/azuremonitor/components/TracesQueryEditor/Filters.tsx","webpack://grafana/./public/app/plugins/datasource/azuremonitor/components/TracesQueryEditor/TraceTypeField.tsx","webpack://grafana/./public/app/plugins/datasource/azuremonitor/components/TracesQueryEditor/TracesQueryEditor.tsx","webpack://grafana/./public/app/plugins/datasource/azuremonitor/utils/migrateQuery.ts","webpack://grafana/./public/app/plugins/datasource/azuremonitor/components/QueryEditor/usePreparedQuery.ts","webpack://grafana/./public/app/plugins/datasource/azuremonitor/components/QueryEditor/QueryEditor.tsx","webpack://grafana/./public/app/plugins/datasource/azuremonitor/azure_log_analytics/utils.ts","webpack://grafana/./public/app/plugins/datasource/azuremonitor/azure_log_analytics/azure_log_analytics_datasource.ts","webpack://grafana/./public/app/plugins/datasource/azuremonitor/azure_monitor/azure_monitor_datasource.ts","webpack://grafana/./public/app/plugins/datasource/azuremonitor/azure_resource_graph/azure_resource_graph_datasource.ts","webpack://grafana/./public/app/plugins/datasource/azuremonitor/resourcePicker/resourcePickerData.ts","webpack://grafana/./public/app/plugins/datasource/azuremonitor/utils/migrateAnnotation.ts","webpack://grafana/./public/app/plugins/datasource/azuremonitor/grafanaTemplateVariableFns.ts","webpack://grafana/./public/app/plugins/datasource/azuremonitor/components/VariableEditor/GrafanaTemplateVariableFn.tsx","webpack://grafana/./public/app/plugins/datasource/azuremonitor/components/VariableEditor/VariableEditor.tsx","webpack://grafana/./public/app/plugins/datasource/azuremonitor/variables.ts","webpack://grafana/./public/app/plugins/datasource/azuremonitor/datasource.ts","webpack://grafana/./public/app/plugins/datasource/azuremonitor/tracking.ts","webpack://grafana/./public/app/plugins/datasource/azuremonitor/module.ts"],"sourcesContent":["import { css } from '@emotion/css';\nimport React__default from 'react';\nimport { useStyles2 } from '@grafana/ui';\n\nconst EditorHeader = ({ children }) => {\n const styles = useStyles2(getStyles);\n return /* @__PURE__ */ React__default.createElement(\"div\", { className: styles.root }, children);\n};\nconst getStyles = (theme) => ({\n root: css({\n display: \"flex\",\n flexWrap: \"wrap\",\n alignItems: \"center\",\n gap: theme.spacing(3),\n minHeight: theme.spacing(4)\n })\n});\n\nexport { EditorHeader };\n//# sourceMappingURL=EditorHeader.js.map\n","import { css, cx } from '@emotion/css';\nimport React__default, { useState } from 'react';\nimport { useStyles2, Select, SelectContainer as SelectContainer$1 } from '@grafana/ui';\n\nvar __defProp = Object.defineProperty;\nvar __defProps = Object.defineProperties;\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\nvar __objRest = (source, exclude) => {\n var target = {};\n for (var prop in source)\n if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)\n target[prop] = source[prop];\n if (source != null && __getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(source)) {\n if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))\n target[prop] = source[prop];\n }\n return target;\n};\nfunction InlineSelect(_a) {\n var _b = _a, { label: labelProp } = _b, props = __objRest(_b, [\"label\"]);\n const styles = useStyles2(getSelectStyles);\n const [id] = useState(() => Math.random().toString(16).slice(2));\n const components = {\n SelectContainer,\n ValueContainer,\n SingleValue: ValueContainer\n };\n return /* @__PURE__ */ React__default.createElement(\"div\", { className: styles.root }, labelProp && /* @__PURE__ */ React__default.createElement(\"label\", { className: styles.label, htmlFor: id }, labelProp, \":\", \"\\xA0\"), /* @__PURE__ */ React__default.createElement(Select, __spreadProps(__spreadValues({ openMenuOnFocus: true, inputId: id }, props), { components })));\n}\nconst SelectContainer = (props) => {\n const { children } = props;\n const styles = useStyles2(getSelectStyles);\n return /* @__PURE__ */ React__default.createElement(SelectContainer$1, __spreadProps(__spreadValues({}, props), { className: cx(props.className, styles.container) }), children);\n};\nconst ValueContainer = (props) => {\n const { className, children } = props;\n const styles = useStyles2(getSelectStyles);\n return /* @__PURE__ */ React__default.createElement(\"div\", { className: cx(className, styles.valueContainer) }, children);\n};\nconst getSelectStyles = (theme) => ({\n root: css({\n display: \"flex\",\n fontSize: 12,\n alignItems: \"center\"\n }),\n label: css({\n color: theme.colors.text.secondary,\n whiteSpace: \"nowrap\"\n }),\n container: css({\n background: \"none\",\n borderColor: \"transparent\"\n }),\n valueContainer: css({\n display: \"flex\",\n alignItems: \"center\",\n flex: \"initial\",\n color: theme.colors.text.secondary,\n fontSize: 12\n })\n});\n\nexport { InlineSelect };\n//# sourceMappingURL=InlineSelect.js.map\n","import { includes, filter } from 'lodash';\n\nimport { rangeUtil } from '@grafana/data';\n\nexport default class TimeGrainConverter {\n static createISO8601Duration(timeGrain: string | number, timeGrainUnit: string) {\n const timeIntervals = ['hour', 'minute', 'h', 'm'];\n if (includes(timeIntervals, timeGrainUnit)) {\n return `PT${timeGrain}${timeGrainUnit[0].toUpperCase()}`;\n }\n\n return `P${timeGrain}${timeGrainUnit[0].toUpperCase()}`;\n }\n\n static createISO8601DurationFromInterval(interval: string) {\n const timeGrain = +interval.slice(0, interval.length - 1);\n const unit = interval[interval.length - 1];\n\n if (interval.indexOf('ms') > -1) {\n return TimeGrainConverter.createISO8601Duration(1, 'm');\n }\n\n if (interval[interval.length - 1] === 's') {\n let toMinutes = (timeGrain * 60) % 60;\n\n if (toMinutes < 1) {\n toMinutes = 1;\n }\n\n return TimeGrainConverter.createISO8601Duration(toMinutes, 'm');\n }\n\n return TimeGrainConverter.createISO8601Duration(timeGrain, unit);\n }\n\n static findClosestTimeGrain(interval: string, allowedTimeGrains: string[]) {\n const timeGrains = filter(allowedTimeGrains, (o) => o !== 'auto');\n\n let closest = timeGrains[0];\n const intervalMs = rangeUtil.intervalToMs(interval);\n\n for (let i = 0; i < timeGrains.length; i++) {\n // abs (num - val) < abs (num - curr):\n if (intervalMs > rangeUtil.intervalToMs(timeGrains[i])) {\n if (i + 1 < timeGrains.length) {\n closest = timeGrains[i + 1];\n } else {\n closest = timeGrains[i];\n }\n }\n }\n\n return closest;\n }\n\n static createTimeGrainFromISO8601Duration(duration: string) {\n let offset = 1;\n if (duration.substring(0, 2) === 'PT') {\n offset = 2;\n }\n\n const value = duration.substring(offset, duration.length - 1);\n const unit = duration.substring(duration.length - 1);\n\n return value + ' ' + TimeGrainConverter.timeUnitToText(+value, unit);\n }\n\n static timeUnitToText(value: number, unit: string) {\n let text = '';\n\n if (unit === 'S') {\n text = 'second';\n }\n if (unit === 'M') {\n text = 'minute';\n }\n if (unit === 'H') {\n text = 'hour';\n }\n if (unit === 'D') {\n text = 'day';\n }\n\n if (value > 1) {\n return text + 's';\n }\n\n return text;\n }\n\n static createKbnUnitFromISO8601Duration(duration: string) {\n if (duration === 'auto') {\n return 'auto';\n }\n\n let offset = 1;\n if (duration.substring(0, 2) === 'PT') {\n offset = 2;\n }\n\n const value = duration.substring(offset, duration.length - 1);\n const unit = duration.substring(duration.length - 1);\n\n return value + TimeGrainConverter.timeUnitToKbn(+value, unit);\n }\n\n static timeUnitToKbn(value: number, unit: string) {\n if (unit === 'S') {\n return 's';\n }\n if (unit === 'M') {\n return 'm';\n }\n if (unit === 'H') {\n return 'h';\n }\n if (unit === 'D') {\n return 'd';\n }\n\n return '';\n }\n}\n","import { find, get } from 'lodash';\n\nimport { FetchResponse } from '@grafana/runtime';\n\nimport TimeGrainConverter from '../time_grain_converter';\nimport {\n AzureMonitorLocalizedValue,\n AzureMonitorLocations,\n AzureMonitorMetricAvailabilityMetadata,\n AzureMonitorMetricsMetadataResponse,\n AzureMonitorOption,\n AzureAPIResponse,\n Location,\n Subscription,\n Resource,\n} from '../types';\nexport default class ResponseParser {\n static parseResponseValues<T>(\n result: AzureAPIResponse<T>,\n textFieldName: string,\n valueFieldName: string\n ): Array<{ text: string; value: string }> {\n const list: Array<{ text: string; value: string }> = [];\n\n if (!result) {\n return list;\n }\n\n for (let i = 0; i < result.value.length; i++) {\n if (!find(list, ['value', get(result.value[i], valueFieldName)])) {\n const value = get(result.value[i], valueFieldName);\n const text = get(result.value[i], textFieldName, value);\n\n list.push({\n text: text,\n value: value,\n });\n }\n }\n return list;\n }\n\n static parseResourceNames(\n result: AzureAPIResponse<Resource>,\n metricNamespace?: string\n ): Array<{ text: string; value: string }> {\n const list: Array<{ text: string; value: string }> = [];\n\n if (!result) {\n return list;\n }\n\n for (let i = 0; i < result.value.length; i++) {\n if (\n typeof result.value[i].type === 'string' &&\n (!metricNamespace || result.value[i].type.toLocaleLowerCase() === metricNamespace.toLocaleLowerCase())\n ) {\n list.push({\n text: result.value[i].name,\n value: result.value[i].name,\n });\n }\n }\n\n return list;\n }\n\n static parseMetadata(result: AzureMonitorMetricsMetadataResponse, metricName: string) {\n const defaultAggTypes = ['None', 'Average', 'Minimum', 'Maximum', 'Total', 'Count'];\n const metricData = result?.value.find((v) => v.name.value === metricName);\n\n if (!metricData) {\n return {\n primaryAggType: '',\n supportedAggTypes: defaultAggTypes,\n supportedTimeGrains: [],\n dimensions: [],\n };\n }\n\n return {\n primaryAggType: metricData.primaryAggregationType,\n supportedAggTypes: metricData.supportedAggregationTypes || defaultAggTypes,\n\n supportedTimeGrains: [\n { label: 'Auto', value: 'auto' },\n ...ResponseParser.parseTimeGrains(metricData.metricAvailabilities ?? []),\n ],\n dimensions: ResponseParser.parseDimensions(metricData.dimensions ?? []),\n };\n }\n\n static parseTimeGrains(metricAvailabilities: AzureMonitorMetricAvailabilityMetadata[]): AzureMonitorOption[] {\n const timeGrains: AzureMonitorOption[] = [];\n\n if (!metricAvailabilities) {\n return timeGrains;\n }\n\n metricAvailabilities.forEach((avail) => {\n if (avail.timeGrain) {\n timeGrains.push({\n label: TimeGrainConverter.createTimeGrainFromISO8601Duration(avail.timeGrain),\n value: avail.timeGrain,\n });\n }\n });\n\n return timeGrains;\n }\n\n static parseDimensions(metadataDimensions: AzureMonitorLocalizedValue[]) {\n return metadataDimensions.map((dimension) => {\n return {\n label: dimension.localizedValue || dimension.value,\n value: dimension.value,\n };\n });\n }\n\n static parseSubscriptions(result: AzureAPIResponse<Subscription>): Array<{ text: string; value: string }> {\n const list: Array<{ text: string; value: string }> = [];\n\n if (!result) {\n return list;\n }\n\n const valueFieldName = 'subscriptionId';\n const textFieldName = 'displayName';\n for (let i = 0; i < result.value.length; i++) {\n if (!find(list, ['value', get(result.value[i], valueFieldName)])) {\n list.push({\n text: `${get(result.value[i], textFieldName)}`,\n value: get(result.value[i], valueFieldName),\n });\n }\n }\n\n return list;\n }\n\n static parseSubscriptionsForSelect(\n result?: FetchResponse<AzureAPIResponse<Subscription>>\n ): Array<{ label: string; value: string }> {\n const list: Array<{ label: string; value: string }> = [];\n\n if (!result) {\n return list;\n }\n\n const valueFieldName = 'subscriptionId';\n const textFieldName = 'displayName';\n for (let i = 0; i < result.data.value.length; i++) {\n if (!find(list, ['value', get(result.data.value[i], valueFieldName)])) {\n list.push({\n label: `${get(result.data.value[i], textFieldName)} - ${get(result.data.value[i], valueFieldName)}`,\n value: get(result.data.value[i], valueFieldName),\n });\n }\n }\n\n return list;\n }\n\n static parseLocations(result: AzureAPIResponse<Location>) {\n const locations: AzureMonitorLocations[] = [];\n\n if (!result) {\n return locations;\n }\n\n for (const location of result.value) {\n locations.push({ name: location.name, displayName: location.displayName, supportsLogs: undefined });\n }\n\n return locations;\n }\n}\n","import { map } from 'lodash';\n\nimport { SelectableValue, VariableWithMultiSupport } from '@grafana/data';\n\nimport { AzureMonitorOption, VariableOptionGroup } from '../types';\n\nexport const hasOption = (options: AzureMonitorOption[], value: string): boolean =>\n options.some((v) => (v.options ? hasOption(v.options, value) : v.value === value));\n\nexport const findOptions = (options: AzureMonitorOption[], values: string[] = []) => {\n if (values.length === 0) {\n return [];\n }\n const set = values.reduce((accum, item) => {\n accum.add(item);\n return accum;\n }, new Set());\n return options.filter((option) => set.has(option.value));\n};\n\nexport const toOption = (v: { text: string; value: string }) => ({ value: v.value, label: v.text });\n\nexport const addValueToOptions = (\n values: Array<AzureMonitorOption | SelectableValue>,\n variableOptionGroup: VariableOptionGroup,\n value?: string\n) => {\n const options = [...values, variableOptionGroup];\n\n const optionValues = values.map((m) => m.value.toLowerCase()).concat(variableOptionGroup.options.map((p) => p.value));\n if (value && !optionValues.includes(value.toLowerCase())) {\n options.push({ label: value, value });\n }\n\n return options;\n};\n\n// Route definitions shared with the backend.\n// Check: /pkg/tsdb/azuremonitor/azuremonitor-resource-handler.go <registerRoutes>\nexport const routeNames = {\n azureMonitor: 'azuremonitor',\n logAnalytics: 'loganalytics',\n appInsights: 'appinsights',\n resourceGraph: 'resourcegraph',\n};\n\nexport function interpolateVariable(\n value: string | number | Array<string | number>,\n variable: VariableWithMultiSupport\n) {\n if (typeof value === 'string') {\n // When enabling multiple responses, quote the value to mimic the array result below\n // even if only one response is selected. This does not apply if only the \"include all\"\n // option is enabled but with a custom value.\n if (variable.multi || (variable.includeAll && !variable.allValue)) {\n return \"'\" + value + \"'\";\n } else {\n return value;\n }\n }\n\n if (typeof value === 'number') {\n return value;\n }\n\n const quotedValues = map(value, (val) => {\n if (typeof value === 'number') {\n return value;\n }\n\n return \"'\" + val + \"'\";\n });\n return quotedValues.join(',');\n}\n","// Code generated - EDITING IS FUTILE. DO NOT EDIT.\n//\n// Generated by:\n// public/app/plugins/gen.go\n// Using jennies:\n// TSTypesJenny\n// PluginTSTypesJenny\n//\n// Run 'make gen-cue' from repository root to regenerate.\n\nimport * as common from '@grafana/schema';\n\nexport interface AzureMonitorQuery extends common.DataQuery {\n /**\n * Azure Monitor Logs sub-query properties.\n */\n azureLogAnalytics?: AzureLogsQuery;\n /**\n * Azure Monitor Metrics sub-query properties.\n */\n azureMonitor?: AzureMetricQuery;\n /**\n * Azure Resource Graph sub-query properties.\n */\n azureResourceGraph?: AzureResourceGraphQuery;\n /**\n * Application Insights Traces sub-query properties.\n */\n azureTraces?: AzureTracesQuery;\n /**\n * @deprecated Legacy template variable support.\n */\n grafanaTemplateVariableFn?: GrafanaTemplateVariableQuery;\n namespace?: string;\n /**\n * Azure Monitor query type.\n * queryType: #AzureQueryType\n */\n region?: string;\n resource?: string;\n /**\n * Template variables params. These exist for backwards compatiblity with legacy template variables.\n */\n resourceGroup?: string;\n /**\n * Azure subscription containing the resource(s) to be queried.\n */\n subscription?: string;\n /**\n * Subscriptions to be queried via Azure Resource Graph.\n */\n subscriptions?: Array<string>;\n}\n\nexport const defaultAzureMonitorQuery: Partial<AzureMonitorQuery> = {\n subscriptions: [],\n};\n\n/**\n * Defines the supported queryTypes. GrafanaTemplateVariableFn is deprecated\n */\nexport enum AzureQueryType {\n AzureMonitor = 'Azure Monitor',\n AzureResourceGraph = 'Azure Resource Graph',\n AzureTraces = 'Azure Traces',\n GrafanaTemplateVariableFn = 'Grafana Template Variable Function',\n LocationsQuery = 'Azure Regions',\n LogAnalytics = 'Azure Log Analytics',\n MetricNamesQuery = 'Azure Metric Names',\n NamespacesQuery = 'Azure Namespaces',\n ResourceGroupsQuery = 'Azure Resource Groups',\n ResourceNamesQuery = 'Azure Resource Names',\n SubscriptionsQuery = 'Azure Subscriptions',\n WorkspacesQuery = 'Azure Workspaces',\n}\n\nexport interface AzureMetricQuery {\n /**\n * The aggregation to be used within the query. Defaults to the primaryAggregationType defined by the metric.\n */\n aggregation?: string;\n /**\n * Aliases can be set to modify the legend labels. e.g. {{ resourceGroup }}. See docs for more detail.\n */\n alias?: string;\n /**\n * Time grains that are supported by the metric.\n */\n allowedTimeGrainsMs?: Array<number>;\n /**\n * Used as the value for the metricNamespace property when it's different from the resource namespace.\n */\n customNamespace?: string;\n /**\n * @deprecated This property was migrated to dimensionFilters and should only be accessed in the migration\n */\n dimension?: string;\n /**\n * @deprecated This property was migrated to dimensionFilters and should only be accessed in the migration\n */\n dimensionFilter?: string;\n /**\n * Filters to reduce the set of data returned. Dimensions that can be filtered on are defined by the metric.\n */\n dimensionFilters?: Array<AzureMetricDimension>;\n /**\n * @deprecated Use metricNamespace instead\n */\n metricDefinition?: string;\n /**\n * The metric to query data for within the specified metricNamespace. e.g. UsedCapacity\n */\n metricName?: string;\n /**\n * metricNamespace is used as the resource type (or resource namespace).\n * It's usually equal to the target metric namespace. e.g. microsoft.storage/storageaccounts\n * Kept the name of the variable as metricNamespace to avoid backward incompatibility issues.\n */\n metricNamespace?: string;\n /**\n * The Azure region containing the resource(s).\n */\n region?: string;\n /**\n * @deprecated Use resources instead\n */\n resourceGroup?: string;\n /**\n * @deprecated Use resources instead\n */\n resourceName?: string;\n /**\n * @deprecated Use resourceGroup, resourceName and metricNamespace instead\n */\n resourceUri?: string;\n /**\n * Array of resource URIs to be queried.\n */\n resources?: Array<AzureMonitorResource>;\n /**\n * The granularity of data points to be queried. Defaults to auto.\n */\n timeGrain?: string;\n /**\n * @deprecated\n */\n timeGrainUnit?: string;\n /**\n * Maximum number of records to return. Defaults to 10.\n */\n top?: string;\n}\n\nexport const defaultAzureMetricQuery: Partial<AzureMetricQuery> = {\n allowedTimeGrainsMs: [],\n dimensionFilters: [],\n resources: [],\n};\n\n/**\n * Azure Monitor Logs sub-query properties\n */\nexport interface AzureLogsQuery {\n /**\n * If set to true the dashboard time range will be used as a filter for the query. Otherwise the query time ranges will be used. Defaults to false.\n */\n dashboardTime?: boolean;\n /**\n * @deprecated Use dashboardTime instead\n */\n intersectTime?: boolean;\n /**\n * KQL query to be executed.\n */\n query?: string;\n /**\n * @deprecated Use resources instead\n */\n resource?: string;\n /**\n * Array of resource URIs to be queried.\n */\n resources?: Array<string>;\n /**\n * Specifies the format results should be returned as.\n */\n resultFormat?: ResultFormat;\n /**\n * If dashboardTime is set to true this value dictates which column the time filter will be applied to. Defaults to the first tables timeSpan column, the first datetime column found, or TimeGenerated\n */\n timeColumn?: string;\n /**\n * Workspace ID. This was removed in Grafana 8, but remains for backwards compat.\n */\n workspace?: string;\n}\n\nexport const defaultAzureLogsQuery: Partial<AzureLogsQuery> = {\n resources: [],\n};\n\n/**\n * Application Insights Traces sub-query properties\n */\nexport interface AzureTracesQuery {\n /**\n * Filters for property values.\n */\n filters?: Array<AzureTracesFilter>;\n /**\n * Operation ID. Used only for Traces queries.\n */\n operationId?: string;\n /**\n * KQL query to be executed.\n */\n query?: string;\n /**\n * Array of resource URIs to be queried.\n */\n resources?: Array<string>;\n /**\n * Specifies the format results should be returned as.\n */\n resultFormat?: ResultFormat;\n /**\n * Types of events to filter by.\n */\n traceTypes?: Array<string>;\n}\n\nexport const defaultAzureTracesQuery: Partial<AzureTracesQuery> = {\n filters: [],\n resources: [],\n traceTypes: [],\n};\n\nexport interface AzureTracesFilter {\n /**\n * Values to filter by.\n */\n filters: Array<string>;\n /**\n * Comparison operator to use. Either equals or not equals.\n */\n operation: string;\n /**\n * Property name, auto-populated based on available traces.\n */\n property: string;\n}\n\nexport const defaultAzureTracesFilter: Partial<AzureTracesFilter> = {\n filters: [],\n};\n\nexport enum ResultFormat {\n Logs = 'logs',\n Table = 'table',\n TimeSeries = 'time_series',\n Trace = 'trace',\n}\n\nexport interface AzureResourceGraphQuery {\n /**\n * Azure Resource Graph KQL query to be executed.\n */\n query?: string;\n /**\n * Specifies the format results should be returned as. Defaults to table.\n */\n resultFormat?: string;\n}\n\nexport interface AzureMonitorResource {\n metricNamespace?: string;\n region?: string;\n resourceGroup?: string;\n resourceName?: string;\n subscription?: string;\n}\n\nexport interface AzureMetricDimension {\n /**\n * Name of Dimension to be filtered on.\n */\n dimension?: string;\n /**\n * @deprecated filter is deprecated in favour of filters to support multiselect.\n */\n filter?: string;\n /**\n * Values to match with the filter.\n */\n filters?: Array<string>;\n /**\n * String denoting the filter operation. Supports 'eq' - equals,'ne' - not equals, 'sw' - starts with. Note that some dimensions may not support all operators.\n */\n operator?: string;\n}\n\nexport const defaultAzureMetricDimension: Partial<AzureMetricDimension> = {\n filters: [],\n};\n\nexport type GrafanaTemplateVariableQueryType = ('AppInsightsMetricNameQuery' | 'AppInsightsGroupByQuery' | 'SubscriptionsQuery' | 'ResourceGroupsQuery' | 'ResourceNamesQuery' | 'MetricNamespaceQuery' | 'MetricNamesQuery' | 'WorkspacesQuery' | 'UnknownQuery');\n\nexport interface BaseGrafanaTemplateVariableQuery {\n rawQuery?: string;\n}\n\nexport interface UnknownQuery extends BaseGrafanaTemplateVariableQuery {\n kind: 'UnknownQuery';\n}\n\nexport interface AppInsightsMetricNameQuery extends BaseGrafanaTemplateVariableQuery {\n kind: 'AppInsightsMetricNameQuery';\n}\n\nexport interface AppInsightsGroupByQuery extends BaseGrafanaTemplateVariableQuery {\n kind: 'AppInsightsGroupByQuery';\n metricName: string;\n}\n\nexport interface SubscriptionsQuery extends BaseGrafanaTemplateVariableQuery {\n kind: 'SubscriptionsQuery';\n}\n\nexport interface ResourceGroupsQuery extends BaseGrafanaTemplateVariableQuery {\n kind: 'ResourceGroupsQuery';\n subscription: string;\n}\n\nexport interface ResourceNamesQuery extends BaseGrafanaTemplateVariableQuery {\n kind: 'ResourceNamesQuery';\n metricNamespace: string;\n resourceGroup: string;\n subscription: string;\n}\n\nexport interface MetricNamespaceQuery extends BaseGrafanaTemplateVariableQuery {\n kind: 'MetricNamespaceQuery';\n metricNamespace?: string;\n resourceGroup: string;\n resourceName?: string;\n subscription: string;\n}\n\n/**\n * @deprecated Use MetricNamespaceQuery instead\n */\nexport interface MetricDefinitionsQuery extends BaseGrafanaTemplateVariableQuery {\n kind: 'MetricDefinitionsQuery';\n metricNamespace?: string;\n resourceGroup: string;\n resourceName?: string;\n subscription: string;\n}\n\nexport interface MetricNamesQuery extends BaseGrafanaTemplateVariableQuery {\n kind: 'MetricNamesQuery';\n metricNamespace: string;\n resourceGroup: string;\n resourceName: string;\n subscription: string;\n}\n\nexport interface WorkspacesQuery extends BaseGrafanaTemplateVariableQuery {\n kind: 'WorkspacesQuery';\n subscription: string;\n}\n\nexport type GrafanaTemplateVariableQuery = (AppInsightsMetricNameQuery | AppInsightsGroupByQuery | SubscriptionsQuery | ResourceGroupsQuery | ResourceNamesQuery | MetricNamespaceQuery | MetricDefinitionsQuery | MetricNamesQuery | WorkspacesQuery | UnknownQuery);\n\nexport interface AzureMonitor {}\n","import { ScalarParameter, TabularParameter, Function } from '@kusto/monaco-kusto';\n\nimport {\n DataSourceInstanceSettings,\n DataSourceJsonData,\n DataSourceSettings,\n PanelData,\n SelectableValue,\n TimeRange,\n} from '@grafana/data';\n\nimport Datasource from '../datasource';\n\nimport { AzureLogAnalyticsMetadataTable } from './logAnalyticsMetadata';\nimport { AzureMonitorQuery, ResultFormat } from './query';\n\nexport type AzureDataSourceSettings = DataSourceSettings<AzureDataSourceJsonData, AzureDataSourceSecureJsonData>;\nexport type AzureDataSourceInstanceSettings = DataSourceInstanceSettings<AzureDataSourceJsonData>;\n\nexport interface DatasourceValidationResult {\n status: 'success' | 'error';\n message: string;\n title?: string;\n}\n\n/**\n * Azure clouds known to Azure Monitor.\n */\nexport enum AzureCloud {\n Public = 'AzureCloud',\n China = 'AzureChinaCloud',\n USGovernment = 'AzureUSGovernment',\n None = '',\n}\n\nexport type AzureAuthType = 'msi' | 'clientsecret' | 'workloadidentity';\n\nexport type ConcealedSecret = symbol;\n\ninterface AzureCredentialsBase {\n authType: AzureAuthType;\n}\n\nexport interface AzureManagedIdentityCredentials extends AzureCredentialsBase {\n authType: 'msi';\n}\n\nexport interface AzureWorkloadIdentityCredentials extends AzureCredentialsBase {\n authType: 'workloadidentity';\n}\n\nexport interface AzureClientSecretCredentials extends AzureCredentialsBase {\n authType: 'clientsecret';\n azureCloud?: string;\n tenantId?: string;\n clientId?: string;\n clientSecret?: string | ConcealedSecret;\n}\n\nexport type AzureCredentials =\n | AzureManagedIdentityCredentials\n | AzureClientSecretCredentials\n | AzureWorkloadIdentityCredentials;\n\nexport interface AzureDataSourceJsonData extends DataSourceJsonData {\n cloudName: string;\n azureAuthType?: AzureAuthType;\n\n // monitor\n tenantId?: string;\n clientId?: string;\n subscriptionId?: string;\n\n // logs\n /** @deprecated Azure Logs credentials */\n azureLogAnalyticsSameAs?: boolean;\n /** @deprecated Azure Logs credentials */\n logAnalyticsTenantId?: string;\n /** @deprecated Azure Logs credentials */\n logAnalyticsClientId?: string;\n /** @deprecated Azure Logs credentials */\n logAnalyticsSubscriptionId?: string;\n /** @deprecated Azure Logs credentials */\n logAnalyticsDefaultWorkspace?: string;\n\n // App Insights\n appInsightsAppId?: string;\n\n enableSecureSocksProxy?: boolean;\n}\n\nexport interface AzureDataSourceSecureJsonData {\n clientSecret?: string;\n appInsightsApiKey?: string;\n}\n\n// Represents an errors that come back from frontend requests.\n// Not totally sure how accurate this type is.\nexport type AzureMonitorErrorish = Error | string | React.ReactElement;\n\n// Azure Monitor API Types\nexport interface AzureMonitorMetricsMetadataResponse {\n value: AzureMonitorMetricMetadataItem[];\n}\n\nexport interface AzureMonitorMetricMetadataItem {\n id: string;\n resourceId: string;\n primaryAggregationType: string;\n supportedAggregationTypes: string[];\n name: AzureMonitorLocalizedValue;\n dimensions?: AzureMonitorLocalizedValue[];\n metricAvailabilities?: AzureMonitorMetricAvailabilityMetadata[];\n}\n\nexport interface AzureMonitorMetricAvailabilityMetadata {\n timeGrain: string;\n retention: string;\n}\n\nexport interface AzureMonitorLocalizedValue {\n value: string;\n localizedValue: string;\n}\n\nexport interface AzureLogsVariable {\n text: string;\n value: string;\n}\n\nexport interface AzureMonitorOption<T = string> {\n label: string;\n value: T;\n options?: AzureMonitorOption[];\n}\n\nexport type VariableOptionGroup = { label: string; options: AzureMonitorOption[] };\n\nexport interface AzureQueryEditorFieldProps {\n data?: PanelData;\n query: AzureMonitorQuery;\n datasource: Datasource;\n subscriptionId?: string;\n variableOptionGroup: VariableOptionGroup;\n schema?: EngineSchema;\n range?: TimeRange;\n\n onQueryChange: (newQuery: AzureMonitorQuery) => void;\n setError: (source: string, error: AzureMonitorErrorish | undefined) => void;\n}\n\n// To avoid a type issue we redeclare the EngineSchema type from @kusto/monaco-kusto\nexport interface EngineSchema {\n clusterType: 'Engine';\n cluster: {\n connectionString: string;\n databases: Database[];\n };\n database: Database | undefined;\n globalScalarParameters?: ScalarParameter[];\n globalTabularParameters?: TabularParameter[];\n}\n\nexport interface Database {\n name: string;\n tables: AzureLogAnalyticsMetadataTable[];\n functions: Function[];\n majorVersion: number;\n minorVersion: number;\n}\n\nexport interface FormatAsFieldProps extends AzureQueryEditorFieldProps {\n inputId: string;\n options: Array<SelectableValue<ResultFormat>>;\n defaultValue: ResultFormat;\n setFormatAs: (query: AzureMonitorQuery, formatAs: ResultFormat) => AzureMonitorQuery;\n resultFormat?: ResultFormat;\n}\n\nexport interface AzureResourceSummaryItem {\n subscriptionName: string;\n resourceGroupName: string | undefined;\n resourceName: string | undefined;\n}\n\nexport interface RawAzureSubscriptionItem {\n subscriptionName: string;\n subscriptionId: string;\n}\n\nexport interface RawAzureResourceGroupItem {\n resourceGroupURI: string;\n resourceGroupName: string;\n}\n\nexport interface RawAzureResourceItem {\n id: string;\n name: string;\n subscriptionId: string;\n resourceGroup: string;\n type: string;\n location: string;\n}\n\nexport interface AzureGraphResponse<T = unknown> {\n data: T;\n // skipToken is used for pagination, to get the next page\n $skipToken?: string;\n}\n\n// https://docs.microsoft.com/en-us/rest/api/azureresourcegraph/resourcegraph(2021-03-01)/resources/resources#queryrequestoptions\nexport interface AzureResourceGraphOptions {\n $skip: number;\n $skipToken: string;\n $top: number;\n allowPartialScopes: boolean;\n resultFormat: 'objectArray' | 'table';\n}\n\n// Azure Monitor Metrics query API data fetcher argument types.\n// The types prefixed by Legacy are applicable to pre-version 9 of Grafana\n// that do not have a resourceUri, instead the resourceUri is built up from\n// the subscription, resource group, metric definition (a.k.a. resource type)\n// and the resource name.\nexport type GetMetricNamespacesQuery = AzureGetMetricNamespacesQuery | LegacyAzureGetMetricNamespacesQuery;\nexport type GetMetricNamesQuery = AzureGetMetricNamesQuery | LegacyAzureGetMetricNamesQuery;\nexport type GetMetricMetadataQuery = AzureGetMetricMetadataQuery | LegacyAzureGetMetricMetadataQuery;\n\nexport interface AzureGetMetricNamespacesQuery {\n resourceUri: string;\n}\nexport interface LegacyAzureGetMetricNamespacesQuery {\n subscription: string;\n resourceGroup: string;\n metricNamespace?: string;\n resourceName?: string;\n}\n\nexport interface AzureGetMetricNamesQuery {\n resourceUri: string;\n metricNamespace?: string;\n customNamespace?: string;\n}\n\nexport interface LegacyAzureGetMetricNamesQuery {\n subscription: string;\n resourceGroup: string;\n resourceName: string;\n metricNamespace: string;\n customNamespace?: string;\n}\n\nexport interface AzureGetMetricMetadataQuery {\n resourceUri: string;\n metricNamespace: string;\n customNamespace?: string;\n metricName: string;\n}\n\nexport interface LegacyAzureGetMetricMetadataQuery {\n subscription: string;\n resourceGroup: string;\n resourceName: string;\n metricNamespace: string;\n customNamespace?: string;\n metricName: string;\n}\n\nexport interface AzureGetResourceNamesQuery {\n subscriptionId: string;\n resourceGroup?: string;\n metricNamespace?: string;\n region?: string;\n}\n\nexport interface AzureMonitorLocations {\n displayName: string;\n name: string;\n supportsLogs?: boolean;\n}\n\nexport interface AzureMonitorProvidersResponse {\n namespace: string;\n resourceTypes: ProviderResourceType[];\n}\n\nexport interface ProviderResourceType {\n resourceType: string;\n locations: string[];\n apiVersions: string[];\n capabilities: string;\n}\n\nexport interface AzureAPIResponse<T> {\n value: T[];\n count?: {\n type: string;\n value: number;\n };\n status?: number;\n statusText?: string;\n}\n\nexport interface Location {\n id: string;\n name: string;\n displayName: string;\n regionalDisplayName: string;\n metadata: LocationMetadata;\n}\n\ninterface LocationMetadata {\n regionType: string;\n regionCategory: string;\n geographyGroup: string;\n longitude: string;\n latitude: string;\n physicalLocation: string;\n pairedRegion: LocationPairedRegion[];\n}\n\ninterface LocationPairedRegion {\n name: string;\n id: string;\n}\n\nexport interface Subscription {\n id: string;\n authorizationSource: string;\n subscriptionId: string;\n tenantId: string;\n displayName: string;\n state: string;\n subscriptionPolicies: {\n locationPlacementId: string;\n quotaId: string;\n spendingLimit: string;\n };\n}\n\nexport interface Workspace {\n properties: {\n customerId: string;\n provisioningState: string;\n sku: {\n name: string;\n };\n retentionInDays: number;\n publicNetworkAccessForQuery: string;\n publicNetworkAccessForIngestion: string;\n };\n id: string;\n name: string;\n type: string;\n location: string;\n tags: Record<string, string>;\n}\n\nexport interface Resource {\n changedTime: string;\n createdTime: string;\n extendedLocation: { name: string; type: string };\n id: string;\n identity: { principalId: string; tenantId: string; type: string; userAssignedIdentities: string[] };\n kind: string;\n location: string;\n managedBy: string;\n name: string;\n plan: { name: string; product: string; promotionCode: string; publisher: string; version: string };\n properties: Record<string, string>;\n provisioningState: string;\n sku: { capacity: number; family: string; model: string; name: string; size: string; tier: string };\n tags: Record<string, string>;\n type: string;\n}\n\nexport interface ResourceGroup {\n id: string;\n location: string;\n managedBy: string;\n name: string;\n properties: { provisioningState: string };\n tags: object;\n type: string;\n}\n\nexport interface Namespace {\n classification: {\n Custom: string;\n Platform: string;\n Qos: string;\n };\n id: string;\n name: string;\n properties: { metricNamespaceName: string };\n type: string;\n}\n\nexport interface Metric {\n displayDescription: string;\n errorCode: string;\n errorMessage: string;\n id: string;\n name: AzureMonitorLocalizedValue;\n timeseries: Array<{ data: MetricValue[]; metadatavalues: MetricMetadataValue[] }>;\n type: string;\n unit: string;\n}\n\ninterface MetricValue {\n average: number;\n count: number;\n maximum: number;\n minimum: number;\n timeStamp: string;\n total: number;\n}\n\ninterface MetricMetadataValue {\n name: AzureMonitorLocalizedValue;\n value: string;\n}\n\nexport type Category = {\n displayName: string;\n id: string;\n related: {\n queries: string[];\n tables: string[];\n };\n};\n\nexport type CheatsheetQuery = {\n body: string;\n description: string;\n displayName: string;\n id: string;\n properties: {\n ExampleQuery: boolean;\n QueryAttributes: {\n isMultiResource: boolean;\n };\n };\n related: {\n categories: string[];\n resourceTypes: string[];\n tables: string[];\n };\n tags: {\n Topic: string[];\n };\n};\n\nexport type CheatsheetQueries = {\n [key: string]: CheatsheetQuery[];\n};\n\nexport type DropdownCategories = {\n [key: string]: boolean;\n};\n","import { config } from '@grafana/runtime';\n\nimport {\n AzureAuthType,\n AzureCloud,\n AzureCredentials,\n AzureDataSourceInstanceSettings,\n AzureDataSourceSettings,\n ConcealedSecret,\n} from './types';\n\nconst concealed: ConcealedSecret = Symbol('Concealed client secret');\n\nexport function getAuthType(options: AzureDataSourceSettings | AzureDataSourceInstanceSettings): AzureAuthType {\n if (!options.jsonData.azureAuthType) {\n // If authentication type isn't explicitly specified and datasource has client credentials,\n // then this is existing datasource which is configured for app registration (client secret)\n if (options.jsonData.tenantId && options.jsonData.clientId) {\n return 'clientsecret';\n }\n\n // For newly created datasource with no configuration, managed identity is the default authentication type\n // if they are enabled in Grafana config\n return config.azure.managedIdentityEnabled ? 'msi' : 'clientsecret';\n }\n\n return options.jsonData.azureAuthType;\n}\n\nfunction getDefaultAzureCloud(): string {\n switch (config.azure.cloud) {\n case AzureCloud.Public:\n case AzureCloud.None:\n case undefined:\n return 'azuremonitor';\n case AzureCloud.China:\n return 'chinaazuremonitor';\n case AzureCloud.USGovernment:\n return 'govazuremonitor';\n default:\n throw new Error(`The cloud '${config.azure.cloud}' not supported.`);\n }\n}\n\nexport function getAzurePortalUrl(azureCloud: string): string {\n switch (azureCloud) {\n case 'azuremonitor':\n return 'https://portal.azure.com';\n case 'chinaazuremonitor':\n return 'https://portal.azure.cn';\n case 'govazuremonitor':\n return 'https://portal.azure.us';\n default:\n throw new Error('The cloud not supported.');\n }\n}\n\nexport function getAzureCloud(options: AzureDataSourceSettings | AzureDataSourceInstanceSettings): string {\n const authType = getAuthType(options);\n switch (authType) {\n case 'msi':\n case 'workloadidentity':\n // In case of managed identity and workload identity, the cloud is always same as where Grafana is hosted\n return getDefaultAzureCloud();\n case 'clientsecret':\n return options.jsonData.cloudName || getDefaultAzureCloud();\n }\n}\n\nfunction getSecret(options: AzureDataSourceSettings): undefined | string | ConcealedSecret {\n if (options.secureJsonFields.clientSecret) {\n // The secret is concealed on server\n return concealed;\n } else {\n const secret = options.secureJsonData?.clientSecret;\n return typeof secret === 'string' && secret.length > 0 ? secret : undefined;\n }\n}\n\nexport function isCredentialsComplete(credentials: AzureCredentials): boolean {\n switch (credentials.authType) {\n case 'msi':\n case 'workloadidentity':\n return true;\n case 'clientsecret':\n return !!(credentials.azureCloud && credentials.tenantId && credentials.clientId && credentials.clientSecret);\n }\n}\n\nexport function getCredentials(options: AzureDataSourceSettings): AzureCredentials {\n const authType = getAuthType(options);\n switch (authType) {\n case 'msi':\n case 'workloadidentity':\n if (\n (authType === 'msi' && config.azure.managedIdentityEnabled) ||\n (authType === 'workloadidentity' && config.azure.workloadIdentityEnabled)\n ) {\n return {\n authType,\n };\n } else {\n // If authentication type is managed identity or workload identity but either method is disabled in Grafana config,\n // then we should fallback to an empty app registration (client secret) configuration\n return {\n authType: 'clientsecret',\n azureCloud: getDefaultAzureCloud(),\n };\n }\n case 'clientsecret':\n return {\n authType: 'clientsecret',\n azureCloud: options.jsonData.cloudName || getDefaultAzureCloud(),\n tenantId: options.jsonData.tenantId,\n clientId: options.jsonData.clientId,\n clientSecret: getSecret(options),\n };\n }\n}\n\nexport function updateCredentials(\n options: AzureDataSourceSettings,\n credentials: AzureCredentials\n): AzureDataSourceSettings {\n switch (credentials.authType) {\n case 'msi':\n case 'workloadidentity':\n if (credentials.authType === 'msi' && !config.azure.managedIdentityEnabled) {\n throw new Error('Managed Identity authentication is not enabled in Grafana config.');\n }\n if (credentials.authType === 'workloadidentity' && !config.azure.workloadIdentityEnabled) {\n throw new Error('Workload Identity authentication is not enabled in Grafana config.');\n }\n\n options = {\n ...options,\n jsonData: {\n ...options.jsonData,\n azureAuthType: credentials.authType,\n },\n };\n\n return options;\n\n case 'clientsecret':\n options = {\n ...options,\n jsonData: {\n ...options.jsonData,\n azureAuthType: 'clientsecret',\n cloudName: credentials.azureCloud || getDefaultAzureCloud(),\n tenantId: credentials.tenantId,\n clientId: credentials.clientId,\n },\n secureJsonData: {\n ...options.secureJsonData,\n clientSecret: typeof credentials.clientSecret === 'string' ? credentials.clientSecret : undefined,\n },\n secureJsonFields: {\n ...options.secureJsonFields,\n clientSecret: typeof credentials.clientSecret === 'symbol',\n },\n };\n\n return options;\n }\n}\n","import { E2ESelectors } from '@grafana/e2e-selectors';\n\nexport const components = {\n configEditor: {\n authType: {\n select: 'data-testid auth-type',\n },\n azureCloud: {\n input: 'data-testid azure-cloud',\n },\n tenantID: {\n input: 'data-testid tenant-id',\n },\n clientID: {\n input: 'data-testid client-id',\n },\n clientSecret: {\n input: 'data-testid client-secret',\n },\n loadSubscriptions: {\n button: 'data-testid load-subscriptions',\n },\n defaultSubscription: {\n input: 'data-testid default-subscription',\n },\n },\n queryEditor: {\n header: {\n select: 'data-testid azure-monitor-experimental-header',\n },\n resourcePicker: {\n select: {\n button: 'data-testid resource-picker-select',\n },\n search: {\n input: 'data-testid resource-picker-search',\n },\n apply: {\n button: 'data-testid resource-picker-apply',\n },\n cancel: {\n button: 'data-testid resource-picker-cancel',\n },\n advanced: {\n collapse: 'data-testid resource-picker-advanced',\n subscription: {\n input: 'data-testid resource-picker-subscription',\n },\n resourceGroup: {\n input: 'data-testid resource-picker-resource-group',\n },\n namespace: {\n input: 'data-testid resource-picker-namespace',\n },\n region: {\n input: 'data-testid resource-picker-region',\n },\n resource: {\n input: 'data-testid resource-picker-resource',\n },\n },\n },\n metricsQueryEditor: {\n container: { input: 'data-testid azure-monitor-metrics-query-editor-with-experimental-ui' },\n metricName: {\n input: 'data-testid metric-name',\n },\n },\n logsQueryEditor: {\n container: { input: 'data-testid azure-monitor-logs-query-editor-with-experimental-ui' },\n formatSelection: {\n input: 'data-testid format-selection',\n },\n },\n argsQueryEditor: {\n container: {\n input: 'data-testid azure-monitor-arg-query-editor',\n },\n subscriptions: {\n input: 'data-testid azure-monitor-args-subscription',\n },\n },\n tracesQueryEditor: {\n container: {\n input: 'data-testid azure-monitor-traces-query-editor-with-experimental-ui',\n },\n traceTypes: {\n select: 'data-testid azure-monitor-traces-query-editor-trace-types',\n },\n },\n },\n variableEditor: {\n queryType: {\n input: 'data-testid query-type',\n },\n subscription: {\n input: 'data-testid subscription',\n },\n resourceGroup: {\n input: 'data-testid resource-group',\n },\n namespace: {\n input: 'data-testid namespace',\n },\n resource: {\n input: 'data-testid resource',\n },\n region: {\n input: 'data-testid region',\n },\n },\n};\n\nexport const selectors: { components: E2ESelectors<typeof components> } = {\n components: components,\n};\n","import React, { ChangeEvent, useMemo } from 'react';\n\nimport { SelectableValue } from '@grafana/data';\nimport { ConfigSection } from '@grafana/experimental';\nimport { Button, Select, Field, Input } from '@grafana/ui';\n\nimport { selectors } from '../e2e/selectors';\nimport { AzureAuthType, AzureCredentials } from '../types';\n\nexport interface Props {\n managedIdentityEnabled: boolean;\n workloadIdentityEnabled: boolean;\n credentials: AzureCredentials;\n azureCloudOptions?: SelectableValue[];\n onCredentialsChange: (updatedCredentials: AzureCredentials) => void;\n disabled?: boolean;\n children?: JSX.Element;\n}\n\nexport const AzureCredentialsForm = (props: Props) => {\n const {\n credentials,\n azureCloudOptions,\n onCredentialsChange,\n disabled,\n managedIdentityEnabled,\n workloadIdentityEnabled,\n } = props;\n\n const authTypeOptions = useMemo(() => {\n let opts: Array<SelectableValue<AzureAuthType>> = [\n {\n value: 'clientsecret',\n label: 'App Registration',\n },\n ];\n\n if (managedIdentityEnabled) {\n opts.push({\n value: 'msi',\n label: 'Managed Identity',\n });\n }\n\n if (workloadIdentityEnabled) {\n opts.push({\n value: 'workloadidentity',\n label: 'Workload Identity',\n });\n }\n\n return opts;\n }, [managedIdentityEnabled, workloadIdentityEnabled]);\n\n const onAuthTypeChange = (selected: SelectableValue<AzureAuthType>) => {\n const defaultAuthType = managedIdentityEnabled\n ? 'msi'\n : workloadIdentityEnabled\n ? 'workloadidentity'\n : 'clientsecret';\n const updated: AzureCredentials = {\n ...credentials,\n authType: selected.value || defaultAuthType,\n };\n onCredentialsChange(updated);\n };\n\n const onAzureCloudChange = (selected: SelectableValue<string>) => {\n if (credentials.authType === 'clientsecret') {\n const updated: AzureCredentials = {\n ...credentials,\n azureCloud: selected.value,\n };\n onCredentialsChange(updated);\n }\n };\n\n const onTenantIdChange = (event: ChangeEvent<HTMLInputElement>) => {\n if (credentials.authType === 'clientsecret') {\n const updated: AzureCredentials = {\n ...credentials,\n tenantId: event.target.value,\n };\n onCredentialsChange(updated);\n }\n };\n\n const onClientIdChange = (event: ChangeEvent<HTMLInputElement>) => {\n if (credentials.authType === 'clientsecret') {\n const updated: AzureCredentials = {\n ...credentials,\n clientId: event.target.value,\n };\n onCredentialsChange(updated);\n }\n };\n\n const onClientSecretChange = (event: ChangeEvent<HTMLInputElement>) => {\n if (credentials.authType === 'clientsecret') {\n const updated: AzureCredentials = {\n ...credentials,\n clientSecret: event.target.value,\n };\n onCredentialsChange(updated);\n }\n };\n\n const onClientSecretReset = () => {\n if (credentials.authType === 'clientsecret') {\n const updated: AzureCredentials = {\n ...credentials,\n clientSecret: '',\n };\n onCredentialsChange(updated);\n }\n };\n\n return (\n <ConfigSection title=\"Authentication\">\n {authTypeOptions.length > 1 && (\n <Field\n label=\"Authentication\"\n description=\"Choose the type of authentication to Azure services\"\n data-testid={selectors.components.configEditor.authType.select}\n htmlFor=\"authentication-type\"\n >\n <Select\n className=\"width-15\"\n value={authTypeOptions.find((opt) => opt.value === credentials.authType)}\n options={authTypeOptions}\n onChange={onAuthTypeChange}\n disabled={disabled}\n />\n </Field>\n )}\n {credentials.authType === 'clientsecret' && (\n <>\n {azureCloudOptions && (\n <Field\n label=\"Azure Cloud\"\n data-testid={selectors.components.configEditor.azureCloud.input}\n htmlFor=\"azure-cloud-type\"\n disabled={disabled}\n >\n <Select\n inputId=\"azure-cloud-type\"\n aria-label=\"Azure Cloud\"\n className=\"width-15\"\n value={azureCloudOptions.find((opt) => opt.value === credentials.azureCloud)}\n options={azureCloudOptions}\n onChange={onAzureCloudChange}\n />\n </Field>\n )}\n <Field\n label=\"Directory (tenant) ID\"\n required\n data-testid={selectors.components.configEditor.tenantID.input}\n htmlFor=\"tenant-id\"\n invalid={!credentials.tenantId}\n error={'Tenant ID is required'}\n >\n <Input\n aria-label=\"Tenant ID\"\n className=\"width-30\"\n placeholder=\"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\"\n value={credentials.tenantId || ''}\n onChange={onTenantIdChange}\n disabled={disabled}\n />\n </Field>\n <Field\n label=\"Application (client) ID\"\n required\n data-testid={selectors.components.configEditor.clientID.input}\n htmlFor=\"client-id\"\n invalid={!credentials.clientId}\n error={'Client ID is required'}\n >\n <Input\n className=\"width-30\"\n aria-label=\"Client ID\"\n placeholder=\"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\"\n value={credentials.clientId || ''}\n onChange={onClientIdChange}\n disabled={disabled}\n />\n </Field>\n {!disabled &&\n (typeof credentials.clientSecret === 'symbol' ? (\n <Field label=\"Client Secret\" htmlFor=\"client-secret\" required>\n <div className=\"width-30\" style={{ display: 'flex', gap: '4px' }}>\n <Input\n aria-label=\"Client Secret\"\n placeholder=\"configured\"\n disabled={true}\n data-testid={'client-secret'}\n />\n <Button variant=\"secondary\" type=\"button\" onClick={onClientSecretReset} disabled={disabled}>\n Reset\n </Button>\n </div>\n </Field>\n ) : (\n <Field\n label=\"Client Secret\"\n data-testid={selectors.components.configEditor.clientSecret.input}\n required\n htmlFor=\"client-secret\"\n invalid={!credentials.clientSecret}\n error={'Client secret is required'}\n >\n <Input\n className=\"width-30\"\n aria-label=\"Client Secret\"\n placeholder=\"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\"\n value={credentials.clientSecret || ''}\n onChange={onClientSecretChange}\n id=\"client-secret\"\n disabled={disabled}\n />\n </Field>\n ))}\n </>\n )}\n {props.children}\n </ConfigSection>\n );\n};\n\nexport default AzureCredentialsForm;\n","import React, { useEffect, useReducer } from 'react';\n\nimport { SelectableValue } from '@grafana/data';\nimport { Select, Button, Field } from '@grafana/ui';\n\nimport { isCredentialsComplete } from '../credentials';\nimport { selectors } from '../e2e/selectors';\nimport { AzureCredentials, AzureDataSourceJsonData } from '../types';\n\nexport interface Props {\n options: AzureDataSourceJsonData;\n credentials: AzureCredentials;\n getSubscriptions?: () => Promise<SelectableValue[]>;\n subscriptions: Array<SelectableValue<string>>;\n onSubscriptionsChange: (receivedSubscriptions: Array<SelectableValue<string>>) => void;\n onSubscriptionChange: (subscriptionId?: string) => void;\n disabled?: boolean;\n}\n\nexport const DefaultSubscription = (props: Props) => {\n const {\n credentials,\n disabled,\n options,\n subscriptions,\n getSubscriptions,\n onSubscriptionChange,\n onSubscriptionsChange,\n } = props;\n const hasRequiredFields = isCredentialsComplete(credentials);\n const [loadSubscriptionsClicked, onLoadSubscriptions] = useReducer((val) => val + 1, 0);\n\n useEffect(() => {\n if (!getSubscriptions || !hasRequiredFields) {\n updateSubscriptions([]);\n return;\n }\n let canceled = false;\n getSubscriptions().then((result) => {\n if (!canceled) {\n updateSubscriptions(result, loadSubscriptionsClicked);\n }\n });\n return () => {\n canceled = true;\n };\n // This effect is intended to be called only once initially and on Load Subscriptions click\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [loadSubscriptionsClicked]);\n\n const updateSubscriptions = (received: Array<SelectableValue<string>>, autoSelect = false) => {\n onSubscriptionsChange(received);\n if (getSubscriptions) {\n if (autoSelect && !options.subscriptionId && received.length > 0) {\n // Selecting the default subscription if subscriptions received but no default subscription selected\n onChange(received[0]);\n } else if (options.subscriptionId) {\n const found = received.find((opt) => opt.value === options.subscriptionId);\n if (!found) {\n // Unselecting the default subscription if it isn't found among the received subscriptions\n onChange(undefined);\n }\n }\n }\n };\n\n const onChange = (selected: SelectableValue<string> | undefined) => onSubscriptionChange(selected?.value);\n\n return (\n <>\n <Field\n label=\"Default Subscription\"\n data-testid={selectors.components.configEditor.defaultSubscription.input}\n htmlFor=\"default-subscription\"\n >\n <div className=\"width-30\" style={{ display: 'flex', gap: '4px' }}>\n <Select\n inputId=\"default-subscription\"\n aria-label=\"Default Subscription\"\n value={\n options.subscriptionId ? subscriptions.find((opt) => opt.value === options.subscriptionId) : undefined\n }\n options={subscriptions}\n onChange={onChange}\n disabled={disabled}\n />\n <Button\n variant=\"secondary\"\n type=\"button\"\n onClick={onLoadSubscriptions}\n disabled={!hasRequiredFields || disabled}\n data-testid={selectors.components.configEditor.loadSubscriptions.button}\n >\n Load Subscriptions\n </Button>\n </div>\n </Field>\n </>\n );\n};\n","import React, { useMemo, useState } from 'react';\nimport { useEffectOnce } from 'react-use';\n\nimport { SelectableValue } from '@grafana/data';\nimport { config } from '@grafana/runtime';\n\nimport { getCredentials, updateCredentials } from '../credentials';\nimport { AzureDataSourceSettings, AzureCredentials } from '../types';\n\nimport { AzureCredentialsForm } from './AzureCredentialsForm';\nimport { DefaultSubscription } from './DefaultSubscription';\n\nconst azureClouds: SelectableValue[] = [\n { value: 'azuremonitor', label: 'Azure' },\n { value: 'govazuremonitor', label: 'Azure US Government' },\n { value: 'chinaazuremonitor', label: 'Azure China' },\n];\n\nexport interface Props {\n options: AzureDataSourceSettings;\n updateOptions: (optionsFunc: (options: AzureDataSourceSettings) => AzureDataSourceSettings) => void;\n getSubscriptions: () => Promise<Array<SelectableValue<string>>>;\n}\n\nexport const MonitorConfig = (props: Props) => {\n const { updateOptions, getSubscriptions, options } = props;\n const [subscriptions, setSubscriptions] = useState<Array<SelectableValue<string>>>([]);\n const credentials = useMemo(() => getCredentials(props.options), [props.options]);\n\n const onCredentialsChange = (credentials: AzureCredentials, subscriptionId?: string): void => {\n if (!subscriptionId) {\n setSubscriptions([]);\n }\n updateOptions((options) =>\n updateCredentials({ ...options, jsonData: { ...options.jsonData, subscriptionId } }, credentials)\n );\n };\n\n const onSubscriptionsChange = (receivedSubscriptions: Array<SelectableValue<string>>) =>\n setSubscriptions(receivedSubscriptions);\n\n const onSubscriptionChange = (subscriptionId?: string) =>\n updateOptions((options) => ({ ...options, jsonData: { ...options.jsonData, subscriptionId } }));\n\n // The auth type needs to be set on the first load of the data source\n useEffectOnce(() => {\n if (!options.jsonData.authType || !credentials.authType) {\n onCredentialsChange(credentials, options.jsonData.subscriptionId);\n }\n });\n\n return (\n <>\n <AzureCredentialsForm\n managedIdentityEnabled={config.azure.managedIdentityEnabled}\n workloadIdentityEnabled={config.azure.workloadIdentityEnabled}\n credentials={credentials}\n azureCloudOptions={azureClouds}\n onCredentialsChange={onCredentialsChange}\n disabled={props.options.readOnly}\n >\n <DefaultSubscription\n subscriptions={subscriptions}\n credentials={credentials}\n getSubscriptions={getSubscriptions}\n disabled={props.options.readOnly}\n onSubscriptionsChange={onSubscriptionsChange}\n onSubscriptionChange={onSubscriptionChange}\n options={options.jsonData}\n />\n </AzureCredentialsForm>\n </>\n );\n};\n\nexport default MonitorConfig;\n","import React, { PureComponent } from 'react';\n\nimport { DataSourcePluginOptionsEditorProps, SelectableValue, updateDatasourcePluginOption } from '@grafana/data';\nimport { ConfigSection, DataSourceDescription } from '@grafana/experimental';\nimport { getBackendSrv, getTemplateSrv, isFetchError, TemplateSrv, config } from '@grafana/runtime';\nimport { Alert, Divider, SecureSocksProxySettings } from '@grafana/ui';\n\nimport ResponseParser from '../azure_monitor/response_parser';\nimport {\n AzureAPIResponse,\n AzureDataSourceJsonData,\n AzureDataSourceSecureJsonData,\n AzureDataSourceSettings,\n Subscription,\n} from '../types';\nimport { routeNames } from '../utils/common';\n\nimport { MonitorConfig } from './MonitorConfig';\n\nexport type Props = DataSourcePluginOptionsEditorProps<AzureDataSourceJsonData, AzureDataSourceSecureJsonData>;\n\ninterface ErrorMessage {\n title: string;\n description: string;\n details?: string;\n}\n\nexport interface State {\n unsaved: boolean;\n error?: ErrorMessage;\n}\n\nexport class ConfigEditor extends PureComponent<Props, State> {\n templateSrv: TemplateSrv = getTemplateSrv();\n baseURL: string;\n\n constructor(props: Props) {\n super(props);\n\n this.state = {\n unsaved: false,\n };\n this.baseURL = `/api/datasources/${this.props.options.id}/resources/${routeNames.azureMonitor}/subscriptions`;\n }\n\n private updateOptions = (optionsFunc: (options: AzureDataSourceSettings) => AzureDataSourceSettings): void => {\n const updated = optionsFunc(this.props.options);\n this.props.onOptionsChange(updated);\n\n this.setState({ unsaved: true });\n };\n\n private saveOptions = async (): Promise<void> => {\n if (this.state.unsaved) {\n await getBackendSrv()\n .put(`/api/datasources/${this.props.options.id}`, this.props.options)\n .then((result: { datasource: AzureDataSourceSettings }) => {\n updateDatasourcePluginOption(this.props, 'version', result.datasource.version);\n });\n\n this.setState({ unsaved: false });\n }\n };\n\n private getSubscriptions = async (): Promise<Array<SelectableValue<string>>> => {\n await this.saveOptions();\n\n const query = `?api-version=2019-03-01`;\n try {\n const result = await getBackendSrv()\n .fetch<AzureAPIResponse<Subscription>>({\n url: this.baseURL + query,\n method: 'GET',\n })\n .toPromise();\n\n this.setState({ error: undefined });\n return ResponseParser.parseSubscriptionsForSelect(result);\n } catch (err) {\n if (isFetchError(err)) {\n this.setState({\n error: {\n title: 'Error requesting subscriptions',\n description: 'Could not request subscriptions from Azure. Check your credentials and try again.',\n details: err?.data?.message,\n },\n });\n }\n return Promise.resolve([]);\n }\n };\n\n render() {\n const { options, onOptionsChange } = this.props;\n const { error } = this.state;\n\n return (\n <>\n <DataSourceDescription\n dataSourceName=\"Azure Monitor\"\n docsLink=\"https://grafana.com/docs/grafana/latest/datasources/azure-monitor/\"\n hasRequiredFields\n />\n <Divider />\n <MonitorConfig options={options} updateOptions={this.updateOptions} getSubscriptions={this.getSubscriptions} />\n {error && (\n <Alert severity=\"error\" title={error.title}>\n <p>{error.description}</p>\n {error.details && <details style={{ whiteSpace: 'pre-wrap' }}>{error.details}</details>}\n </Alert>\n )}\n {config.secureSocksDSProxyEnabled && (\n <>\n <Divider />\n <ConfigSection\n title=\"Additional settings\"\n description=\"Additional settings are optional settings that can be configured for more control over your data source. This includes Secure Socks Proxy.\"\n isCollapsible={true}\n isInitiallyOpen={options.jsonData.enableSecureSocksProxy !== undefined}\n >\n <SecureSocksProxySettings options={options} onOptionsChange={onOptionsChange} />\n </ConfigSection>\n </>\n )}\n </>\n );\n }\n}\n\nexport default ConfigEditor;\n","import { isValidElement } from 'react';\n\nimport { AzureMonitorErrorish } from '../types';\n\nexport function messageFromElement(error: AzureMonitorErrorish): AzureMonitorErrorish | undefined {\n if (isValidElement(error)) {\n return error;\n } else {\n return messageFromError(error);\n }\n}\n\nexport default function messageFromError(error: any): string | undefined {\n if (!error || typeof error !== 'object') {\n return undefined;\n }\n\n if (typeof error.message === 'string') {\n return error.message;\n }\n\n if (typeof error.data?.error?.message === 'string') {\n return error.data.error.message;\n }\n\n // Copied from the old Angular code - this might be checking for errors in places\n // that the new code just doesnt use.\n // As new error objects are discovered they should be added to the above code, rather\n // than below\n const maybeAMessage =\n error.error?.data?.error?.innererror?.innererror?.message ||\n error.error?.data?.error?.innererror?.message ||\n error.error?.data?.error?.message ||\n error.error?.data?.message ||\n error.data?.message ||\n error;\n\n if (typeof maybeAMessage === 'string') {\n return maybeAMessage;\n } else if (maybeAMessage && maybeAMessage.toString) {\n return maybeAMessage.toString();\n }\n\n return undefined;\n}\n","import { useState, useCallback, useMemo } from 'react';\n\nimport { AzureMonitorErrorish } from '../types';\n\nimport { messageFromElement } from './messageFromError';\n\ntype SourcedError = [string, AzureMonitorErrorish];\n\nexport default function useLastError() {\n const [errors, setErrors] = useState<SourcedError[]>([]);\n\n // Handles errors from any child components that request data to display their options\n const addError = useCallback((errorSource: string, error: AzureMonitorErrorish | undefined) => {\n setErrors((errors) => {\n const errorsCopy = [...errors];\n const index = errors.findIndex(([vSource]) => vSource === errorSource);\n\n // If there's already an error, remove it. If we're setting a new error\n // below, we'll move it to the front\n if (index > -1) {\n errorsCopy.splice(index, 1);\n }\n\n // And then add the new error to the top of the array. If error is defined, it was already\n // removed above.\n if (error) {\n errorsCopy.unshift([errorSource, error]);\n }\n\n return errorsCopy;\n });\n }, []);\n\n const errorMessage = useMemo(() => {\n const recentError = errors[0];\n return recentError && messageFromElement(recentError[1]);\n }, [errors]);\n\n return [errorMessage, addError] as const;\n}\n","import React, { useCallback } from 'react';\n\nimport { CodeEditor } from '@grafana/ui';\n\nimport { AzureQueryEditorFieldProps } from '../../types';\n\nconst QueryField = ({ query, onQueryChange }: AzureQueryEditorFieldProps) => {\n const onChange = useCallback(\n (newQuery: string) => {\n onQueryChange({\n ...query,\n azureResourceGraph: {\n ...query.azureResourceGraph,\n query: newQuery,\n },\n });\n },\n [onQueryChange, query]\n );\n\n return (\n <CodeEditor\n value={query.azureResourceGraph?.query ?? ''}\n language=\"kusto\"\n height={200}\n width=\"100%\"\n showMiniMap={false}\n onBlur={onChange}\n onSave={onChange}\n />\n );\n};\n\nexport default QueryField;\n","import React from 'react';\n\nimport { EditorField } from '@grafana/experimental';\nimport { InlineField } from '@grafana/ui';\nimport { Props as InlineFieldProps } from '@grafana/ui/src/components/Forms/InlineField';\n\ninterface Props extends InlineFieldProps {\n label: string;\n inlineField?: boolean;\n labelWidth?: number;\n}\n\nconst DEFAULT_LABEL_WIDTH = 18;\n\nexport const Field = (props: Props) => {\n const { labelWidth, inlineField, ...remainingProps } = props;\n\n if (!inlineField) {\n return <EditorField width={labelWidth || DEFAULT_LABEL_WIDTH} {...remainingProps} />;\n } else {\n return <InlineField labelWidth={labelWidth || DEFAULT_LABEL_WIDTH} {...remainingProps} />;\n }\n};\n","import React, { useEffect, useMemo, useState } from 'react';\n\nimport { SelectableValue } from '@grafana/data';\nimport { FieldValidationMessage, MultiSelect } from '@grafana/ui';\n\nimport { selectors } from '../../e2e/selectors';\nimport { AzureMonitorQuery, AzureQueryEditorFieldProps, AzureMonitorOption } from '../../types';\nimport { findOptions } from '../../utils/common';\nimport { Field } from '../Field';\n\ninterface SubscriptionFieldProps extends AzureQueryEditorFieldProps {\n onQueryChange: (newQuery: AzureMonitorQuery) => void;\n subscriptions: AzureMonitorOption[];\n}\n\nconst SubscriptionField = ({ query, subscriptions, variableOptionGroup, onQueryChange }: SubscriptionFieldProps) => {\n const [error, setError] = useState<boolean>(false);\n const [values, setValues] = useState<Array<SelectableValue<string>>>([]);\n const options = useMemo(() => [...subscriptions, variableOptionGroup], [subscriptions, variableOptionGroup]);\n\n useEffect(() => {\n if (query.subscriptions && query.subscriptions.length > 0) {\n setValues(findOptions([...subscriptions, ...variableOptionGroup.options], query.subscriptions));\n setError(false);\n } else {\n setError(true);\n }\n }, [query.subscriptions, subscriptions, variableOptionGroup.options]);\n\n const onChange = (change: Array<SelectableValue<string>>) => {\n const containsSelectAll = change.filter((c) => c.value === 'Select all subscriptions');\n if (!change || change.length === 0) {\n setValues([]);\n onQueryChange({\n ...query,\n subscriptions: [],\n });\n setError(true);\n } else if (containsSelectAll.length > 0) {\n const allSubs = subscriptions.map((c) => c.value ?? '').filter((c) => c !== 'Select all subscriptions');\n onQueryChange({\n ...query,\n subscriptions: allSubs,\n });\n } else {\n const newSubs = change.map((c) => c.value ?? '');\n onQueryChange({\n ...query,\n subscriptions: newSubs,\n });\n setValues(findOptions([...subscriptions, ...variableOptionGroup.options], newSubs));\n setError(false);\n }\n };\n\n return (\n <Field label=\"Subscriptions\" data-testid={selectors.components.queryEditor.argsQueryEditor.subscriptions.input}>\n <>\n <MultiSelect\n isClearable\n value={values}\n inputId=\"azure-monitor-subscriptions-field\"\n onChange={onChange}\n options={options}\n width={38}\n />\n {error ? <FieldValidationMessage>At least one subscription must be chosen.</FieldValidationMessage> : null}\n </>\n </Field>\n );\n};\n\nexport default SubscriptionField;\n","import { intersection } from 'lodash';\nimport React, { useState, useMemo } from 'react';\n\nimport { EditorFieldGroup, EditorRow, EditorRows } from '@grafana/experimental';\n\nimport Datasource from '../../datasource';\nimport { selectors } from '../../e2e/selectors';\nimport { AzureMonitorErrorish, AzureMonitorOption, AzureMonitorQuery } from '../../types';\n\nimport QueryField from './QueryField';\nimport SubscriptionField from './SubscriptionField';\n\ninterface ArgQueryEditorProps {\n query: AzureMonitorQuery;\n datasource: Datasource;\n subscriptionId?: string;\n onChange: (newQuery: AzureMonitorQuery) => void;\n variableOptionGroup: { label: string; options: AzureMonitorOption[] };\n setError: (source: string, error: AzureMonitorErrorish | undefined) => void;\n}\n\nconst ERROR_SOURCE = 'arg-subscriptions';\n\nfunction selectSubscriptions(\n fetchedSubscriptions: string[],\n currentSubscriptions?: string[],\n currentSubscription?: string\n) {\n let querySubscriptions = currentSubscriptions || [];\n if (querySubscriptions.length === 0 && currentSubscription) {\n querySubscriptions = [currentSubscription];\n }\n if (querySubscriptions.length === 0 && fetchedSubscriptions.length) {\n querySubscriptions = [fetchedSubscriptions[0]];\n }\n\n const templateVars = querySubscriptions.filter((sub) => sub.includes('$'));\n const commonSubscriptions = intersection(querySubscriptions, fetchedSubscriptions).concat(templateVars);\n if (fetchedSubscriptions.length && querySubscriptions.length > commonSubscriptions.length) {\n // If not all of the query subscriptions are in the list of fetched subscriptions, then\n // select only the ones present (or the first one if none is present)\n querySubscriptions = commonSubscriptions.length > 0 ? commonSubscriptions : [fetchedSubscriptions[0]];\n }\n return querySubscriptions;\n}\n\nconst ArgQueryEditor = ({\n query,\n datasource,\n subscriptionId,\n variableOptionGroup,\n onChange,\n setError,\n}: ArgQueryEditorProps) => {\n const [subscriptions, setSubscriptions] = useState<AzureMonitorOption[]>([]);\n useMemo(() => {\n datasource\n .getSubscriptions()\n .then((results) => {\n const selectAllSubscriptionOption = [\n { label: 'Select all subscriptions', value: 'Select all subscriptions', description: 'Select all' },\n ];\n const fetchedSubscriptions = results.map((v) => ({ label: v.text, value: v.value, description: v.value }));\n setSubscriptions(selectAllSubscriptionOption.concat(fetchedSubscriptions));\n setError(ERROR_SOURCE, undefined);\n\n onChange({\n ...query,\n subscriptions: selectSubscriptions(\n fetchedSubscriptions.map((v) => v.value),\n query.subscriptions,\n query.subscription\n ),\n });\n })\n .catch((err) => setError(ERROR_SOURCE, err));\n // We are only interested in re-fetching subscriptions if the data source changes\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [datasource]);\n\n return (\n <span data-testid={selectors.components.queryEditor.argsQueryEditor.container.input}>\n <EditorRows>\n <EditorRow>\n <EditorFieldGroup>\n <SubscriptionField\n subscriptions={subscriptions}\n query={query}\n datasource={datasource}\n subscriptionId={subscriptionId}\n variableOptionGroup={variableOptionGroup}\n onQueryChange={onChange}\n setError={setError}\n />\n </EditorFieldGroup>\n </EditorRow>\n </EditorRows>\n <QueryField\n query={query}\n datasource={datasource}\n subscriptionId={subscriptionId}\n variableOptionGroup={variableOptionGroup}\n onQueryChange={onChange}\n setError={setError}\n />\n </span>\n );\n};\n\nexport default ArgQueryEditor;\n","import React, { useCallback, useMemo } from 'react';\nimport { useEffectOnce } from 'react-use';\n\nimport { SelectableValue } from '@grafana/data';\nimport { Select } from '@grafana/ui';\n\nimport { selectors } from '../e2e/selectors';\nimport { FormatAsFieldProps, ResultFormat } from '../types';\n\nimport { Field } from './Field';\n\nconst FormatAsField = ({\n query,\n variableOptionGroup,\n onQueryChange,\n inputId,\n options: formatOptions,\n defaultValue,\n setFormatAs,\n resultFormat,\n}: FormatAsFieldProps) => {\n const options = useMemo(() => [...formatOptions, variableOptionGroup], [variableOptionGroup, formatOptions]);\n\n const handleChange = useCallback(\n (change: SelectableValue<ResultFormat>) => {\n const { value } = change;\n if (!value) {\n return;\n }\n\n const newQuery = setFormatAs(query, value);\n onQueryChange(newQuery);\n },\n [onQueryChange, query, setFormatAs]\n );\n\n useEffectOnce(() => {\n if (!resultFormat) {\n handleChange({ value: defaultValue });\n } else {\n if (!formatOptions.find((item) => item.value === resultFormat)) {\n handleChange({ value: defaultValue });\n }\n }\n });\n\n return (\n <Field label=\"Format as\" data-testid={selectors.components.queryEditor.logsQueryEditor.formatSelection.input}>\n <Select\n inputId={`${inputId}-format-as-field`}\n value={resultFormat ?? defaultValue}\n onChange={handleChange}\n options={options}\n width={38}\n />\n </Field>\n );\n};\n\nexport default FormatAsField;\n","import React, { useState } from 'react';\n\nimport { Collapse, Space } from '@grafana/ui';\n\nimport { selectors } from '../../e2e/selectors';\nimport { AzureMonitorResource } from '../../types';\n\nexport interface ResourcePickerProps<T> {\n resources: T[];\n onChange: (resources: T[]) => void;\n renderAdvanced: (resources: T[], onChange: (resources: T[]) => void) => React.ReactNode;\n}\n\nconst AdvancedMulti = ({ resources, onChange, renderAdvanced }: ResourcePickerProps<string | AzureMonitorResource>) => {\n const [isAdvancedOpen, setIsAdvancedOpen] = useState(!!resources.length && JSON.stringify(resources).includes('$'));\n\n return (\n <div data-testid={selectors.components.queryEditor.resourcePicker.advanced.collapse}>\n <Collapse\n collapsible\n label=\"Advanced\"\n isOpen={isAdvancedOpen}\n onToggle={() => setIsAdvancedOpen(!isAdvancedOpen)}\n >\n {renderAdvanced(resources, onChange)}\n <Space v={2} />\n </Collapse>\n </div>\n );\n};\n\nexport default AdvancedMulti;\n","export enum ResourceRowType {\n Subscription = 'Subscription',\n ResourceGroup = 'ResourceGroup',\n Resource = 'Resource',\n VariableGroup = 'TemplateVariableGroup',\n Variable = 'TemplateVariable',\n}\n\nexport interface ResourceRow {\n id: string; // azure's raw data id usually passes along a uri (except in the case of subscriptions), to make things less confusing for ourselves we parse the id string out of the uri or vice versa\n uri: string; // ex: /subscriptions/subid123\n name: string;\n type: ResourceRowType;\n typeLabel: string;\n location?: string;\n children?: ResourceRowGroup;\n}\n\nexport type ResourceRowGroup = ResourceRow[];\n","import React from 'react';\n\nimport { Icon } from '@grafana/ui';\n\nimport { ResourceRow, ResourceRowType } from './types';\n\ninterface EntryIconProps {\n entry: ResourceRow;\n isOpen: boolean;\n}\n\nexport const EntryIcon = ({ isOpen, entry: { type } }: EntryIconProps) => {\n switch (type) {\n case ResourceRowType.Subscription:\n return <Icon name=\"layer-group\" />;\n\n case ResourceRowType.ResourceGroup:\n return <Icon name={isOpen ? 'folder-open' : 'folder'} />;\n\n case ResourceRowType.Resource:\n return <Icon name=\"cube\" />;\n\n case ResourceRowType.VariableGroup:\n return <Icon name=\"x\" />;\n\n case ResourceRowType.Variable:\n return <Icon name=\"x\" />;\n\n default:\n return null;\n }\n};\n","import { css } from '@emotion/css';\n\nimport { GrafanaTheme2 } from '@grafana/data';\n\nconst getStyles = (theme: GrafanaTheme2) => ({\n table: css({\n width: '100%',\n tableLayout: 'fixed',\n overflow: 'scroll',\n }),\n\n scrollableTable: css({\n overflow: 'auto',\n }),\n\n tableScroller: css({\n maxHeight: '16vh',\n }),\n\n selectedTableScroller: css({\n maxHeight: '13vh',\n }),\n\n header: css({\n background: theme.colors.background.secondary,\n }),\n\n row: css({\n borderBottom: `1px solid ${theme.colors.border.weak}`,\n\n '&:last-of-type': {\n borderBottomColor: theme.colors.border.medium,\n },\n }),\n\n disabledRow: css({\n opacity: 0.5,\n }),\n\n cell: css({\n padding: theme.spacing(1, 1, 1, 0),\n width: '25%',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n '&:first-of-type': {\n width: '50%',\n padding: theme.spacing(1, 1, 1, 2),\n },\n }),\n\n collapseButton: css({ margin: 0 }),\n\n loadingCell: css({\n textAlign: 'center',\n }),\n\n spinner: css({\n marginBottom: 0,\n }),\n\n nestedEntry: css({\n display: 'flex',\n alignItems: 'center',\n }),\n\n entryContentItem: css({\n margin: theme.spacing(0, 1, 0, 0),\n }),\n\n truncated: css({\n minWidth: 0,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n }),\n\n resourceField: css({\n maxWidth: theme.spacing(36),\n overflow: 'hidden',\n }),\n\n resourceFieldButton: css({\n padding: '7px',\n textAlign: 'left',\n }),\n\n nestedRowCheckbox: css({\n zIndex: 0,\n }),\n\n selectionFooter: css({\n background: theme.colors.background.primary,\n paddingTop: theme.spacing(2),\n }),\n\n loadingWrapper: css({\n textAlign: 'center',\n paddingTop: theme.spacing(2),\n paddingBottom: theme.spacing(2),\n color: theme.colors.text.secondary,\n }),\n\n resultLimit: css({\n margin: '4px 0',\n fontStyle: 'italic',\n }),\n\n modal: css({\n width: theme.breakpoints.values.lg,\n }),\n});\n\nexport default getStyles;\n","import { cx } from '@emotion/css';\nimport React, { useCallback, useEffect } from 'react';\n\nimport { Checkbox, IconButton, useStyles2, useTheme2, Space } from '@grafana/ui';\n\nimport { EntryIcon } from './EntryIcon';\nimport getStyles from './styles';\nimport { ResourceRow } from './types';\n\ninterface NestedEntryProps {\n level: number;\n entry: ResourceRow;\n isSelected: boolean;\n isSelectable: boolean;\n isOpen: boolean;\n isDisabled: boolean;\n scrollIntoView?: boolean;\n onToggleCollapse: (row: ResourceRow) => void;\n onSelectedChange: (row: ResourceRow, selected: boolean) => void;\n}\n\nexport const NestedEntry = ({\n entry,\n isSelected,\n isDisabled,\n isOpen,\n isSelectable,\n level,\n scrollIntoView,\n onToggleCollapse,\n onSelectedChange,\n}: NestedEntryProps) => {\n const theme = useTheme2();\n const styles = useStyles2(getStyles);\n const hasChildren = !!entry.children;\n\n const handleToggleCollapse = useCallback(() => {\n onToggleCollapse(entry);\n }, [onToggleCollapse, entry]);\n\n const handleSelectedChanged = useCallback(\n (ev: React.ChangeEvent<HTMLInputElement>) => {\n const isSelected = ev.target.checked;\n onSelectedChange(entry, isSelected);\n },\n [entry, onSelectedChange]\n );\n\n const checkboxId = `${scrollIntoView ? 'table' : 'summary'}_checkbox_${entry.uri}`;\n\n // Scroll to the selected element if it's not in the view\n // Only do it once, when the component is mounted\n useEffect(() => {\n if (isSelected && scrollIntoView) {\n document.getElementById(checkboxId)?.scrollIntoView({\n behavior: 'smooth',\n block: 'center',\n });\n }\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\n\n return (\n <div className={styles.nestedEntry} style={{ marginLeft: level * (3 * theme.spacing.gridSize) }}>\n {hasChildren ? (\n <IconButton\n className={styles.collapseButton}\n name={isOpen ? 'angle-down' : 'angle-right'}\n aria-label={isOpen ? `Collapse ${entry.name}` : `Expand ${entry.name}`}\n onClick={handleToggleCollapse}\n id={entry.id}\n />\n ) : (\n <Space layout=\"inline\" h={2} />\n )}\n\n <Space layout=\"inline\" h={2} />\n\n {isSelectable && (\n <>\n <Checkbox\n id={checkboxId}\n onChange={handleSelectedChanged}\n disabled={isDisabled}\n value={isSelected}\n className={styles.nestedRowCheckbox}\n />\n <Space layout=\"inline\" h={2} />\n </>\n )}\n\n <EntryIcon entry={entry} isOpen={isOpen} />\n <Space layout=\"inline\" h={1} />\n\n <label htmlFor={checkboxId} className={cx(styles.entryContentItem, styles.truncated)}>\n {entry.name}\n </label>\n </div>\n );\n};\n","import { TemplateSrv } from '@grafana/runtime';\n\nimport { AzureMonitorResource, GetMetricNamespacesQuery, GetMetricNamesQuery } from '../types';\n\nexport default class UrlBuilder {\n static buildResourceUri(templateSrv: TemplateSrv, resource: AzureMonitorResource, multipleResources?: boolean) {\n const urlArray = [];\n const { subscription, resourceGroup, metricNamespace, resourceName } = resource;\n if (subscription) {\n urlArray.push('/subscriptions', subscription);\n if (resourceGroup && !multipleResources) {\n urlArray.push('resourceGroups', resourceGroup);\n\n if (metricNamespace && resourceName) {\n const metricNamespaceProcessed = templateSrv.replace(metricNamespace);\n const metricNamespaceArray = metricNamespace.split('/');\n const resourceNameProcessed = templateSrv.replace(resourceName);\n const resourceNameArray = resourceName.split('/');\n const provider = metricNamespaceArray.shift();\n if (provider) {\n urlArray.push('providers', provider);\n }\n\n if (\n metricNamespaceProcessed.toLowerCase().startsWith('microsoft.storage/storageaccounts/') &&\n !resourceNameProcessed.endsWith('default')\n ) {\n resourceNameArray.push('default');\n }\n\n if (resourceNameArray.length > metricNamespaceArray.length) {\n const parentResource = resourceNameArray.shift();\n if (parentResource) {\n urlArray.push(parentResource);\n }\n }\n\n for (const i in metricNamespaceArray) {\n urlArray.push(metricNamespaceArray[i]);\n urlArray.push(resourceNameArray[i]);\n }\n }\n }\n }\n\n return urlArray.join('/');\n }\n\n static buildAzureMonitorGetMetricNamespacesUrl(\n baseUrl: string,\n apiVersion: string,\n query: GetMetricNamespacesQuery,\n globalRegion: boolean,\n templateSrv: TemplateSrv\n ) {\n let resourceUri: string;\n\n if ('resourceUri' in query) {\n resourceUri = query.resourceUri;\n } else {\n const { subscription, resourceGroup, metricNamespace, resourceName } = query;\n resourceUri = UrlBuilder.buildResourceUri(templateSrv, {\n subscription,\n resourceGroup,\n metricNamespace,\n resourceName,\n });\n }\n\n return `${baseUrl}${resourceUri}/providers/microsoft.insights/metricNamespaces?api-version=${apiVersion}${\n globalRegion ? '®ion=global' : ''\n }`;\n }\n\n static buildAzureMonitorGetMetricNamesUrl(\n baseUrl: string,\n apiVersion: string,\n query: GetMetricNamesQuery,\n templateSrv: TemplateSrv,\n multipleResources?: boolean,\n region?: string\n ) {\n let resourceUri: string;\n const { customNamespace, metricNamespace } = query;\n if ('resourceUri' in query) {\n resourceUri = query.resourceUri;\n } else {\n const { subscription, resourceGroup, metricNamespace, resourceName } = query;\n resourceUri = UrlBuilder.buildResourceUri(\n templateSrv,\n {\n subscription,\n resourceGroup,\n metricNamespace,\n resourceName,\n },\n multipleResources\n );\n }\n let url = `${baseUrl}${resourceUri}/providers/microsoft.insights/metricdefinitions?api-version=${apiVersion}`;\n if (customNamespace) {\n url += `&metricnamespace=${encodeURIComponent(customNamespace)}`;\n }\n\n if (multipleResources && !customNamespace && metricNamespace) {\n url += `&metricnamespace=${encodeURIComponent(metricNamespace)}`;\n }\n\n if (region && multipleResources) {\n url += `®ion=${region}`;\n }\n\n return url;\n }\n}\n","import { produce } from 'immer';\n\nimport { getTemplateSrv } from '@grafana/runtime';\n\nimport UrlBuilder from '../../azure_monitor/url_builder';\nimport { ResourcePickerQueryType } from '../../resourcePicker/resourcePickerData';\nimport { AzureMonitorResource, AzureMonitorQuery } from '../../types';\n\nimport { ResourceRow, ResourceRowGroup } from './types';\n\n// This regex matches URIs representing:\n// - subscriptions: /subscriptions/44693801-6ee6-49de-9b2d-9106972f9572\n// - resource groups: /subscriptions/44693801-6ee6-49de-9b2d-9106972f9572/resourceGroups/cloud-datasources\n// - resources: /subscriptions/44693801-6ee6-49de-9b2d-9106972f9572/resourceGroups/cloud-datasources/providers/Microsoft.Compute/virtualMachines/GithubTestDataVM\nconst RESOURCE_URI_REGEX =\n /\\/subscriptions\\/(?<subscription>[^/]+)(?:\\/resourceGroups\\/(?<resourceGroup>[^/]+)(?:\\/providers\\/(?<metricNamespaceAndResource>.+))?)?/;\n\ntype RegexGroups = Record<string, string | undefined>;\n\nfunction parseNamespaceAndName(metricNamespaceAndName?: string) {\n if (!metricNamespaceAndName) {\n return {};\n }\n const stringArray = metricNamespaceAndName.split('/');\n // The first two groups belong to the namespace (e.g. Microsoft.Storage/storageAccounts)\n const namespaceArray = stringArray.splice(0, 2);\n // The next element belong to the resource name (e.g. storageAcc1)\n const resourceNameArray = stringArray.splice(0, 1);\n // If there are more elements, keep adding them to the namespace and resource name, alternatively\n // e.g (blobServices/default)\n while (stringArray.length) {\n const nextElem = stringArray.shift()!;\n stringArray.length % 2 === 0 ? resourceNameArray.push(nextElem) : namespaceArray.push(nextElem);\n }\n return { metricNamespace: namespaceArray.join('/'), resourceName: resourceNameArray.join('/') };\n}\n\nexport function parseResourceURI(resourceURI: string): AzureMonitorResource {\n const matches = RESOURCE_URI_REGEX.exec(resourceURI);\n const groups: RegexGroups = matches?.groups ?? {};\n const { subscription, resourceGroup, metricNamespaceAndResource } = groups;\n const { metricNamespace, resourceName } = parseNamespaceAndName(metricNamespaceAndResource);\n\n return { subscription, resourceGroup, metricNamespace, resourceName };\n}\n\nexport function parseMultipleResourceDetails(resources: Array<string | AzureMonitorResource>, location?: string) {\n return resources.map((resource) => {\n return parseResourceDetails(resource, location);\n });\n}\n\nexport function parseResourceDetails(resource: string | AzureMonitorResource, location?: string) {\n if (typeof resource === 'string') {\n const res = parseResourceURI(resource);\n if (location) {\n res.region = location;\n }\n return res;\n }\n return resource;\n}\n\nexport function resourcesToStrings(resources: Array<string | AzureMonitorResource>) {\n return resources.map((resource) => resourceToString(resource));\n}\n\nexport function resourceToString(resource?: string | AzureMonitorResource) {\n return resource\n ? typeof resource === 'string'\n ? resource\n : UrlBuilder.buildResourceUri(getTemplateSrv(), resource)\n : '';\n}\n\nexport function isGUIDish(input: string) {\n return !!input.match(/^[A-Z0-9]+/i);\n}\n\nfunction compareNamespaceAndName(\n rowNamespace?: string,\n rowName?: string,\n resourceNamespace?: string,\n resourceName?: string\n) {\n // StorageAccounts subresources are not listed independently\n if (resourceNamespace?.startsWith('microsoft.storage/storageaccounts')) {\n resourceNamespace = 'microsoft.storage/storageaccounts';\n if (resourceName?.endsWith('/default')) {\n resourceName = resourceName.slice(0, -'/default'.length);\n }\n }\n return rowNamespace === resourceNamespace && rowName === resourceName;\n}\n\nexport function matchURI(rowURI: string, resourceURI: string) {\n const targetParams = parseResourceDetails(resourceURI);\n const rowParams = parseResourceDetails(rowURI);\n\n return (\n rowParams?.subscription === targetParams?.subscription &&\n rowParams?.resourceGroup?.toLowerCase() === targetParams?.resourceGroup?.toLowerCase() &&\n compareNamespaceAndName(\n rowParams?.metricNamespace?.toLowerCase(),\n rowParams?.resourceName,\n targetParams?.metricNamespace?.toLowerCase(),\n targetParams?.resourceName\n )\n );\n}\n\nexport function findRows(rows: ResourceRowGroup, uris: string[]): ResourceRow[] {\n const result: ResourceRow[] = [];\n uris.forEach((uri) => {\n const row = findRow(rows, uri);\n if (row) {\n result.push(row);\n }\n });\n return result;\n}\n\nexport function findRow(rows: ResourceRowGroup, uri: string): ResourceRow | undefined {\n for (const row of rows) {\n if (matchURI(row.uri, uri)) {\n return row;\n }\n\n if (row.children) {\n const result = findRow(row.children, uri);\n\n if (result) {\n return result;\n }\n }\n }\n\n return undefined;\n}\n\nexport function addResources(rows: ResourceRowGroup, targetParentId: string, newResources: ResourceRowGroup) {\n return produce(rows, (draftState) => {\n const draftRow = findRow(draftState, targetParentId);\n\n // we can't find the selected resource in our list of resources,\n // probably means user has either mistyped in the input field\n // or is using template variables.\n // either way no need to throw, just show that none of the resources are checked\n if (!draftRow) {\n return;\n }\n\n draftRow.children = newResources;\n });\n}\n\nexport function setResources(\n query: AzureMonitorQuery,\n type: ResourcePickerQueryType,\n resources: Array<string | AzureMonitorResource>\n): AzureMonitorQuery {\n if (type === 'logs') {\n // Resource URI for LogAnalytics\n return {\n ...query,\n azureLogAnalytics: {\n ...query.azureLogAnalytics,\n resources: resourcesToStrings(resources).filter((resource) => resource !== ''),\n },\n };\n }\n if (type === 'traces') {\n // Resource URI for Traces\n return {\n ...query,\n azureTraces: {\n ...query.azureTraces,\n resources: resourcesToStrings(resources).filter((resource) => resource !== ''),\n },\n };\n }\n\n // Resource object for metrics\n const parsedResource = resources.length ? parseResourceDetails(resources[0]) : {};\n return {\n ...query,\n subscription: parsedResource.subscription,\n azureMonitor: {\n ...query.azureMonitor,\n metricNamespace: parsedResource.metricNamespace?.toLocaleLowerCase(),\n region: parsedResource.region,\n resources: parseMultipleResourceDetails(resources).filter(\n (resource) =>\n resource.resourceName !== '' &&\n resource.metricNamespace !== '' &&\n resource.subscription !== '' &&\n resource.resourceGroup !== ''\n ),\n metricName: undefined,\n aggregation: undefined,\n timeGrain: '',\n dimensionFilters: [],\n },\n };\n}\n","import { cx } from '@emotion/css';\nimport React, { useEffect, useState } from 'react';\n\nimport { FadeTransition, LoadingPlaceholder, useStyles2 } from '@grafana/ui';\n\nimport { NestedEntry } from './NestedEntry';\nimport getStyles from './styles';\nimport { ResourceRow, ResourceRowGroup, ResourceRowType } from './types';\nimport { findRow } from './utils';\n\ninterface NestedRowProps {\n row: ResourceRow;\n level: number;\n selectedRows: ResourceRowGroup;\n requestNestedRows: (row: ResourceRow) => Promise<void>;\n onRowSelectedChange: (row: ResourceRow, selected: boolean) => void;\n selectableEntryTypes: ResourceRowType[];\n disableRow: (row: ResourceRow, selectedRows: ResourceRowGroup) => boolean;\n scrollIntoView?: boolean;\n}\n\nconst NestedRow = ({\n row,\n selectedRows,\n level,\n requestNestedRows,\n onRowSelectedChange,\n selectableEntryTypes,\n scrollIntoView,\n disableRow,\n}: NestedRowProps) => {\n const styles = useStyles2(getStyles);\n const [rowStatus, setRowStatus] = useState<'open' | 'closed' | 'loading'>('closed');\n\n const isSelected = !!selectedRows.find((v) => v.uri.toLowerCase() === row.uri.toLowerCase());\n const isDisabled = !isSelected && disableRow(row, selectedRows);\n const isOpen = rowStatus === 'open';\n\n const onRowToggleCollapse = async () => {\n if (rowStatus === 'open') {\n setRowStatus('closed');\n return;\n }\n setRowStatus('loading');\n requestNestedRows(row)\n .then(() => setRowStatus('open'))\n .catch(() => setRowStatus('closed'));\n };\n\n // opens the resource group on load of component if there was a previously saved selection\n useEffect(() => {\n // Assuming we don't have multi-select yet\n const selectedRow = selectedRows[0];\n\n const containsChild = selectedRow && !!findRow(row.children ?? [], selectedRow.uri);\n\n if (containsChild) {\n setRowStatus('open');\n }\n }, [selectedRows, row]);\n\n return (\n <>\n <tr className={cx(styles.row, isDisabled && styles.disabledRow)} key={row.id}>\n <td className={styles.cell}>\n <NestedEntry\n level={level}\n isSelected={isSelected}\n isDisabled={isDisabled}\n isOpen={isOpen}\n entry={row}\n onToggleCollapse={onRowToggleCollapse}\n onSelectedChange={onRowSelectedChange}\n isSelectable={selectableEntryTypes.some((type) => type === row.type)}\n scrollIntoView={scrollIntoView}\n />\n </td>\n\n <td className={styles.cell}>{row.typeLabel}</td>\n\n <td className={styles.cell}>{row.location ?? '-'}</td>\n </tr>\n\n {isOpen &&\n row.children &&\n Object.keys(row.children).length > 0 &&\n row.children.map((childRow) => (\n <NestedRow\n key={childRow.uri}\n row={childRow}\n selectedRows={selectedRows}\n level={level + 1}\n requestNestedRows={requestNestedRows}\n onRowSelectedChange={onRowSelectedChange}\n selectableEntryTypes={selectableEntryTypes}\n scrollIntoView={scrollIntoView}\n disableRow={disableRow}\n />\n ))}\n\n <FadeTransition visible={rowStatus === 'loading'}>\n <tr>\n <td className={cx(styles.cell, styles.loadingCell)} colSpan={3}>\n <LoadingPlaceholder text=\"Loading...\" className={styles.spinner} />\n </td>\n </tr>\n </FadeTransition>\n </>\n );\n};\n\nexport default NestedRow;\n","import { debounce } from 'lodash';\nimport React, { useEffect, useMemo, useState } from 'react';\n\nimport { Icon, Input } from '@grafana/ui';\n\nimport { selectors } from '../../e2e/selectors';\n\nconst Search = ({ searchFn }: { searchFn: (searchPhrase: string) => void }) => {\n const [searchFilter, setSearchFilter] = useState('');\n\n const debouncedSearch = useMemo(() => debounce(searchFn, 600), [searchFn]);\n useEffect(() => {\n return () => {\n // Stop the invocation of the debounced function after unmounting\n debouncedSearch.cancel();\n };\n }, [debouncedSearch]);\n\n return (\n <Input\n aria-label=\"resource search\"\n prefix={<Icon name=\"search\" />}\n value={searchFilter}\n onChange={(event) => {\n const searchPhrase = event.currentTarget.value;\n setSearchFilter(searchPhrase);\n debouncedSearch(searchPhrase);\n }}\n placeholder=\"search for a resource\"\n data-testid={selectors.components.queryEditor.resourcePicker.search.input}\n />\n );\n};\n\nexport default Search;\n","import { cx } from '@emotion/css';\nimport React, { useCallback, useEffect, useState } from 'react';\nimport { useEffectOnce } from 'react-use';\n\nimport { Alert, Button, LoadingPlaceholder, Modal, useStyles2, Space } from '@grafana/ui';\n\nimport { selectors } from '../../e2e/selectors';\nimport ResourcePickerData, { ResourcePickerQueryType } from '../../resourcePicker/resourcePickerData';\nimport { AzureMonitorResource } from '../../types';\nimport messageFromError from '../../utils/messageFromError';\n\nimport AdvancedMulti from './AdvancedMulti';\nimport NestedRow from './NestedRow';\nimport Search from './Search';\nimport getStyles from './styles';\nimport { ResourceRow, ResourceRowGroup, ResourceRowType } from './types';\nimport { findRows, parseMultipleResourceDetails, resourcesToStrings, matchURI, resourceToString } from './utils';\n\ninterface ResourcePickerProps<T> {\n resourcePickerData: ResourcePickerData;\n resources: T[];\n selectableEntryTypes: ResourceRowType[];\n queryType: ResourcePickerQueryType;\n\n onApply: (resources: T[]) => void;\n onCancel: () => void;\n disableRow: (row: ResourceRow, selectedRows: ResourceRowGroup) => boolean;\n renderAdvanced: (resources: T[], onChange: (resources: T[]) => void) => React.ReactNode;\n selectionNotice?: (selectedRows: ResourceRowGroup) => string;\n}\n\nconst ResourcePicker = ({\n resourcePickerData,\n resources,\n onApply,\n onCancel,\n selectableEntryTypes,\n queryType,\n disableRow,\n renderAdvanced,\n selectionNotice,\n}: ResourcePickerProps<string | AzureMonitorResource>) => {\n const styles = useStyles2(getStyles);\n\n const [isLoading, setIsLoading] = useState(false);\n const [rows, setRows] = useState<ResourceRowGroup>([]);\n const [selectedRows, setSelectedRows] = useState<ResourceRowGroup>([]);\n const [internalSelected, setInternalSelected] = useState(resources);\n const [errorMessage, setErrorMessage] = useState<string | undefined>(undefined);\n const [shouldShowLimitFlag, setShouldShowLimitFlag] = useState(false);\n const selectionNoticeText = selectionNotice?.(selectedRows);\n\n // Sync the resourceURI prop to internal state\n useEffect(() => {\n setInternalSelected(resources);\n }, [resources]);\n\n const loadInitialData = useCallback(async () => {\n if (!isLoading) {\n try {\n setIsLoading(true);\n const resources = await resourcePickerData.fetchInitialRows(\n queryType,\n parseMultipleResourceDetails(internalSelected ?? {})\n );\n setRows(resources);\n } catch (error) {\n setErrorMessage(messageFromError(error));\n }\n setIsLoading(false);\n }\n }, [internalSelected, isLoading, resourcePickerData, queryType]);\n\n useEffectOnce(() => {\n loadInitialData();\n });\n\n // Avoid using empty resources\n const isValid = (r: string | AzureMonitorResource) =>\n typeof r === 'string' ? r !== '' : r.subscription && r.resourceGroup && r.resourceName && r.metricNamespace;\n\n // set selected row data whenever row or selection changes\n useEffect(() => {\n if (!internalSelected) {\n setSelectedRows([]);\n }\n\n const sanitized = internalSelected.filter((r) => isValid(r));\n const found = internalSelected && findRows(rows, resourcesToStrings(sanitized));\n if (sanitized?.length > found.length) {\n // Not all the selected items are in the current rows, so we need to generate the row\n // information for those.\n return setSelectedRows(resourcePickerData.parseRows(sanitized));\n }\n if (found && found.length) {\n return setSelectedRows(found);\n }\n return setSelectedRows([]);\n }, [internalSelected, rows, resourcePickerData]);\n\n // Request resources for an expanded resource group\n const requestNestedRows = useCallback(\n async (parentRow: ResourceRow) => {\n // clear error message (also when loading cached resources)\n setErrorMessage(undefined);\n\n // If we already have children, we don't need to re-fetch them.\n if (parentRow.children?.length) {\n return;\n }\n\n try {\n const nestedRows = await resourcePickerData.fetchAndAppendNestedRow(rows, parentRow, queryType);\n setRows(nestedRows);\n } catch (error) {\n setErrorMessage(messageFromError(error));\n throw error;\n }\n },\n [resourcePickerData, rows, queryType]\n );\n\n const handleSelectionChanged = useCallback(\n (row: ResourceRow, isSelected: boolean) => {\n if (isSelected) {\n const newRes = queryType === 'logs' ? row.uri : parseMultipleResourceDetails([row.uri], row.location)[0];\n const newSelected = internalSelected ? internalSelected.concat(newRes) : [newRes];\n setInternalSelected(newSelected.filter((r) => isValid(r)));\n } else {\n const newInternalSelected = internalSelected?.filter((r) => {\n return !matchURI(resourceToString(r), row.uri);\n });\n setInternalSelected(newInternalSelected);\n }\n },\n [queryType, internalSelected, setInternalSelected]\n );\n\n const handleApply = useCallback(() => {\n if (internalSelected) {\n onApply(queryType === 'logs' ? internalSelected : parseMultipleResourceDetails(internalSelected));\n }\n }, [queryType, internalSelected, onApply]);\n\n const handleSearch = useCallback(\n async (searchWord: string) => {\n // clear errors and warnings\n setErrorMessage(undefined);\n setShouldShowLimitFlag(false);\n\n if (!searchWord) {\n loadInitialData();\n return;\n }\n\n try {\n setIsLoading(true);\n const searchResults = await resourcePickerData.search(searchWord, queryType);\n setRows(searchResults);\n if (searchResults.length >= resourcePickerData.resultLimit) {\n setShouldShowLimitFlag(true);\n }\n } catch (err) {\n setErrorMessage(messageFromError(err));\n }\n setIsLoading(false);\n },\n [loadInitialData, resourcePickerData, queryType]\n );\n\n return (\n <>\n <Search searchFn={handleSearch} />\n {shouldShowLimitFlag ? (\n <p className={styles.resultLimit}>Showing first {resourcePickerData.resultLimit} results</p>\n ) : (\n <Space v={2} />\n )}\n\n <table className={styles.table}>\n <thead>\n <tr className={cx(styles.row, styles.header)}>\n <td className={styles.cell}>Scope</td>\n <td className={styles.cell}>Type</td>\n <td className={styles.cell}>Location</td>\n </tr>\n </thead>\n </table>\n\n <div className={cx(styles.scrollableTable, styles.tableScroller)}>\n <table className={styles.table}>\n <tbody>\n {isLoading && (\n <tr className={cx(styles.row)}>\n <td className={styles.cell}>\n <LoadingPlaceholder text={'Loading...'} />\n </td>\n </tr>\n )}\n {!isLoading && rows.length === 0 && (\n <tr className={cx(styles.row)}>\n <td className={styles.cell} aria-live=\"polite\">\n No resources found\n </td>\n </tr>\n )}\n {!isLoading &&\n rows.map((row) => (\n <NestedRow\n key={row.uri}\n row={row}\n selectedRows={selectedRows}\n level={0}\n requestNestedRows={requestNestedRows}\n onRowSelectedChange={handleSelectionChanged}\n selectableEntryTypes={selectableEntryTypes}\n scrollIntoView={true}\n disableRow={disableRow}\n />\n ))}\n </tbody>\n </table>\n </div>\n\n <footer className={styles.selectionFooter}>\n {selectedRows.length > 0 && (\n <>\n <h5>Selection</h5>\n\n <div className={cx(styles.scrollableTable, styles.selectedTableScroller)}>\n <table className={styles.table}>\n <tbody>\n {selectedRows.map((row) => (\n <NestedRow\n key={row.uri}\n row={row}\n selectedRows={selectedRows}\n level={0}\n requestNestedRows={requestNestedRows}\n onRowSelectedChange={handleSelectionChanged}\n selectableEntryTypes={selectableEntryTypes}\n disableRow={() => false}\n />\n ))}\n </tbody>\n </table>\n </div>\n <Space v={2} />\n {selectionNoticeText?.length ? (\n <Alert title=\"\" severity=\"info\">\n {selectionNoticeText}\n </Alert>\n ) : null}\n </>\n )}\n\n <AdvancedMulti\n resources={internalSelected}\n onChange={(r) => setInternalSelected(r)}\n renderAdvanced={renderAdvanced}\n />\n\n {errorMessage && (\n <>\n <Space v={2} />\n <Alert severity=\"error\" title=\"An error occurred while requesting resources from Azure Monitor\">\n {errorMessage}\n </Alert>\n </>\n )}\n\n <Modal.ButtonRow>\n <Button onClick={onCancel} variant=\"secondary\" fill=\"outline\">\n Cancel\n </Button>\n <Button\n disabled={!!errorMessage || !internalSelected.every(isValid)}\n onClick={handleApply}\n data-testid={selectors.components.queryEditor.resourcePicker.apply.button}\n >\n Apply\n </Button>\n </Modal.ButtonRow>\n </footer>\n </>\n );\n};\n\nexport default ResourcePicker;\n","import { cx } from '@emotion/css';\nimport React, { useCallback, useEffect, useState } from 'react';\n\nimport { Button, Icon, Modal, useStyles2, IconName } from '@grafana/ui';\n\nimport Datasource from '../../datasource';\nimport { selectors } from '../../e2e/selectors';\nimport { ResourcePickerQueryType } from '../../resourcePicker/resourcePickerData';\nimport { AzureQueryEditorFieldProps, AzureMonitorResource } from '../../types';\nimport { Field } from '../Field';\nimport ResourcePicker from '../ResourcePicker';\nimport getStyles from '../ResourcePicker/styles';\nimport { ResourceRow, ResourceRowGroup, ResourceRowType } from '../ResourcePicker/types';\nimport { parseMultipleResourceDetails, setResources } from '../ResourcePicker/utils';\n\ninterface ResourceFieldProps<T> extends AzureQueryEditorFieldProps {\n selectableEntryTypes: ResourceRowType[];\n queryType: ResourcePickerQueryType;\n resources: T[];\n inlineField?: boolean;\n labelWidth?: number;\n disableRow: (row: ResourceRow, selectedRows: ResourceRowGroup) => boolean;\n renderAdvanced: (resources: T[], onChange: (resources: T[]) => void) => React.ReactNode;\n selectionNotice?: (selectedRows: ResourceRowGroup) => string;\n}\n\ntype Props = ResourceFieldProps<string | AzureMonitorResource>;\n\nconst ResourceField = ({\n query,\n datasource,\n onQueryChange,\n selectableEntryTypes,\n queryType,\n resources,\n inlineField,\n labelWidth,\n disableRow,\n renderAdvanced,\n selectionNotice,\n}: Props) => {\n const styles = useStyles2(getStyles);\n const [pickerIsOpen, setPickerIsOpen] = useState(false);\n\n const handleOpenPicker = useCallback(() => {\n setPickerIsOpen(true);\n }, []);\n\n const closePicker = useCallback(() => {\n setPickerIsOpen(false);\n }, []);\n\n const handleApply = useCallback(\n (resources: Array<string | AzureMonitorResource>) => {\n onQueryChange(setResources(query, queryType, resources));\n closePicker();\n },\n [closePicker, onQueryChange, query, queryType]\n );\n\n return (\n <span data-testid={selectors.components.queryEditor.resourcePicker.select.button}>\n <Modal\n className={styles.modal}\n title=\"Select a resource\"\n isOpen={pickerIsOpen}\n onDismiss={closePicker}\n // The growing number of rows added to the modal causes a focus\n // error in the modal, making it impossible to click on new elements\n trapFocus={false}\n >\n <ResourcePicker\n resourcePickerData={datasource.resourcePickerData}\n resources={resources}\n onApply={handleApply}\n onCancel={closePicker}\n selectableEntryTypes={selectableEntryTypes}\n queryType={queryType}\n disableRow={disableRow}\n renderAdvanced={renderAdvanced}\n selectionNotice={selectionNotice}\n />\n </Modal>\n <Field label=\"Resource\" inlineField={inlineField} labelWidth={labelWidth}>\n <Button className={styles.resourceFieldButton} variant=\"secondary\" onClick={handleOpenPicker} type=\"button\">\n <ResourceLabel resources={resources} datasource={datasource} />\n </Button>\n </Field>\n </span>\n );\n};\n\ninterface ResourceLabelProps<T> {\n resources: T[];\n datasource: Datasource;\n}\n\nconst ResourceLabel = ({ resources, datasource }: ResourceLabelProps<string | AzureMonitorResource>) => {\n const [resourcesComponents, setResourcesComponents] = useState(parseMultipleResourceDetails(resources));\n\n useEffect(() => {\n setResourcesComponents(parseMultipleResourceDetails(resources));\n }, [resources]);\n\n if (!resources.length) {\n return <>Select a resource</>;\n }\n\n return <FormattedResource resources={resourcesComponents} />;\n};\n\ninterface FormattedResourceProps {\n resources: AzureMonitorResource[];\n}\n\nconst FormattedResource = ({ resources }: FormattedResourceProps) => {\n const styles = useStyles2(getStyles);\n\n let icon: IconName = 'cube';\n const items: string[] = [];\n resources.forEach((resource) => {\n if (resource.resourceName) {\n items.push(resource.resourceName.split('/')[0]);\n return;\n }\n if (resource.resourceGroup) {\n icon = 'folder';\n items.push(resource.resourceGroup);\n return;\n }\n if (resource.subscription) {\n icon = 'layer-group';\n items.push(resource.subscription);\n return;\n }\n });\n return (\n <span className={cx(styles.truncated, styles.resourceField)}>\n <Icon name={icon} />\n {items.join(', ')}\n </span>\n );\n};\n\nexport default ResourceField;\n","import { css } from '@emotion/css';\nimport React, { useEffect } from 'react';\n\nimport { GrafanaTheme2 } from '@grafana/data';\nimport { AccessoryButton } from '@grafana/experimental';\nimport { Icon, Input, Tooltip, Label, Button, useStyles2 } from '@grafana/ui';\n\nexport interface ResourcePickerProps<T> {\n resources: T[];\n onChange: (resources: T[]) => void;\n}\n\nconst getStyles = (theme: GrafanaTheme2) => ({\n resourceList: css({ width: '100%', display: 'flex', marginBlock: theme.spacing(1) }),\n});\n\nconst AdvancedResourcePicker = ({ resources, onChange }: ResourcePickerProps<string>) => {\n const styles = useStyles2(getStyles);\n\n useEffect(() => {\n // Ensure there is at least one resource\n if (resources.length === 0) {\n onChange(['']);\n }\n }, [resources, onChange]);\n\n const onResourceChange = (index: number, resource: string) => {\n const newResources = [...resources];\n newResources[index] = resource;\n onChange(newResources);\n };\n\n const removeResource = (index: number) => {\n const newResources = [...resources];\n newResources.splice(index, 1);\n onChange(newResources);\n };\n\n const addResource = () => {\n onChange(resources.concat(''));\n };\n\n return (\n <>\n <Label>\n <h6>\n Resource URI(s){' '}\n <Tooltip\n content={\n <>\n Manually edit the{' '}\n <a\n href=\"https://docs.microsoft.com/en-us/azure/azure-monitor/logs/log-standard-columns#_resourceid\"\n rel=\"noopener noreferrer\"\n target=\"_blank\"\n >\n resource uri\n </a>\n . Supports the use of multiple template variables (ex: /subscriptions/$subId/resourceGroups/$rg)\n </>\n }\n placement=\"right\"\n interactive={true}\n >\n <Icon name=\"info-circle\" />\n </Tooltip>\n </h6>\n </Label>\n {resources.map((resource, index) => (\n <div key={`resource-${index + 1}`}>\n <div className={styles.resourceList}>\n <Input\n id={`input-advanced-resource-picker-${index + 1}`}\n value={resource}\n onChange={(event) => onResourceChange(index, event.currentTarget.value)}\n placeholder=\"ex: /subscriptions/$subId\"\n data-testid={`input-advanced-resource-picker-${index + 1}`}\n />\n <AccessoryButton\n aria-label=\"remove\"\n icon=\"times\"\n variant=\"secondary\"\n onClick={() => removeResource(index)}\n data-testid={`remove-resource`}\n hidden={resources.length === 1}\n />\n </div>\n </div>\n ))}\n <Button aria-label=\"Add\" icon=\"plus\" variant=\"secondary\" onClick={addResource} type=\"button\">\n Add resource URI\n </Button>\n </>\n );\n};\n\nexport default AdvancedResourcePicker;\n","import { AzureMonitorQuery, ResultFormat } from '../../types';\n\nexport function setKustoQuery(query: AzureMonitorQuery, kustoQuery: string): AzureMonitorQuery {\n return {\n ...query,\n azureLogAnalytics: {\n ...query.azureLogAnalytics,\n query: kustoQuery,\n },\n };\n}\n\nexport function setFormatAs(query: AzureMonitorQuery, formatAs: ResultFormat): AzureMonitorQuery {\n return {\n ...query,\n azureLogAnalytics: {\n ...query.azureLogAnalytics,\n resultFormat: formatAs,\n },\n };\n}\n\nexport function setDashboardTime(query: AzureMonitorQuery, dashboardTime: boolean): AzureMonitorQuery {\n return {\n ...query,\n azureLogAnalytics: {\n ...query.azureLogAnalytics,\n dashboardTime,\n },\n };\n}\n\nexport function setTimeColumn(query: AzureMonitorQuery, timeColumn: string): AzureMonitorQuery {\n return {\n ...query,\n azureLogAnalytics: {\n ...query.azureLogAnalytics,\n timeColumn,\n },\n };\n}\n","import { EngineSchema, Schema } from '@kusto/monaco-kusto';\nimport { Uri } from 'monaco-editor';\nimport React, { useCallback, useEffect, useState } from 'react';\n\nimport { CodeEditor, Monaco, MonacoEditor } from '@grafana/ui';\n\nimport { AzureQueryEditorFieldProps } from '../../types';\n\nimport { setKustoQuery } from './setQueryValue';\n\ninterface MonacoEditorValues {\n editor: MonacoEditor;\n monaco: Monaco;\n}\n\ninterface MonacoLanguages {\n kusto: {\n getKustoWorker: () => Promise<\n (url: Uri) => Promise<{\n setSchema: (schema: Schema) => void;\n }>\n >;\n };\n}\n\nconst QueryField = ({ query, onQueryChange, schema }: AzureQueryEditorFieldProps) => {\n const [monaco, setMonaco] = useState<MonacoEditorValues | undefined>();\n\n useEffect(() => {\n if (!schema || !monaco) {\n return;\n }\n\n const setupEditor = async ({ monaco, editor }: MonacoEditorValues, schema: EngineSchema) => {\n try {\n const languages = monaco.languages as unknown as MonacoLanguages;\n const model = editor.getModel();\n if (model) {\n const kustoWorker = await languages.kusto.getKustoWorker();\n const kustoMode = await kustoWorker(model?.uri);\n await kustoMode.setSchema(schema);\n }\n } catch (err) {\n console.error(err);\n }\n };\n\n setupEditor(monaco, schema).catch((err) => console.error(err));\n }, [schema, monaco]);\n\n const handleEditorMount = useCallback((editor: MonacoEditor, monaco: Monaco) => {\n setMonaco({ monaco, editor });\n }, []);\n\n const onChange = useCallback(\n (newQuery: string) => {\n onQueryChange(setKustoQuery(query, newQuery));\n },\n [onQueryChange, query]\n );\n\n return (\n <CodeEditor\n value={query.azureLogAnalytics?.query ?? ''}\n language=\"kusto\"\n height={200}\n width=\"100%\"\n showMiniMap={false}\n onBlur={onChange}\n onSave={onChange}\n onEditorDidMount={handleEditorMount}\n />\n );\n};\n\nexport default QueryField;\n","import React, { useCallback, useEffect, useState } from 'react';\n\nimport { SelectableValue } from '@grafana/data';\nimport { InlineField, RadioButtonGroup, Select } from '@grafana/ui';\n\nimport { AzureQueryEditorFieldProps } from '../../types';\n\nimport { setDashboardTime, setTimeColumn } from './setQueryValue';\n\nexport function TimeManagement({ query, onQueryChange: onChange, schema }: AzureQueryEditorFieldProps) {\n const [defaultTimeColumns, setDefaultTimeColumns] = useState<SelectableValue[] | undefined>();\n const [timeColumns, setTimeColumns] = useState<SelectableValue[] | undefined>();\n\n const setDefaultColumn = useCallback((column: string) => onChange(setTimeColumn(query, column)), [query, onChange]);\n\n useEffect(() => {\n if (schema && query.azureLogAnalytics?.dashboardTime) {\n const timeColumnOptions: SelectableValue[] = [];\n const timeColumnsSet: Set<string> = new Set();\n const defaultColumnsMap: Map<string, SelectableValue> = new Map();\n const db = schema.database;\n if (db) {\n for (const table of db.tables) {\n const cols = table.columns.reduce<SelectableValue[]>((prev, curr, i) => {\n if (curr.type === 'datetime') {\n if (!table.timespanColumn || table.timespanColumn !== curr.name) {\n prev.push({ value: curr.name, label: `${table.name} > ${curr.name}` });\n timeColumnsSet.add(curr.name);\n }\n }\n return prev;\n }, []);\n timeColumnOptions.push(...cols);\n if (table.timespanColumn && !defaultColumnsMap.has(table.timespanColumn)) {\n defaultColumnsMap.set(table.timespanColumn, {\n value: table.timespanColumn,\n label: table.timespanColumn,\n });\n }\n }\n }\n setTimeColumns(timeColumnOptions);\n const defaultColumns = Array.from(defaultColumnsMap.values());\n setDefaultTimeColumns(defaultColumns);\n\n // Set default value\n if (\n !query.azureLogAnalytics.timeColumn ||\n (query.azureLogAnalytics.timeColumn &&\n !timeColumnsSet.has(query.azureLogAnalytics.timeColumn) &&\n !defaultColumnsMap.has(query.azureLogAnalytics.timeColumn))\n ) {\n if (defaultColumns && defaultColumns.length) {\n setDefaultColumn(defaultColumns[0].value);\n setDefaultColumn(defaultColumns[0].value);\n return;\n } else if (timeColumnOptions && timeColumnOptions.length) {\n setDefaultColumn(timeColumnOptions[0].value);\n return;\n } else {\n setDefaultColumn('TimeGenerated');\n return;\n }\n }\n }\n }, [schema, query.azureLogAnalytics?.dashboardTime, query.azureLogAnalytics?.timeColumn, setDefaultColumn]);\n\n const handleTimeColumnChange = useCallback(\n (change: SelectableValue<string>) => {\n if (!change.value) {\n return;\n }\n\n const newQuery = setTimeColumn(query, change.value);\n onChange(newQuery);\n },\n [onChange, query]\n );\n return (\n <>\n <InlineField\n label=\"Time-range\"\n tooltip={\n <span>\n Specifies the time-range used to query. The <code>Query</code> option will only use time-ranges specified in\n the query. <code>Dashboard</code> will only use the Grafana time-range.\n </span>\n }\n >\n <RadioButtonGroup\n options={[\n { label: 'Query', value: false },\n { label: 'Dashboard', value: true },\n ]}\n value={query.azureLogAnalytics?.dashboardTime ?? false}\n size={'md'}\n onChange={(val) => onChange(setDashboardTime(query, val))}\n />\n </InlineField>\n {query.azureLogAnalytics?.dashboardTime && (\n <InlineField\n label=\"Time Column\"\n tooltip={\n <span>\n Specifies the time column used for filtering. Defaults to the first tables <code>timeSpan</code> column,\n the first <code>datetime</code> column found or <code>TimeGenerated</code>.\n </span>\n }\n >\n <Select\n options={[\n {\n label: 'Default time columns',\n options: defaultTimeColumns ?? [{ value: 'TimeGenerated', label: 'TimeGenerated' }],\n },\n {\n label: 'Other time columns',\n options: timeColumns ?? [],\n },\n ]}\n onChange={handleTimeColumnChange}\n value={\n query.azureLogAnalytics?.timeColumn\n ? query.azureLogAnalytics?.timeColumn\n : defaultTimeColumns\n ? defaultTimeColumns[0]\n : timeColumns\n ? timeColumns[0]\n : { value: 'TimeGenerated', label: 'TimeGenerated' }\n }\n allowCustomValue\n />\n </InlineField>\n )}\n </>\n );\n}\n","import { useEffect, useState } from 'react';\n\nimport Datasource from '../../datasource';\nimport { AzureMonitorQuery } from '../../types';\nimport { isGUIDish } from '../ResourcePicker/utils';\n\nasync function migrateWorkspaceQueryToResourceQuery(\n datasource: Datasource,\n query: AzureMonitorQuery,\n onChange: (newQuery: AzureMonitorQuery) => void\n) {\n if (query.azureLogAnalytics?.workspace !== undefined && !query.azureLogAnalytics.resources) {\n const isWorkspaceGUID = isGUIDish(query.azureLogAnalytics.workspace);\n let resource: string;\n\n if (isWorkspaceGUID) {\n resource = await datasource.resourcePickerData.getResourceURIFromWorkspace(query.azureLogAnalytics.workspace);\n } else {\n // The value of workspace is probably a template variable so we just migrate it over as-is\n resource = query.azureLogAnalytics.workspace;\n }\n\n const newQuery = {\n ...query,\n azureLogAnalytics: {\n ...query.azureLogAnalytics,\n resource: resource,\n workspace: undefined,\n },\n };\n\n delete newQuery.azureLogAnalytics.workspace;\n\n onChange(newQuery);\n }\n}\n\ninterface ErrorMessage {\n title: string;\n message: string;\n}\n\nexport default function useMigrations(\n datasource: Datasource,\n query: AzureMonitorQuery,\n onChange: (newQuery: AzureMonitorQuery) => void\n) {\n const [migrationError, setMigrationError] = useState<ErrorMessage>();\n\n useEffect(() => {\n migrateWorkspaceQueryToResourceQuery(datasource, query, onChange).catch((err) =>\n setMigrationError({\n title: 'Unable to migrate workspace as a resource',\n message: err.message,\n })\n );\n }, [datasource, query, onChange]);\n\n return migrationError;\n}\n","import React, { useEffect, useState } from 'react';\n\nimport { PanelData, TimeRange } from '@grafana/data';\nimport { EditorFieldGroup, EditorRow, EditorRows } from '@grafana/experimental';\nimport { Alert, LinkButton } from '@grafana/ui';\n\nimport Datasource from '../../datasource';\nimport { selectors } from '../../e2e/selectors';\nimport { AzureMonitorErrorish, AzureMonitorOption, AzureMonitorQuery, ResultFormat, EngineSchema } from '../../types';\nimport FormatAsField from '../FormatAsField';\nimport ResourceField from '../ResourceField';\nimport { ResourceRow, ResourceRowGroup, ResourceRowType } from '../ResourcePicker/types';\nimport { parseResourceDetails } from '../ResourcePicker/utils';\n\nimport AdvancedResourcePicker from './AdvancedResourcePicker';\nimport QueryField from './QueryField';\nimport { TimeManagement } from './TimeManagement';\nimport { setFormatAs } from './setQueryValue';\nimport useMigrations from './useMigrations';\n\ninterface LogsQueryEditorProps {\n query: AzureMonitorQuery;\n datasource: Datasource;\n subscriptionId?: string;\n onChange: (newQuery: AzureMonitorQuery) => void;\n variableOptionGroup: { label: string; options: AzureMonitorOption[] };\n setError: (source: string, error: AzureMonitorErrorish | undefined) => void;\n hideFormatAs?: boolean;\n timeRange?: TimeRange;\n data?: PanelData;\n}\n\nconst LogsQueryEditor = ({\n query,\n datasource,\n subscriptionId,\n variableOptionGroup,\n onChange,\n setError,\n hideFormatAs,\n timeRange,\n data,\n}: LogsQueryEditorProps) => {\n const migrationError = useMigrations(datasource, query, onChange);\n const disableRow = (row: ResourceRow, selectedRows: ResourceRowGroup) => {\n if (selectedRows.length === 0) {\n // Only if there is some resource(s) selected we should disable rows\n return false;\n }\n const rowResourceNS = parseResourceDetails(row.uri, row.location).metricNamespace?.toLowerCase();\n const selectedRowSampleNs = parseResourceDetails(\n selectedRows[0].uri,\n selectedRows[0].location\n ).metricNamespace?.toLowerCase();\n // Only resources with the same metricNamespace can be selected\n return rowResourceNS !== selectedRowSampleNs;\n };\n const [schema, setSchema] = useState<EngineSchema | undefined>();\n\n useEffect(() => {\n if (query.azureLogAnalytics?.resources && query.azureLogAnalytics.resources.length) {\n datasource.azureLogAnalyticsDatasource.getKustoSchema(query.azureLogAnalytics.resources[0]).then((schema) => {\n setSchema(schema);\n });\n }\n }, [query.azureLogAnalytics?.resources, datasource.azureLogAnalyticsDatasource]);\n\n let portalLinkButton = null;\n\n if (data?.series) {\n const querySeries = data.series.find((result) => result.refId === query.refId);\n if (querySeries && querySeries.meta?.custom?.azurePortalLink) {\n portalLinkButton = (\n <>\n <LinkButton\n size=\"md\"\n target=\"_blank\"\n style={{ marginTop: '22px' }}\n href={querySeries.meta?.custom?.azurePortalLink}\n >\n View query in Azure Portal\n </LinkButton>\n </>\n );\n }\n }\n\n return (\n <span data-testid={selectors.components.queryEditor.logsQueryEditor.container.input}>\n <EditorRows>\n <EditorRow>\n <EditorFieldGroup>\n <ResourceField\n query={query}\n datasource={datasource}\n inlineField={true}\n labelWidth={10}\n subscriptionId={subscriptionId}\n variableOptionGroup={variableOptionGroup}\n onQueryChange={onChange}\n setError={setError}\n selectableEntryTypes={[\n ResourceRowType.Subscription,\n ResourceRowType.ResourceGroup,\n ResourceRowType.Resource,\n ResourceRowType.Variable,\n ]}\n resources={query.azureLogAnalytics?.resources ?? []}\n queryType=\"logs\"\n disableRow={disableRow}\n renderAdvanced={(resources, onChange) => (\n // It's required to cast resources because the resource picker\n // specifies the type to string | AzureMonitorResource.\n // eslint-disable-next-line\n <AdvancedResourcePicker resources={resources as string[]} onChange={onChange} />\n )}\n selectionNotice={() => 'You may only choose items of the same resource type.'}\n />\n <TimeManagement\n query={query}\n datasource={datasource}\n variableOptionGroup={variableOptionGroup}\n onQueryChange={onChange}\n setError={setError}\n schema={schema}\n />\n </EditorFieldGroup>\n </EditorRow>\n <QueryField\n query={query}\n datasource={datasource}\n subscriptionId={subscriptionId}\n variableOptionGroup={variableOptionGroup}\n onQueryChange={onChange}\n setError={setError}\n schema={schema}\n />\n <EditorRow>\n <EditorFieldGroup>\n {!hideFormatAs && (\n <FormatAsField\n query={query}\n datasource={datasource}\n subscriptionId={subscriptionId}\n variableOptionGroup={variableOptionGroup}\n onQueryChange={onChange}\n setError={setError}\n inputId={'azure-monitor-logs'}\n options={[\n { label: 'Log', value: ResultFormat.Logs },\n { label: 'Time series', value: ResultFormat.TimeSeries },\n { label: 'Table', value: ResultFormat.Table },\n ]}\n defaultValue={ResultFormat.Logs}\n setFormatAs={setFormatAs}\n resultFormat={query.azureLogAnalytics?.resultFormat}\n />\n )}\n {portalLinkButton}\n {migrationError && <Alert title={migrationError.title}>{migrationError.message}</Alert>}\n </EditorFieldGroup>\n </EditorRow>\n </EditorRows>\n </span>\n );\n};\n\nexport default LogsQueryEditor;\n","import { css, cx } from '@emotion/css';\nimport Prism, { Grammar } from 'prismjs';\nimport React from 'react';\n\nimport { GrafanaTheme2 } from '@grafana/data/src';\nimport { useTheme2 } from '@grafana/ui/src';\n\nexport interface Props {\n query: string;\n lang: {\n grammar: Grammar;\n name: string;\n };\n className?: string;\n}\nexport function RawQuery({ query, lang, className }: Props) {\n const theme = useTheme2();\n const styles = getStyles(theme);\n const highlighted = Prism.highlight(query, lang.grammar, lang.name);\n\n return (\n <div\n className={cx(styles.editorField, 'prism-syntax-highlight', className)}\n aria-label=\"selector\"\n dangerouslySetInnerHTML={{ __html: highlighted }}\n />\n );\n}\n\nconst getStyles = (theme: GrafanaTheme2) => {\n return {\n editorField: css({\n fontFamily: theme.typography.fontFamilyMonospace,\n fontSize: theme.typography.bodySmall.fontSize,\n }),\n };\n};\n","import { Grammar } from 'prismjs';\n\nimport { CompletionItem } from '@grafana/ui';\n\nexport const QUERY_COMMANDS: CompletionItem[] = [\n {\n label: 'fields',\n documentation: 'Retrieves the specified fields from log events',\n },\n { label: 'display', documentation: 'Specifies which fields to display in the query results' },\n {\n label: 'filter',\n documentation: 'Filters the results of a query based on one or more conditions',\n },\n {\n label: 'stats',\n documentation: 'Calculates aggregate statistics based on the values of log fields',\n },\n { label: 'sort', documentation: 'Sorts the retrieved log events' },\n { label: 'limit', documentation: 'Specifies the number of log events returned by the query' },\n {\n label: 'parse',\n documentation:\n 'Extracts data from a log field, creating one or more ephemeral fields that you can process further in the query',\n },\n];\n\nexport const COMPARISON_OPERATORS = ['=', '!=', '<', '<=', '>', '>='];\nexport const ARITHMETIC_OPERATORS = ['+', '-', '*', '/', '^', '%'];\n\nexport const NUMERIC_OPERATORS = [\n {\n label: 'abs',\n detail: 'abs(a)',\n documentation: 'Absolute value.',\n },\n {\n label: 'ceil',\n detail: 'ceil(a)',\n documentation: 'Round to ceiling (the smallest integer that is greater than the value of a).',\n },\n {\n label: 'floor',\n detail: 'floor(a)',\n documentation: 'Round to floor (the largest integer that is smaller than the value of a).',\n },\n {\n label: 'greatest',\n detail: 'greatest(a,b, ... z)',\n documentation: 'Returns the largest value.',\n },\n {\n label: 'least',\n detail: 'least(a, b, ... z)',\n documentation: 'Returns the smallest value.',\n },\n {\n label: 'log',\n detail: 'log(a)',\n documentation: 'Natural logarithm.',\n },\n {\n label: 'sqrt',\n detail: 'sqrt(a)',\n documentation: 'Square root.',\n },\n];\n\nexport const GENERAL_FUNCTIONS = [\n {\n label: 'ispresent',\n detail: 'ispresent(fieldname)',\n documentation: 'Returns true if the field exists.',\n },\n {\n label: 'coalesce',\n detail: 'coalesce(fieldname1, fieldname2, ... fieldnamex)',\n documentation: 'Returns the first non-null value from the list.',\n },\n];\n\nexport const STRING_FUNCTIONS = [\n {\n label: 'isempty',\n detail: 'isempty(fieldname)',\n documentation: 'Returns true if the field is missing or is an empty string.',\n },\n {\n label: 'isblank',\n detail: 'isblank(fieldname)',\n documentation: 'Returns true if the field is missing, an empty string, or contains only white space.',\n },\n {\n label: 'concat',\n detail: 'concat(string1, string2, ... stringz)',\n documentation: 'Concatenates the strings.',\n },\n {\n label: 'ltrim',\n detail: 'ltrim(string) or ltrim(string1, string2)',\n documentation:\n 'Remove white space from the left of the string. If the function has a second string argument, it removes the characters of string2 from the left of string1.',\n },\n {\n label: 'rtrim',\n detail: 'rtrim(string) or rtrim(string1, string2)',\n documentation:\n 'Remove white space from the right of the string. If the function has a second string argument, it removes the characters of string2 from the right of string1.',\n },\n {\n label: 'trim',\n detail: 'trim(string) or trim(string1, string2)',\n documentation:\n 'Remove white space from both ends of the string. If the function has a second string argument, it removes the characters of string2 from both sides of string1.',\n },\n {\n label: 'strlen',\n detail: 'strlen(string)',\n documentation: 'Returns the length of the string in Unicode code points.',\n },\n {\n label: 'toupper',\n detail: 'toupper(string)',\n documentation: 'Converts the string to uppercase.',\n },\n {\n label: 'tolower',\n detail: 'tolower(string)',\n documentation: 'Converts the string to lowercase.',\n },\n {\n label: 'substr',\n detail: 'substr(string1, x), or substr(string1, x, y)',\n documentation:\n 'Returns a substring from the index specified by the number argument to the end of the string. If the function has a second number argument, it contains the length of the substring to be retrieved.',\n },\n {\n label: 'replace',\n detail: 'replace(string1, string2, string3)',\n documentation: 'Replaces all instances of string2 in string1 with string3.',\n },\n {\n label: 'strcontains',\n detail: 'strcontains(string1, string2)',\n documentation: 'Returns 1 if string1 contains string2 and 0 otherwise.',\n },\n];\n\nexport const DATETIME_FUNCTIONS = [\n {\n label: 'bin',\n detail: 'bin(period)',\n documentation: 'Rounds the value of @timestamp to the given period and then truncates.',\n },\n {\n label: 'datefloor',\n detail: 'datefloor(a, period)',\n documentation: 'Truncates the timestamp to the given period.',\n },\n {\n label: 'dateceil',\n detail: 'dateceil(a, period)',\n documentation: 'Rounds up the timestamp to the given period and then truncates.',\n },\n {\n label: 'fromMillis',\n detail: 'fromMillis(fieldname)',\n documentation:\n 'Interprets the input field as the number of milliseconds since the Unix epoch and converts it to a timestamp.',\n },\n {\n label: 'toMillis',\n detail: 'toMillis(fieldname)',\n documentation:\n 'Converts the timestamp found in the named field into a number representing the milliseconds since the Unix epoch.',\n },\n];\n\nexport const IP_FUNCTIONS = [\n {\n label: 'isValidIp',\n detail: 'isValidIp(fieldname)',\n documentation: 'Returns true if the field is a valid v4 or v6 IP address.',\n },\n {\n label: 'isValidIpV4',\n detail: 'isValidIpV4(fieldname)',\n documentation: 'Returns true if the field is a valid v4 IP address.',\n },\n {\n label: 'isValidIpV6',\n detail: 'isValidIpV6(fieldname)',\n documentation: 'Returns true if the field is a valid v6 IP address.',\n },\n {\n label: 'isIpInSubnet',\n detail: 'isIpInSubnet(fieldname, string)',\n documentation: 'Returns true if the field is a valid v4 or v6 IP address within the specified v4 or v6 subnet.',\n },\n {\n label: 'isIpv4InSubnet',\n detail: 'isIpv4InSubnet(fieldname, string)',\n documentation: 'Returns true if the field is a valid v4 IP address within the specified v4 subnet.',\n },\n {\n label: 'isIpv6InSubnet',\n detail: 'isIpv6InSubnet(fieldname, string)',\n documentation: 'Returns true if the field is a valid v6 IP address within the specified v6 subnet.',\n },\n];\n\nexport const BOOLEAN_FUNCTIONS = [\n {\n label: 'ispresent',\n detail: 'ispresent(fieldname)',\n documentation: 'Returns true if the field exists.',\n },\n {\n label: 'isempty',\n detail: 'isempty(fieldname)',\n documentation: 'Returns true if the field is missing or is an empty string.',\n },\n {\n label: 'isblank',\n detail: 'isblank(fieldname)',\n documentation: 'Returns true if the field is missing, an empty string, or contains only white space.',\n },\n {\n label: 'strcontains',\n detail: 'strcontains(string1, string2)',\n documentation: 'Returns 1 if string1 contains string2 and 0 otherwise.',\n },\n ...IP_FUNCTIONS,\n];\n\nexport const AGGREGATION_FUNCTIONS_STATS = [\n {\n label: 'avg',\n detail: 'avg(NumericFieldname)',\n documentation: 'The average of the values in the specified field.',\n },\n {\n label: 'count',\n detail: 'count(fieldname) or count(*)',\n documentation: 'Counts the log records.',\n },\n {\n label: 'count_distinct',\n detail: 'count_distinct(fieldname)',\n documentation: 'Returns the number of unique values for the field.',\n },\n {\n label: 'max',\n detail: 'max(fieldname)',\n documentation: 'The maximum of the values for this log field in the queried logs.',\n },\n {\n label: 'min',\n detail: 'min(fieldname)',\n documentation: 'The minimum of the values for this log field in the queried logs.',\n },\n {\n label: 'pct',\n detail: 'pct(fieldname, value)',\n documentation: 'A percentile indicates the relative standing of a value in a datas.',\n },\n {\n label: 'stddev',\n detail: 'stddev(NumericFieldname)',\n documentation: 'The standard deviation of the values in the specified field.',\n },\n {\n label: 'sum',\n detail: 'sum(NumericFieldname)',\n documentation: 'The sum of the values in the specified field.',\n },\n];\n\nexport const NON_AGGREGATION_FUNCS_STATS = [\n {\n label: 'earliest',\n detail: 'earliest(fieldname)',\n documentation:\n 'Returns the value of fieldName from the log event that has the earliest time stamp in the queried logs.',\n },\n {\n label: 'latest',\n detail: 'latest(fieldname)',\n documentation:\n 'Returns the value of fieldName from the log event that has the latest time stamp in the queried logs.',\n },\n {\n label: 'sortsFirst',\n detail: 'sortsFirst(fieldname)',\n documentation: 'Returns the value of fieldName that sorts first in the queried logs.',\n },\n {\n label: 'sortsLast',\n detail: 'sortsLast(fieldname)',\n documentation: 'Returns the value of fieldName that sorts last in the queried logs.',\n },\n];\n\nexport const STATS_FUNCS = [...AGGREGATION_FUNCTIONS_STATS, ...NON_AGGREGATION_FUNCS_STATS];\n\nexport const KEYWORDS = ['as', 'like', 'by', 'in', 'desc', 'asc'];\nexport const FIELD_AND_FILTER_FUNCTIONS = [\n ...NUMERIC_OPERATORS,\n ...GENERAL_FUNCTIONS,\n ...STRING_FUNCTIONS,\n ...DATETIME_FUNCTIONS,\n ...IP_FUNCTIONS,\n];\n\nexport const FUNCTIONS = [...FIELD_AND_FILTER_FUNCTIONS, ...STATS_FUNCS];\n\nconst tokenizer: Grammar = {\n comment: {\n pattern: /^#.*/,\n greedy: true,\n },\n backticks: {\n pattern: /`.*?`/,\n alias: 'string',\n greedy: true,\n },\n quote: {\n pattern: /\".*?\"/,\n alias: 'string',\n greedy: true,\n },\n regex: {\n pattern: /\\/.*?\\/(?=\\||\\s*$|,)/,\n greedy: true,\n },\n 'query-command': {\n pattern: new RegExp(`\\\\b(?:${QUERY_COMMANDS.map((command) => command.label).join('|')})\\\\b`, 'i'),\n alias: 'function',\n },\n function: {\n pattern: new RegExp(`\\\\b(?:${FUNCTIONS.map((f) => f.label).join('|')})\\\\b`, 'i'),\n },\n keyword: {\n pattern: new RegExp(`(\\\\s+)(${KEYWORDS.join('|')})(?=\\\\s+)`, 'i'),\n lookbehind: true,\n },\n 'log-group-name': {\n pattern: /[\\.\\-_/#A-Za-z0-9]+/,\n },\n 'field-name': {\n pattern: /(@?[_a-zA-Z]+[_.0-9a-zA-Z]*)|(`((\\\\`)|([^`]))*?`)/,\n greedy: true,\n },\n number: /\\b-?\\d+((\\.\\d*)?([eE][+-]?\\d+)?)?\\b/,\n 'command-separator': {\n pattern: /\\|/,\n alias: 'punctuation',\n },\n 'comparison-operator': {\n pattern: /([<>]=?)|(!?=)/,\n },\n punctuation: /[{}()`,.]/,\n whitespace: /\\s+/,\n};\n\nexport default tokenizer;\n","import { css } from '@emotion/css';\nimport React, { useEffect, useMemo, useState } from 'react';\n\nimport { GrafanaTheme2, SelectableValue } from '@grafana/data';\nimport { reportInteraction } from '@grafana/runtime';\nimport {\n Button,\n Card,\n Collapse,\n CustomScrollbar,\n Field,\n Input,\n LoadingPlaceholder,\n Select,\n useStyles2,\n} from '@grafana/ui';\n\nimport AzureLogAnalyticsDatasource from '../azure_log_analytics/azure_log_analytics_datasource';\nimport {\n AzureMonitorQuery,\n AzureQueryType,\n Category,\n CheatsheetQueries,\n CheatsheetQuery,\n DropdownCategories,\n} from '../types';\n\nimport { RawQuery } from './RawQuery';\nimport tokenizer from './syntax';\n\nexport interface AzureCheatSheetProps {\n onChange: (query: AzureMonitorQuery) => void;\n query: AzureMonitorQuery;\n datasource: AzureLogAnalyticsDatasource;\n}\n\nconst AzureCheatSheet = (props: AzureCheatSheetProps) => {\n const [cheatsheetQueries, setCheatsheetQueries] = useState<CheatsheetQueries | null>(null);\n const [areDropdownsOpen, setAreDropdownsOpen] = useState<DropdownCategories>({});\n const [visibleQueries, setVisibleQueries] = useState<CheatsheetQueries | null>(null);\n const [isLoading, setIsLoading] = useState(true);\n const [searchInputValue, setSearchInputValue] = useState('');\n const styles = useStyles2(getStyles);\n const lang = { grammar: tokenizer, name: 'kql' };\n const dropdownMenu = useMemo(() => {\n if (cheatsheetQueries) {\n return Object.keys(cheatsheetQueries).map((category): SelectableValue<string> => {\n return {\n label: category,\n value: category,\n };\n });\n }\n return [];\n }, [cheatsheetQueries]);\n\n const getCheatsheetQueries = async () => {\n await props.datasource.getAzureLogAnalyticsCheatsheetQueries().then((result) => {\n result.categories.sort((a: Category, b: Category) => {\n return a.displayName.toLowerCase() === b.displayName.toLowerCase()\n ? 0\n : a.displayName.toLowerCase() < b.displayName.toLowerCase()\n ? -1\n : 1;\n });\n const alphabetizedQueries = result.categories.reduce(\n (queriesByCategory: CheatsheetQueries, category: Category) => {\n const categoryQueries = category.related.queries.map((queryId: string) => {\n return result.queries.find((query: CheatsheetQuery) => query.id === queryId);\n });\n queriesByCategory[category.displayName] = categoryQueries;\n setAreDropdownsOpen({ ...areDropdownsOpen, [category.id]: false });\n return queriesByCategory;\n },\n {}\n );\n setCheatsheetQueries(alphabetizedQueries);\n setVisibleQueries(alphabetizedQueries);\n setIsLoading(false);\n return alphabetizedQueries;\n });\n };\n\n useEffect(() => {\n if (!cheatsheetQueries) {\n getCheatsheetQueries();\n }\n });\n\n const filterQueriesBySearch = (searchValue: string) => {\n const visibleQueriesCategories = Object.keys(visibleQueries!);\n if (searchValue.length > 0 && cheatsheetQueries) {\n const filteredQueries: CheatsheetQueries = Object.keys(cheatsheetQueries).reduce(\n (filteredQueriesBySearch: CheatsheetQueries, category) => {\n const filters = cheatsheetQueries![category]!.filter((query) => {\n return query.displayName.toLowerCase().includes(searchValue.toLowerCase());\n });\n if (visibleQueriesCategories.includes(category)) {\n filteredQueriesBySearch[category] = filters;\n }\n return filteredQueriesBySearch;\n },\n {}\n );\n\n setVisibleQueries(filteredQueries);\n return filteredQueries;\n } else {\n if (Object.keys(visibleQueries!).length !== Object.keys(cheatsheetQueries!).length) {\n setVisibleQueries(visibleQueries);\n return visibleQueries;\n } else {\n setVisibleQueries(cheatsheetQueries);\n return cheatsheetQueries;\n }\n }\n };\n\n const filterQueriesByCategory = (categories: SelectableValue<string>) => {\n if (categories.length > 0) {\n const selectedCategories = categories.map((selectedCategory: SelectableValue) => selectedCategory.label);\n const updatedVisibleQueries = selectedCategories.reduce(\n (updatedVisibleQueries: CheatsheetQueries, queryCategory: string) => {\n updatedVisibleQueries[queryCategory] = cheatsheetQueries![queryCategory]!;\n return updatedVisibleQueries;\n },\n {}\n );\n setVisibleQueries(updatedVisibleQueries);\n } else {\n setVisibleQueries(cheatsheetQueries);\n }\n };\n\n return (\n <div>\n {!isLoading && visibleQueries ? (\n <div>\n <div className={styles.filterAlignment}>\n <Input\n value={searchInputValue}\n onChange={(e) => {\n setSearchInputValue(e.currentTarget.value);\n const filteredQueries = filterQueriesBySearch(e.currentTarget.value);\n setVisibleQueries(filteredQueries);\n }}\n placeholder=\"Search Logs queries\"\n width={40}\n />\n <Field label=\"Categories\" className={styles.categoryDropdown}>\n <Select\n options={dropdownMenu}\n value={''}\n onChange={(a) => filterQueriesByCategory(a)}\n allowCustomValue={false}\n backspaceRemovesValue={true}\n placeholder=\"All categories\"\n isClearable={true}\n noOptionsMessage=\"Unable to list all categories\"\n formatCreateLabel={(input: string) => `Category: ${input}`}\n isSearchable={true}\n isMulti={true}\n width={40}\n />\n </Field>\n </div>\n <div className={styles.spacing}>\n Query results:{' '}\n {Object.keys(visibleQueries).reduce((totalQueries: number, category) => {\n totalQueries = visibleQueries[category]!.length + totalQueries;\n return totalQueries;\n }, 0)}\n </div>\n <CustomScrollbar showScrollIndicators={true} autoHeightMax=\"350px\">\n {Object.keys(visibleQueries).map((category: string) => {\n if (visibleQueries[category]!.length) {\n return (\n <Collapse\n label={category + ' ' + `(${visibleQueries[category]!.length})`}\n collapsible={true}\n isOpen={areDropdownsOpen[category]}\n onToggle={(isOpen) => setAreDropdownsOpen({ ...areDropdownsOpen, [category]: isOpen })}\n key={category}\n >\n {visibleQueries[category]!.map((query) => {\n return (\n <Card className={styles.card} key={query.id}>\n <Card.Heading>{query.displayName}</Card.Heading>\n <CustomScrollbar showScrollIndicators={true} autoHeightMax=\"100px\">\n <RawQuery\n aria-label={`${query.displayName} raw query`}\n query={query.body}\n lang={lang}\n className={styles.rawQuery}\n />\n </CustomScrollbar>\n <Card.Actions>\n <Button\n size=\"sm\"\n aria-label=\"use this query button\"\n onClick={() => {\n props.onChange({\n refId: 'A',\n queryType: AzureQueryType.LogAnalytics,\n azureLogAnalytics: { query: query.body },\n datasource: props.datasource,\n });\n reportInteraction('grafana_azure_cheatsheet_logs_query_selected', {\n id: query.id,\n queryName: query.displayName,\n query: query.body,\n queryCategories: query.related.categories,\n });\n }}\n >\n Use this query\n </Button>\n </Card.Actions>\n </Card>\n );\n })}\n </Collapse>\n );\n }\n return;\n })}\n </CustomScrollbar>\n </div>\n ) : (\n <LoadingPlaceholder text=\"Loading...\" />\n )}\n </div>\n );\n};\n\nexport default AzureCheatSheet;\n\nconst getStyles = (theme: GrafanaTheme2) => {\n return {\n card: css({\n width: '90%',\n display: 'flex',\n flexDirection: 'column',\n }),\n rawQuery: css({\n backgroundColor: `${theme.colors.background.primary}`,\n padding: `${theme.spacing(1)}`,\n marginTop: `${theme.spacing(1)}`,\n }),\n spacing: css({\n marginBottom: `${theme.spacing(1)}`,\n }),\n filterAlignment: css({\n display: 'flex',\n }),\n categoryDropdown: css({\n margin: '0 0 10px 10px',\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n }),\n };\n};\n","import React from 'react';\n\nimport { CoreApp } from '@grafana/data';\nimport { Modal } from '@grafana/ui';\n\nimport AzureLogAnalyticsDatasource from '../../azure_log_analytics/azure_log_analytics_datasource';\nimport { AzureMonitorQuery } from '../../dataquery.gen';\nimport AzureCheatSheet from '../AzureCheatSheet';\n\ntype Props = {\n isOpen: boolean;\n app?: CoreApp;\n onClose: () => void;\n onChange: (query: AzureMonitorQuery) => void;\n onAddQuery?: (query: AzureMonitorQuery) => void;\n datasource: AzureLogAnalyticsDatasource;\n};\n\nexport const AzureCheatSheetModal = (props: Props) => {\n const { isOpen, onClose, datasource, onChange } = props;\n\n return (\n <Modal aria-label=\"Kick start your query modal\" isOpen={isOpen} title=\"Kick start your query\" onDismiss={onClose}>\n <AzureCheatSheet\n onChange={(a) => {\n onChange(a);\n onClose();\n }}\n query={{ refId: 'A' }}\n datasource={datasource}\n ></AzureCheatSheet>\n </Modal>\n );\n};\n","/**\nThis list is obtained parsing https://docs.microsoft.com/en-us/azure/governance/resource-graph/reference/supported-tables-resources\nTo programatically get the list, execute in the browser console:\n \n const i = {};\n document.querySelectorAll('li').forEach((li) => { \n const m = li.textContent.match(/(.*\\..*\\/.*?)\\s\\((.*)\\)/);\n if (m) {\n i[m[1].toLowerCase()] = m[2];\n }\n });\n i;\n \nNote: Validate that the output makes sense, the format of the page may change.\n */\nexport const resourceTypeDisplayNames: { [k: string]: string } = {\n 'microsoft.recoveryservices/vaults/backupfabrics/protectioncontainers/protecteditems': 'Backup Items',\n 'microsoft.resources/subscriptions': 'Subscriptions',\n 'microsoft.resources/subscriptions/resourcegroups': 'Resource groups',\n 'citrix.services/xenappessentials': 'Citrix Virtual Apps Essentials',\n 'citrix.services/xendesktopessentials': 'Citrix Virtual Desktops Essentials',\n 'dynatrace.observability/monitors': 'Dynatrace',\n 'github.enterprise/accounts': 'GitHub AE',\n 'microsoft.aad/domainservices': 'Azure AD Domain Services',\n 'microsoft.aadiam/privatelinkforazuread': 'Private Link for Azure AD',\n 'microsoft.agfoodplatform/farmbeats': 'Azure FarmBeats',\n 'microsoft.analysisservices/servers': 'Analysis Services',\n 'microsoft.anybuild/clusters': 'AnyBuild clusters',\n 'microsoft.apimanagement/service': 'API Management services',\n 'microsoft.appconfiguration/configurationstores': 'App Configuration',\n 'microsoft.appplatform/spring': 'Azure Spring Cloud',\n 'microsoft.attestation/attestationproviders': 'Attestation providers',\n 'microsoft.authorization/resourcemanagementprivatelinks': 'Resource management private links',\n 'microsoft.automation/automationaccounts': 'Automation Accounts',\n 'microsoft.automation/automationaccounts/runbooks': 'Runbook',\n 'microsoft.autonomoussystems/workspaces': 'Bonsai',\n 'microsoft.avs/privateclouds': 'AVS Private clouds',\n 'microsoft.azureactivedirectory/b2cdirectories': 'B2C Tenants',\n 'microsoft.azureactivedirectory/guestusages': 'Guest Usages',\n 'microsoft.azurearcdata/datacontrollers': 'Azure Arc data controllers',\n 'microsoft.azurearcdata/postgresinstances': 'Azure Arc-enabled PostgreSQL Hyperscale server groups',\n 'microsoft.azurearcdata/sqlmanagedinstances': 'SQL managed instances - Azure Arc',\n 'microsoft.azurearcdata/sqlserverinstances': 'SQL Server - Azure Arc',\n 'microsoft.azuredata/sqlserverregistrations': 'SQL Server registries',\n 'microsoft.azurepercept/accounts': 'Azure Percept accounts',\n 'microsoft.azurestackhci/clusters': 'Azure Stack HCI',\n 'microsoft.azurestackhci/virtualmachines': 'Azure Stack HCI virtual machine - Azure Arc',\n 'microsoft.baremetal/crayservers': 'Cray Servers',\n 'microsoft.baremetal/monitoringservers': 'Monitoring Servers',\n 'microsoft.baremetalinfrastructure/baremetalinstances': 'BareMetal Instances',\n 'microsoft.batch/batchaccounts': 'Batch accounts',\n 'microsoft.bing/accounts': 'Bing Resources',\n 'microsoft.botservice/botservices': 'Bot Services',\n 'microsoft.cache/redis': 'Azure Cache for Redis',\n 'microsoft.cache/redisenterprise': 'Redis Enterprise',\n 'microsoft.cdn/cdnwebapplicationfirewallpolicies': 'Content Delivery Network WAF policies',\n 'microsoft.cdn/profiles (front doors standard/premium': 'Preview)',\n 'microsoft.cdn/profiles/afdendpoints': 'Endpoints',\n 'microsoft.cdn/profiles/endpoints': 'Endpoints',\n 'microsoft.certificateregistration/certificateorders': 'App Service Certificates',\n 'microsoft.chaos/chaosexperiments': 'Chaos Experiments (Classic)',\n 'microsoft.chaos/experiments': 'Chaos Experiments',\n 'microsoft.classiccompute/domainnames': 'Cloud services (classic)',\n 'microsoft.classiccompute/virtualmachines': 'Virtual machines (classic)',\n 'microsoft.classicnetwork/networksecuritygroups': 'Network security groups (classic)',\n 'microsoft.classicnetwork/reservedips': 'Reserved IP addresses (classic)',\n 'microsoft.classicnetwork/virtualnetworks': 'Virtual networks (classic)',\n 'microsoft.classicstorage/storageaccounts': 'Storage accounts (classic)',\n 'microsoft.cloudtest/accounts': 'CloudTest Accounts',\n 'microsoft.cloudtest/hostedpools': '1ES Hosted Pools',\n 'microsoft.cloudtest/images': 'CloudTest Images',\n 'microsoft.cloudtest/pools': 'CloudTest Pools',\n 'microsoft.clusterstor/nodes': 'ClusterStors',\n 'microsoft.cognitiveservices/accounts': 'Cognitive Services',\n 'microsoft.compute/availabilitysets': 'Availability sets',\n 'microsoft.compute/capacityreservationgroups': 'Capacity Reservation Groups',\n 'microsoft.compute/cloudservices': 'Cloud services (extended support)',\n 'microsoft.compute/diskaccesses': 'Disk Accesses',\n 'microsoft.compute/diskencryptionsets': 'Disk Encryption Sets',\n 'microsoft.compute/disks': 'Disks',\n 'microsoft.compute/galleries': 'Azure compute galleries',\n 'microsoft.compute/galleries/applications': 'VM application definitions',\n 'microsoft.compute/galleries/applications/versions': 'VM application versions',\n 'microsoft.compute/galleries/images': 'VM image definitions',\n 'microsoft.compute/galleries/images/versions': 'VM image versions',\n 'microsoft.compute/hostgroups': 'Host groups',\n 'microsoft.compute/hostgroups/hosts': 'Hosts',\n 'microsoft.compute/images': 'Images',\n 'microsoft.compute/proximityplacementgroups': 'Proximity placement groups',\n 'microsoft.compute/restorepointcollections': 'Restore Point Collections',\n 'microsoft.compute/snapshots': 'Snapshots',\n 'microsoft.compute/sshpublickeys': 'SSH keys',\n 'microsoft.compute/virtualmachines': 'Virtual machines',\n 'microsoft.compute/virtualmachinescalesets': 'Virtual machine scale sets',\n 'microsoft.confidentialledger/ledgers': 'Confidential Ledgers',\n 'microsoft.confluent/organizations': 'Confluent organizations',\n 'microsoft.connectedcache/cachenodes': 'Connected Cache Resources',\n 'microsoft.connectedcache/enterprisecustomers': 'Connected Cache Resources',\n 'microsoft.connectedvehicle/platformaccounts': 'Connected Vehicle Platforms',\n 'microsoft.connectedvmwarevsphere/vcenters': 'VMware vCenters',\n 'microsoft.connectedvmwarevsphere/virtualmachines': 'VMware + AVS virtual machines',\n 'microsoft.containerinstance/containergroups': 'Container instances',\n 'microsoft.containerregistry/registries': 'Container registries',\n 'microsoft.containerregistry/registries/replications': 'Container registry replications',\n 'microsoft.containerregistry/registries/webhooks': 'Container registry webhooks',\n 'microsoft.containerservice/managedclusters': 'Kubernetes services',\n 'microsoft.dashboard/grafana': 'Grafana Workspaces',\n 'microsoft.databox/jobs': 'Azure Data Box',\n 'microsoft.databoxedge/databoxedgedevices': 'Azure Stack Edge / Data Box Gateway',\n 'microsoft.databricks/workspaces': 'Azure Databricks Services',\n 'microsoft.datacatalog/catalogs': 'Data Catalog',\n 'microsoft.datacollaboration/workspaces': 'Project CI',\n 'microsoft.datadog/monitors': 'Datadog',\n 'microsoft.datafactory/datafactories': 'Data factories',\n 'microsoft.datafactory/factories': 'Data factories (V2)',\n 'microsoft.datalakeanalytics/accounts': 'Data Lake Analytics',\n 'microsoft.datalakestore/accounts': 'Data Lake Storage Gen1',\n 'microsoft.datamigration/services': 'Azure Database Migration Services',\n 'microsoft.datamigration/services/projects': 'Azure Database Migration Projects',\n 'microsoft.datamigration/sqlmigrationservices': 'Azure Database Migration Services',\n 'microsoft.dataprotection/backupvaults': 'Backup vaults',\n 'microsoft.dataprotection/resourceguards': 'Resource Guards (Preview)',\n 'microsoft.datareplication/replicationvaults': 'Site Recovery Vaults',\n 'microsoft.datashare/accounts': 'Data Shares',\n 'microsoft.dbformariadb/servers': 'Azure Database for MariaDB servers',\n 'microsoft.dbformysql/flexibleservers': 'Azure Database for MySQL flexible servers',\n 'microsoft.dbformysql/servers': 'Azure Database for MySQL servers',\n 'microsoft.dbforpostgresql/flexibleservers': 'Azure Database for PostgreSQL flexible servers',\n 'microsoft.dbforpostgresql/servergroups': 'Azure Database for PostgreSQL server groups',\n 'microsoft.dbforpostgresql/servergroupsv2': 'Azure Database for PostgreSQL server groups',\n 'microsoft.dbforpostgresql/servers': 'Azure Database for PostgreSQL servers',\n 'microsoft.dbforpostgresql/serversv2': 'Azure Database for PostgreSQL servers v2',\n 'microsoft.deploymentmanager/rollouts': 'Rollouts',\n 'microsoft.desktopvirtualization/applicationgroups': 'Application groups',\n 'microsoft.desktopvirtualization/hostpools': 'Host pools',\n 'microsoft.desktopvirtualization/scalingplans': 'Scaling plans',\n 'microsoft.desktopvirtualization/workspaces': 'Workspaces',\n 'microsoft.devices/iothubs': 'IoT Hub',\n 'microsoft.devices/provisioningservices': 'Device Provisioning Services',\n 'microsoft.deviceupdate/accounts': 'Device Update for IoT Hubs',\n 'microsoft.devops/pipelines': 'DevOps Starter',\n 'microsoft.devtestlab/labs': 'DevTest Labs',\n 'microsoft.devtestlab/labs/virtualmachines': 'Virtual machines',\n 'microsoft.digitaltwins/digitaltwinsinstances': 'Azure Digital Twins',\n 'microsoft.documentdb/cassandraclusters': 'Azure Managed Instance for Apache Cassandra',\n 'microsoft.documentdb/databaseaccounts': 'Azure Cosmos DB accounts',\n 'microsoft.domainregistration/domains': 'App Service Domains',\n 'microsoft.edgeorder/addresses': 'Azure Edge Hardware Center Address',\n 'microsoft.edgeorder/orderitems': 'Azure Edge Hardware Center',\n 'microsoft.elastic/monitors': 'Elasticsearch (Elastic Cloud)',\n 'microsoft.eventgrid/domains': 'Event Grid Domains',\n 'microsoft.eventgrid/partnernamespaces': 'Event Grid Partner Namespaces',\n 'microsoft.eventgrid/partnerregistrations': 'Event Grid Partner Registrations',\n 'microsoft.eventgrid/partnertopics': 'Event Grid Partner Topics',\n 'microsoft.eventgrid/systemtopics': 'Event Grid System Topics',\n 'microsoft.eventgrid/topics': 'Event Grid Topics',\n 'microsoft.eventhub/clusters': 'Event Hubs Clusters',\n 'microsoft.eventhub/namespaces': 'Event Hubs Namespaces',\n 'microsoft.experimentation/experimentworkspaces': 'Experiment Workspaces',\n 'microsoft.extendedlocation/customlocations': 'Custom locations',\n 'microsoft.fidalgo/devcenters': 'Fidalgo DevCenters',\n 'microsoft.fidalgo/networksettings': 'Network Configurations',\n 'microsoft.fidalgo/projects': 'Fidalgo Projects',\n 'microsoft.fidalgo/projects/environments': 'Fidalgo Environments',\n 'microsoft.fluidrelay/fluidrelayservers': 'Fluid Relay',\n 'microsoft.genomics/accounts': 'Genomics accounts',\n 'microsoft.hanaonazure/hanainstances': 'SAP HANA on Azure',\n 'microsoft.hanaonazure/sapmonitors': 'Azure Monitors for SAP Solutions',\n 'microsoft.hdinsight/clusterpools': 'HDInsight cluster pools',\n 'microsoft.hdinsight/clusterpools/clusters': 'HDInsight gen2 clusters',\n 'microsoft.hdinsight/clusterpools/clusters/sessionclusters': 'HDInsight session clusters',\n 'microsoft.hdinsight/clusters': 'HDInsight clusters',\n 'microsoft.healthbot/healthbots': 'Azure Health Bot',\n 'microsoft.healthcareapis/services': 'Azure API for FHIR',\n 'microsoft.healthcareapis/workspaces': 'Healthcare APIs Workspaces',\n 'microsoft.healthcareapis/workspaces/dicomservices': 'DICOM services',\n 'microsoft.healthcareapis/workspaces/fhirservices': 'FHIR services',\n 'microsoft.healthcareapis/workspaces/iotconnectors': 'IoT connectors',\n 'microsoft.hpcworkbench/instances': 'HPC Workbenches (preview)',\n 'microsoft.hpcworkbench/instances/chambers': 'Chambers (preview)',\n 'microsoft.hpcworkbench/instances/chambers/accessprofiles': 'Chamber Profiles (preview)',\n 'microsoft.hpcworkbench/instances/chambers/workloads': 'Chamber VMs (preview)',\n 'microsoft.hpcworkbench/instances/consortiums': 'Consortiums (preview)',\n 'microsoft.hybridcompute/machines': 'Servers - Azure Arc',\n 'microsoft.hybridcompute/privatelinkscopes': 'Azure Arc Private Link Scopes',\n 'microsoft.hybridcontainerservice/provisionedclusters': 'Provisioned clusters',\n 'microsoft.hybriddata/datamanagers': 'StorSimple Data Managers',\n 'microsoft.hybridnetwork/devices': 'Azure Network Function Manager – Devices',\n 'microsoft.hybridnetwork/networkfunctions': 'Azure Network Function Manager – Network Functions',\n 'microsoft.importexport/jobs': 'Import/export jobs',\n 'microsoft.insights/components': 'Application Insights',\n 'microsoft.insights/datacollectionendpoints': 'Data collection endpoints',\n 'microsoft.insights/datacollectionrules': 'Data collection rules',\n 'microsoft.insights/privatelinkscopes': 'Azure Monitor Private Link Scopes',\n 'microsoft.insights/webtests': 'Availability tests',\n 'microsoft.insights/workbooks': 'Azure Workbooks',\n 'microsoft.insights/workbooktemplates': 'Azure Workbook Templates',\n 'microsoft.iotcentral/iotapps': 'IoT Central Applications',\n 'microsoft.keyvault/vaults': 'Key vaults',\n 'microsoft.kubernetes/connectedclusters': 'Kubernetes - Azure Arc',\n 'microsoft.kusto/clusters': 'Azure Data Explorer Clusters',\n 'microsoft.kusto/clusters/databases': 'Azure Data Explorer Databases',\n 'microsoft.labservices/labaccounts': 'Lab accounts',\n 'microsoft.labservices/labplans': 'Lab plans',\n 'microsoft.labservices/labs': 'Labs',\n 'microsoft.loadtestservice/loadtests': 'Azure Load Testing',\n 'microsoft.logic/integrationaccounts': 'Integration accounts',\n 'microsoft.logic/integrationserviceenvironments': 'Integration Service Environments',\n 'microsoft.logic/integrationserviceenvironments/managedapis': 'Managed Connector',\n 'microsoft.logic/workflows': 'Logic apps',\n 'microsoft.logz/monitors': 'Logz main account',\n 'microsoft.logz/monitors/accounts': 'Logz sub account',\n 'microsoft.logz/monitors/metricssource': 'Logz metrics data source',\n 'microsoft.machinelearning/commitmentplans': 'Machine Learning Studio (classic) web service plans',\n 'microsoft.machinelearning/webservices': 'Machine Learning Studio (classic) web services',\n 'microsoft.machinelearning/workspaces': 'Machine Learning Studio (classic) workspaces',\n 'microsoft.machinelearningservices/workspaces': 'Machine learning',\n 'microsoft.machinelearningservices/workspaces/onlineendpoints': 'Machine learning online endpoints',\n 'microsoft.machinelearningservices/workspaces/onlineendpoints/deployments': 'Machine learning online deployments',\n 'microsoft.maintenance/maintenanceconfigurations': 'Maintenance Configurations',\n 'microsoft.managedidentity/userassignedidentities': 'Managed Identities',\n 'microsoft.maps/accounts': 'Azure Maps Accounts',\n 'microsoft.maps/accounts/creators': 'Azure Maps Creator Resources',\n 'microsoft.media/mediaservices': 'Media Services',\n 'microsoft.media/mediaservices/liveevents': 'Live events',\n 'microsoft.media/mediaservices/streamingendpoints': 'Streaming Endpoints',\n 'microsoft.media/videoanalyzers': 'Video Analyzers',\n 'microsoft.migrate/projects': 'Migration projects',\n 'microsoft.mixedreality/objectanchorsaccounts': 'Object Anchors Accounts',\n 'microsoft.mixedreality/objectunderstandingaccounts': 'Object Understanding Accounts',\n 'microsoft.mixedreality/remoterenderingaccounts': 'Remote Rendering Accounts',\n 'microsoft.mixedreality/spatialanchorsaccounts': 'Spatial Anchors Accounts',\n 'microsoft.mobilenetwork/mobilenetworks': 'Mobile Networks',\n 'microsoft.mobilenetwork/mobilenetworks/datanetworks': 'Data Networks',\n 'microsoft.mobilenetwork/mobilenetworks/services': 'Services',\n 'microsoft.mobilenetwork/mobilenetworks/simpolicies': 'Sim Policies',\n 'microsoft.mobilenetwork/mobilenetworks/sites': 'Mobile Network Sites',\n 'microsoft.mobilenetwork/mobilenetworks/slices': 'Slices',\n 'microsoft.mobilenetwork/packetcorecontrolplanes': 'Packet Core Control Planes',\n 'microsoft.mobilenetwork/packetcorecontrolplanes/packetcoredataplanes': 'Packet Core Data Planes',\n 'microsoft.mobilenetwork/packetcorecontrolplanes/packetcoredataplanes/attacheddatanetworks': 'Attached Data Networks',\n 'microsoft.mobilenetwork/sims': 'Sims',\n 'microsoft.netapp/netappaccounts': 'NetApp accounts',\n 'microsoft.netapp/netappaccounts/capacitypools': 'Capacity pools',\n 'microsoft.netapp/netappaccounts/capacitypools/volumes': 'Volumes',\n 'microsoft.netapp/netappaccounts/capacitypools/volumes/snapshots': 'Snapshots',\n 'microsoft.netapp/netappaccounts/snapshotpolicies': 'Snapshot policies',\n 'microsoft.network/applicationgateways': 'Application gateways',\n 'microsoft.network/applicationgatewaywebapplicationfirewallpolicies': 'Application Gateway WAF policies',\n 'microsoft.network/applicationsecuritygroups': 'Application security groups',\n 'microsoft.network/azurefirewalls': 'Firewalls',\n 'microsoft.network/bastionhosts': 'Bastions',\n 'microsoft.network/connections': 'Connections',\n 'microsoft.network/customipprefixes': 'Custom IP Prefixes',\n 'microsoft.network/ddosprotectionplans': 'DDoS protection plans',\n 'microsoft.network/dnsforwardingrulesets': 'Dns Forwarding Rulesets',\n 'microsoft.network/dnsresolvers': 'DNS Private Resolvers',\n 'microsoft.network/dnszones': 'DNS zones',\n 'microsoft.network/expressroutecircuits': 'ExpressRoute circuits',\n 'microsoft.network/expressrouteports': 'ExpressRoute Direct',\n 'microsoft.network/firewallpolicies': 'Firewall Policies',\n 'microsoft.network/frontdoors': 'Front Doors',\n 'microsoft.network/frontdoorwebapplicationfirewallpolicies': 'Web Application Firewall policies (WAF)',\n 'microsoft.network/ipgroups': 'IP Groups',\n 'microsoft.network/loadbalancers': 'Load balancers',\n 'microsoft.network/localnetworkgateways': 'Local network gateways',\n 'microsoft.network/natgateways': 'NAT gateways',\n 'microsoft.network/networkexperimentprofiles': 'Internet Analyzer profiles',\n 'microsoft.network/networkinterfaces': 'Network interfaces',\n 'microsoft.network/networkmanagers': 'Network Managers',\n 'microsoft.network/networksecuritygroups': 'Network security groups',\n 'microsoft.network/networkwatchers': 'Network Watchers',\n 'microsoft.network/networkwatchers/connectionmonitors': 'Connection Monitors',\n 'microsoft.network/networkwatchers/flowlogs': 'NSG Flow Logs',\n 'microsoft.network/privatednszones': 'Private DNS zones',\n 'microsoft.network/privateendpoints': 'Private endpoints',\n 'microsoft.network/privatelinkservices': 'Private link services',\n 'microsoft.network/publicipaddresses': 'Public IP addresses',\n 'microsoft.network/publicipprefixes': 'Public IP Prefixes',\n 'microsoft.network/routefilters': 'Route filters',\n 'microsoft.network/routetables': 'Route tables',\n 'microsoft.network/serviceendpointpolicies': 'Service endpoint policies',\n 'microsoft.network/trafficmanagerprofiles': 'Traffic Manager profiles',\n 'microsoft.network/virtualnetworkgateways': 'Virtual network gateways',\n 'microsoft.network/virtualnetworks': 'Virtual networks',\n 'microsoft.network/virtualwans': 'Virtual WANs',\n 'microsoft.notificationhubs/namespaces': 'Notification Hub Namespaces',\n 'microsoft.notificationhubs/namespaces/notificationhubs': 'Notification Hubs',\n 'microsoft.openenergyplatform/energyservices': 'Project Oak Forest',\n 'microsoft.openlogisticsplatform/workspaces': 'Open Supply Chain Platform',\n 'microsoft.operationalinsights/querypacks': 'Log Analytics query packs',\n 'microsoft.operationalinsights/workspaces': 'Log Analytics workspaces',\n 'microsoft.operationsmanagement/solutions': 'Solutions',\n 'microsoft.orbital/contactprofiles': 'Contact Profiles',\n 'microsoft.orbital/edgesites': 'Edge Sites',\n 'microsoft.orbital/groundstations': 'Ground Stations',\n 'microsoft.orbital/l2connections': 'L2 Connections',\n 'microsoft.orbital/spacecrafts': 'Spacecrafts',\n 'microsoft.peering/peerings': 'Peerings',\n 'microsoft.peering/peeringservices': 'Peering Services',\n 'microsoft.playfab/playeraccountpools': 'PlayFab player account pools',\n 'microsoft.playfab/titles': 'PlayFab titles',\n 'microsoft.portal/dashboards': 'Shared dashboards',\n 'microsoft.powerbidedicated/capacities': 'Power BI Embedded',\n 'microsoft.purview/accounts': 'Microsoft Purview accounts',\n 'microsoft.quantum/workspaces': 'Quantum Workspaces',\n 'microsoft.recommendationsservice/accounts': 'Intelligent Recommendations Accounts',\n 'microsoft.recommendationsservice/accounts/modeling': 'Modeling',\n 'microsoft.recommendationsservice/accounts/serviceendpoints': 'Service Endpoints',\n 'microsoft.recoveryservices/vaults': 'Recovery Services vaults',\n 'microsoft.redhatopenshift/openshiftclusters': 'Azure Red Hat OpenShift',\n 'microsoft.relay/namespaces': 'Relays',\n 'microsoft.resourceconnector/appliances': 'Resource bridges',\n 'microsoft.resourcegraph/queries': 'Resource Graph queries',\n 'microsoft.resources/deploymentscripts': 'Deployment Scripts',\n 'microsoft.resources/templatespecs': 'Template specs',\n 'microsoft.saas/applications': 'Software as a Service (classic)',\n 'microsoft.saas/resources': 'SaaS',\n 'microsoft.scom/managedinstances': 'Aquila Instances',\n 'microsoft.scvmm/virtualmachines': 'SCVMM virtual machine - Azure Arc',\n 'microsoft.scvmm/vmmservers': 'SCVMM management servers',\n 'microsoft.search/searchservices': 'Search services',\n 'microsoft.securitydetonation/chambers': 'Security Detonation Chambers',\n 'microsoft.servicebus/namespaces': 'Service Bus Namespaces',\n 'microsoft.servicefabric/clusters': 'Service Fabric clusters',\n 'microsoft.servicefabric/managedclusters': 'Service Fabric managed clusters',\n 'microsoft.serviceshub/connectors': 'Services Hub Connectors',\n 'microsoft.signalrservice/signalr': 'SignalR',\n 'microsoft.signalrservice/webpubsub': 'Web PubSub Service',\n 'microsoft.solutions/applicationdefinitions': 'Service catalog managed application definitions',\n 'microsoft.solutions/applications': 'Managed applications',\n 'microsoft.sql/instancepools': 'Instance pools',\n 'microsoft.sql/managedinstances': 'SQL managed instances',\n 'microsoft.sql/managedinstances/databases': 'Managed databases',\n 'microsoft.sql/servers': 'SQL servers',\n 'microsoft.sql/servers/databases': 'SQL databases',\n 'microsoft.sql/servers/elasticpools': 'SQL elastic pools',\n 'microsoft.sql/servers/jobagents': 'Elastic Job agents',\n 'microsoft.sql/virtualclusters': 'Virtual clusters',\n 'microsoft.sqlvirtualmachine/sqlvirtualmachines': 'SQL virtual machines',\n 'microsoft.storage/storageaccounts': 'Storage accounts',\n 'microsoft.storagecache/amlfilesystems': 'Lustre File Systems',\n 'microsoft.storagecache/caches': 'HPC caches',\n 'microsoft.storagepool/diskpools': 'Disk Pools',\n 'microsoft.storagesync/storagesyncservices': 'Storage Sync Services',\n 'microsoft.storagesyncdev/storagesyncservices': 'Storage Sync Services',\n 'microsoft.storagesyncint/storagesyncservices': 'Storage Sync Services',\n 'microsoft.storsimple/managers': 'StorSimple Device Managers',\n 'microsoft.streamanalytics/clusters': 'Stream Analytics clusters',\n 'microsoft.streamanalytics/streamingjobs': 'Stream Analytics jobs',\n 'microsoft.synapse/privatelinkhubs': 'Azure Synapse Analytics (private link hubs)',\n 'microsoft.synapse/workspaces': 'Azure Synapse Analytics',\n 'microsoft.synapse/workspaces/bigdatapools': 'Apache Spark pools',\n 'microsoft.synapse/workspaces/kustopools': 'Data Explorer pools (preview)',\n 'microsoft.synapse/workspaces/sqlpools': 'Dedicated SQL pools',\n 'microsoft.testbase/testbaseaccounts': 'Test Base Accounts',\n 'microsoft.testbase/testbaseaccounts/packages': 'Test Base Packages',\n 'microsoft.timeseriesinsights/environments': 'Time Series Insights environments',\n 'microsoft.timeseriesinsights/environments/eventsources': 'Time Series Insights event sources',\n 'microsoft.timeseriesinsights/environments/referencedatasets': 'Time Series Insights reference data sets',\n 'microsoft.videoindexer/accounts': 'Video Analyzer for Media',\n 'microsoft.virtualmachineimages/imagetemplates': 'Image Templates',\n 'microsoft.visualstudio/account': 'Azure DevOps organizations',\n 'microsoft.visualstudio/account/project': 'DevOps Starter',\n 'microsoft.vmwarecloudsimple/dedicatedcloudnodes': 'CloudSimple Nodes',\n 'microsoft.vmwarecloudsimple/dedicatedcloudservices': 'CloudSimple Services',\n 'microsoft.vmwarecloudsimple/virtualmachines': 'CloudSimple Virtual Machines',\n 'microsoft.vsonline/plans': 'Visual Studio Online Plans',\n 'microsoft.web/connectiongateways': 'On-premises data gateways',\n 'microsoft.web/connections': 'API Connections',\n 'microsoft.web/containerapps': 'Container Apps',\n 'microsoft.web/customapis': 'Logic Apps Custom Connector',\n 'microsoft.web/hostingenvironments': 'App Service Environments',\n 'microsoft.web/kubeenvironments': 'App Service Kubernetes Environments',\n 'microsoft.web/serverfarms': 'App Service plans',\n 'microsoft.web/sites': 'App Services',\n 'microsoft.web/sites/slots': 'App Service (Slots)',\n 'microsoft.web/staticsites': 'Static Web Apps',\n 'microsoft.windowsesu/multipleactivationkeys': 'Windows Multiple Activation Keys',\n 'microsoft.windowsiot/deviceservices': 'Windows 10 IoT Core Services',\n 'microsoft.workloads/monitors': 'Azure Monitors for SAP Solutions (v2)',\n 'microsoft.workloads/phpworkloads': 'Scalable WordPress on Linux',\n 'microsoft.workloads/sapvirtualinstances': 'SAP Virtual Instances',\n 'microsoft.workloads/sapvirtualinstances/applicationinstances': 'SAP app server instances',\n 'microsoft.workloads/sapvirtualinstances/centralinstances': 'SAP central server instances',\n 'microsoft.workloads/sapvirtualinstances/databaseinstances': 'SAP database server instances',\n 'nginx.nginxplus/nginxdeployments': 'NGINX Deployment',\n 'providers.test/statefulibizaengines': 'VLCentral Help',\n 'wandisco.fusion/fusiongroups': 'LiveData Planes',\n 'wandisco.fusion/fusiongroups/azurezones': 'Azure Zones',\n 'wandisco.fusion/fusiongroups/azurezones/plugins': 'Plugins',\n 'wandisco.fusion/fusiongroups/hivereplicationrules': 'Hive Replication Rules',\n 'wandisco.fusion/fusiongroups/managedonpremzones': 'On-premises Zones',\n 'wandisco.fusion/fusiongroups/replicationrules': 'Replication Rules',\n 'wandisco.fusion/migrators': 'LiveData Migrators',\n 'wandisco.fusion/migrators/exclusiontemplates': 'Exclusions',\n 'wandisco.fusion/migrators/livedatamigrations': 'Migrations',\n 'wandisco.fusion/migrators/metadatamigrations': 'Metadata Migrations',\n 'wandisco.fusion/migrators/metadatatargets': 'Metadata Targets',\n 'wandisco.fusion/migrators/pathmappings': 'Path Mappings',\n 'wandisco.fusion/migrators/targets': 'Targets',\n 'microsoft.security/insights/classification': 'Data Sensitivity Security Insights (Preview)',\n 'microsoft.security/locations/alerts': 'Security Alerts',\n};\n\n// This list has been manually written using the Azure Portal as the source.\n// Visit https://portal.azure.com/#view/Microsoft_Azure_Monitoring/AzureMonitoringBrowseBlade/~/metrics\n// and go to Select a scope > Resource types > Multi-resource compatible (preview)\nexport const multiResourceCompatibleTypes: { [ns: string]: boolean } = {\n 'microsoft.cache/redis': true, // 'Azure Cache for Redis'\n 'microsoft.dbforpostgresql/flexibleservers': true, // 'Azure Database for PostgreSQL flexible servers'\n 'microsoft.storagecache/amlfilesystems': true, // 'Lustre File Systems'\n 'microsoft.databoxedge/databoxedgedevices': true, // 'Azure Stack Edge / Data Box Gateway'\n 'microsoft.dataprotection/backupvaults': true, // 'Backup vaults'\n 'microsoft.netapp/netappaccounts/capacitypools': true, // 'Capacity pools'\n 'microsoft.network/networkwatchers/connectionmonitors': true, // 'Connection Monitors'\n 'microsoft.keyvault/vaults': true, // 'Key vaults'\n 'microsoft.recoveryservices/vaults': true, // 'Recovery Services vaults'\n 'microsoft.sql/servers/databases': true, // 'SQL databases'\n 'microsoft.sql/servers/elasticpools': true, // 'SQL elastic pools'\n 'microsoft.compute/virtualmachinescalesets': true, // 'Virtual machine scale sets'\n 'microsoft.compute/virtualmachines': true, // 'Virtual machines'\n 'microsoft.signalrservice/webpubsub': true, // 'Web PubSub Service'\n};\n\nexport const resourceTypes = [\n 'microsoft.aad/domainservices',\n 'microsoft.aadiam/azureadmetrics',\n 'microsoft.analysisservices/servers',\n 'microsoft.apimanagement/service',\n 'microsoft.app/containerapps',\n 'microsoft.app/managedenvironments',\n 'microsoft.appconfiguration/configurationstores',\n 'microsoft.appplatform/spring',\n 'microsoft.automation/automationaccounts',\n 'microsoft.avs/privateclouds',\n 'microsoft.azuresphere/catalogs',\n 'microsoft.azurestackhci/clusters',\n 'microsoft.azurestackresourcemonitor/storageaccountmonitor',\n 'microsoft.batch/batchaccounts',\n 'microsoft.batchai/workspaces',\n 'microsoft.bing/accounts',\n 'microsoft.botservice/botservices',\n 'microsoft.botservice/botservices/channels',\n 'microsoft.botservice/botservices/connections',\n 'microsoft.botservice/checknameavailability',\n 'microsoft.botservice/hostsettings',\n 'microsoft.botservice/listauthserviceproviders',\n 'microsoft.botservice/listqnamakerendpointkeys',\n 'microsoft.cache/redis',\n 'microsoft.cache/redisenterprise',\n 'microsoft.cdn/cdnwebapplicationfirewallpolicies',\n 'microsoft.cdn/profiles',\n 'microsoft.classiccompute/domainnames',\n 'microsoft.classiccompute/domainnames/slots/roles',\n 'microsoft.classiccompute/virtualmachines',\n 'microsoft.classicstorage/storageaccounts',\n 'microsoft.classicstorage/storageaccounts/blobservices',\n 'microsoft.classicstorage/storageaccounts/fileservices',\n 'microsoft.classicstorage/storageaccounts/queueservices',\n 'microsoft.classicstorage/storageaccounts/tableservices',\n 'microsoft.cloudtest/hostedpools',\n 'microsoft.cloudtest/pools',\n 'microsoft.clusterstor/nodes',\n 'microsoft.codesigning/codesigningaccounts',\n 'microsoft.cognitiveservices/accounts',\n 'microsoft.communication/communicationservices',\n 'microsoft.compute/cloudservices',\n 'microsoft.compute/cloudservices/roles',\n 'microsoft.compute/disks',\n 'microsoft.compute/virtualmachines',\n 'microsoft.compute/virtualmachinescalesets',\n 'microsoft.compute/virtualmachinescalesets/virtualmachines',\n 'microsoft.connectedcache/cachenodes',\n 'microsoft.connectedcache/enterprisemcccustomers',\n 'microsoft.connectedcache/ispcustomers',\n 'microsoft.connectedvehicle/platformaccounts',\n 'microsoft.containerinstance/containergroups',\n 'microsoft.containerinstance/containerscalesets',\n 'microsoft.containerregistry/registries',\n 'microsoft.containerservice/managedclusters',\n 'microsoft.customerinsights/hubs',\n 'microsoft.customproviders/resourceproviders',\n 'microsoft.dashboard/grafana',\n 'microsoft.databoxedge/databoxedgedevices',\n 'microsoft.datacollaboration/workspaces',\n 'microsoft.datafactory/datafactories',\n 'microsoft.datafactory/factories',\n 'microsoft.datalakeanalytics/accounts',\n 'microsoft.datalakestore/accounts',\n 'microsoft.dataprotection/backupvaults',\n 'microsoft.datashare/accounts',\n 'microsoft.dbformariadb/servers',\n 'microsoft.dbformysql/flexibleservers',\n 'microsoft.dbformysql/servers',\n 'microsoft.dbforpostgresql/flexibleservers',\n 'microsoft.dbforpostgresql/servergroupsv2',\n 'microsoft.dbforpostgresql/servers',\n 'microsoft.dbforpostgresql/serversv2',\n 'microsoft.devices/iothubs',\n 'microsoft.devices/provisioningservices',\n 'microsoft.digitaltwins/digitaltwinsinstances',\n 'microsoft.documentdb/cassandraclusters',\n 'microsoft.documentdb/databaseaccounts',\n 'microsoft.documentdb/mongoclusters',\n 'microsoft.edgezones/edgezones',\n 'microsoft.enterpriseknowledgegraph/services',\n 'microsoft.eventgrid/domains',\n 'microsoft.eventgrid/eventsubscriptions',\n 'microsoft.eventgrid/extensiontopics',\n 'microsoft.eventgrid/namespaces',\n 'microsoft.eventgrid/partnernamespaces',\n 'microsoft.eventgrid/partnertopics',\n 'microsoft.eventgrid/systemtopics',\n 'microsoft.eventgrid/topics',\n 'microsoft.eventhub/clusters',\n 'microsoft.eventhub/namespaces',\n 'microsoft.fabric.admin/fabriclocations',\n 'microsoft.hdinsight/clusters',\n 'microsoft.healthcareapis/services',\n 'microsoft.healthcareapis/workspaces/dicomservices',\n 'microsoft.healthcareapis/workspaces/fhirservices',\n 'microsoft.healthcareapis/workspaces/iotconnectors',\n 'microsoft.healthmodel/healthmodels',\n 'microsoft.hybridcontainerservice/provisionedclusters',\n 'microsoft.hybridnetwork/networkfunctions',\n 'microsoft.hybridnetwork/virtualnetworkfunctions',\n 'microsoft.insights/autoscalesettings',\n 'microsoft.insights/components',\n 'microsoft.iotcentral/iotapps',\n 'microsoft.iotspaces/graph',\n 'microsoft.keyvault/managedhsms',\n 'microsoft.keyvault/vaults',\n 'microsoft.kubernetes/connectedclusters',\n 'microsoft.kubernetesconfiguration/extensions',\n 'microsoft.kusto/clusters',\n 'microsoft.logic/integrationserviceenvironments',\n 'microsoft.logic/workflows',\n 'microsoft.machinelearningservices/workspaces',\n 'microsoft.machinelearningservices/workspaces/onlineendpoints',\n 'microsoft.machinelearningservices/workspaces/onlineendpoints/deployments',\n 'microsoft.managednetworkfabric/internetgateways',\n 'microsoft.managednetworkfabric/l3isolationdomains',\n 'microsoft.managednetworkfabric/networkdevices',\n 'microsoft.maps/accounts',\n 'microsoft.media/mediaservices',\n 'microsoft.media/mediaservices/liveevents',\n 'microsoft.media/mediaservices/streamingendpoints',\n 'microsoft.media/videoanalyzers',\n 'microsoft.mixedreality/remoterenderingaccounts',\n 'microsoft.mixedreality/spatialanchorsaccounts',\n 'microsoft.mobilenetwork/packetcorecontrolplanes',\n 'microsoft.mobilenetwork/packetcorecontrolplanes/packetcoredataplanes',\n 'microsoft.monitor/accounts',\n 'microsoft.netapp/netappaccounts/capacitypools',\n 'microsoft.netapp/netappaccounts/capacitypools/volumes',\n 'microsoft.network/applicationgateways',\n 'microsoft.network/azurefirewalls',\n 'microsoft.network/bastionhosts',\n 'microsoft.network/connections',\n 'microsoft.network/dnsforwardingrulesets',\n 'microsoft.network/dnsresolvers',\n 'microsoft.network/dnszones',\n 'microsoft.network/expressroutecircuits',\n 'microsoft.network/expressroutecircuits/peerings',\n 'microsoft.network/expressroutegateways',\n 'microsoft.network/expressrouteports',\n 'microsoft.network/frontdoors',\n 'microsoft.network/loadbalancers',\n 'microsoft.network/natgateways',\n 'microsoft.network/networkinterfaces',\n 'microsoft.network/networkmanagers/ipampools',\n 'microsoft.network/networkvirtualappliances',\n 'microsoft.network/networkwatchers',\n 'microsoft.network/networkwatchers/connectionmonitors',\n 'microsoft.network/p2svpngateways',\n 'microsoft.network/privatednszones',\n 'microsoft.network/privateendpoints',\n 'microsoft.network/privatelinkservices',\n 'microsoft.network/publicipaddresses',\n 'microsoft.network/publicipprefixes',\n 'microsoft.network/trafficmanagerprofiles',\n 'microsoft.network/virtualhubs',\n 'microsoft.network/virtualnetworkgateways',\n 'microsoft.network/virtualnetworks',\n 'microsoft.network/virtualrouters',\n 'microsoft.network/vpngateways',\n 'microsoft.networkanalytics/dataconnectors',\n 'microsoft.networkcloud/baremetalmachines',\n 'microsoft.networkcloud/clusters',\n 'microsoft.networkcloud/storageappliances',\n 'microsoft.networkfunction/azuretrafficcollectors',\n 'microsoft.notificationhubs/namespaces/notificationhubs',\n 'microsoft.operationalinsights/workspaces',\n 'microsoft.operationsmanagement/solutions',\n 'microsoft.orbital/contactprofiles',\n 'microsoft.orbital/l2connections',\n 'microsoft.orbital/spacecrafts',\n 'microsoft.orbital/terminals',\n 'microsoft.peering/peerings',\n 'microsoft.peering/peeringservices',\n 'microsoft.playfab/titles',\n 'microsoft.powerbidedicated/capacities',\n 'microsoft.purview/accounts',\n 'microsoft.recoveryservices/vaults',\n 'microsoft.relay/namespaces',\n 'microsoft.resources/subscriptions',\n 'microsoft.search/searchservices',\n 'microsoft.securitydetonation/chambers',\n 'microsoft.securitydetonation/securitydetonationchambers',\n 'microsoft.servicebus/namespaces',\n 'microsoft.servicefabricmesh/applications',\n 'microsoft.servicenetworking/trafficcontrollers',\n 'microsoft.signalrservice/signalr',\n 'microsoft.signalrservice/signalr/replicas',\n 'microsoft.signalrservice/webpubsub',\n 'microsoft.signalrservice/webpubsub/replicas',\n 'microsoft.singularity/accounts',\n 'microsoft.sql/managedinstances',\n 'microsoft.sql/servers/databases',\n 'microsoft.sql/servers/elasticpools',\n 'microsoft.sql/servers/jobagents',\n 'microsoft.storage/storageaccounts',\n 'microsoft.storage/storageaccounts/blobservices',\n 'microsoft.storage/storageaccounts/fileservices',\n 'microsoft.storage/storageaccounts/objectreplicationpolicies',\n 'microsoft.storage/storageaccounts/queueservices',\n 'microsoft.storage/storageaccounts/storagetasks',\n 'microsoft.storage/storageaccounts/tableservices',\n 'microsoft.storage/storagetasks',\n 'microsoft.storagecache/amlfilesystems',\n 'microsoft.storagecache/caches',\n 'microsoft.storagemover/storagemovers',\n 'microsoft.storagesync/storagesyncservices',\n 'microsoft.storagetasks/storagetasks',\n 'microsoft.streamanalytics/streamingjobs',\n 'microsoft.synapse/workspaces',\n 'microsoft.synapse/workspaces/bigdatapools',\n 'microsoft.synapse/workspaces/kustopools',\n 'microsoft.synapse/workspaces/scopepools',\n 'microsoft.synapse/workspaces/sqlpools',\n 'microsoft.timeseriesinsights/environments',\n 'microsoft.timeseriesinsights/environments/eventsources',\n 'microsoft.vmwarecloudsimple/virtualmachines',\n 'microsoft.voiceservices/communicationsgateways',\n 'microsoft.web/containerapps',\n 'microsoft.web/hostingenvironments',\n 'microsoft.web/hostingenvironments/multirolepools',\n 'microsoft.web/hostingenvironments/workerpools',\n 'microsoft.web/serverfarms',\n 'microsoft.web/sites',\n 'microsoft.web/sites/slots',\n 'microsoft.web/staticsites',\n 'nginx.nginxplus/nginxdeployments',\n 'wandisco.fusion/migrators',\n 'wandisco.fusion/migrators/datatransferagents',\n 'wandisco.fusion/migrators/livedatamigrations',\n 'wandisco.fusion/migrators/metadatamigrations',\n];\n","/**\nThis list is obtained parsing https://docs.microsoft.com/en-us/azure/azure-monitor/essentials/resource-logs-categories\nTo programatically get the list, execute in the browser console:\n \n const i = [];\n document.querySelectorAll('*[id]').forEach((el) => { \n if(el.textContent.match(/^(microsoft|Microsoft|Wandisco)/)) {\n i.push(el.textContent.toLowerCase())\n }});\n i;\n \nNote: Validate that the output makes sense, the format of the page may change.\n \nThat list is not complete so we should merge it with the one below. You can do with a node console:\n \n const u = require('lodash')\n const new = [list from above]\n const logsResourceTypes = [this list]\n console.dir(u.uniq(logsResourceTypes.concat(new)).sort(), {'maxArrayLength': null})\n \n */\n\nexport const logsResourceTypes = [\n 'microsoft.aad/domainservices',\n 'microsoft.aadiam/azureadmetrics',\n 'microsoft.aadiam/tenants',\n 'microsoft.agfoodplatform/farmbeats',\n 'microsoft.analysisservices/servers',\n 'microsoft.apimanagement/service',\n 'microsoft.appconfiguration/configurationstores',\n 'microsoft.appplatform/spring',\n 'microsoft.attestation/attestationproviders',\n 'microsoft.automation/automationaccounts',\n 'microsoft.autonomousdevelopmentplatform/accounts',\n 'microsoft.autonomousdevelopmentplatform/datapools',\n 'microsoft.autonomousdevelopmentplatform/workspaces',\n 'microsoft.avs/privateclouds',\n 'microsoft.azurestackresourcemonitor/storageaccountmonitor',\n 'microsoft.batch/batchaccounts',\n 'microsoft.batchai/workspaces',\n 'microsoft.blockchain/blockchainmembers',\n 'microsoft.blockchain/cordamembers',\n 'microsoft.botservice/botservices',\n 'microsoft.cache/redis',\n 'microsoft.cache/redisenterprise',\n 'microsoft.cdn/cdnwebapplicationfirewallpolicies',\n 'microsoft.cdn/profiles',\n 'microsoft.cdn/profiles/endpoints',\n 'microsoft.classiccompute/domainnames',\n 'microsoft.classiccompute/virtualmachines',\n 'microsoft.classicnetwork/networksecuritygroups',\n 'microsoft.classicstorage/storageaccounts',\n 'microsoft.cognitiveservices/accounts',\n 'microsoft.communication/communicationservices',\n 'microsoft.compute/disks',\n 'microsoft.compute/virtualmachines',\n 'microsoft.compute/virtualmachinescalesets',\n 'microsoft.connectedcache/cachenodes',\n 'microsoft.connectedvehicle/platformaccounts',\n 'microsoft.containerinstance/containergroups',\n 'microsoft.containerregistry/registries',\n 'microsoft.containerservice/managedclusters',\n 'microsoft.customerinsights/hubs',\n 'microsoft.customproviders/resourceproviders',\n 'microsoft.d365customerinsights/instances',\n 'microsoft.dashboard/grafana',\n 'microsoft.databoxedge/databoxedgedevices',\n 'microsoft.databricks/workspaces',\n 'microsoft.datacollaboration/workspaces',\n 'microsoft.datafactory/datafactories',\n 'microsoft.datafactory/factories',\n 'microsoft.datalakeanalytics/accounts',\n 'microsoft.datalakestore/accounts',\n 'microsoft.datashare/accounts',\n 'microsoft.dbformariadb/servers',\n 'microsoft.dbformysql/flexibleservers',\n 'microsoft.dbformysql/servers',\n 'microsoft.dbforpostgresql/flexibleservers',\n 'microsoft.dbforpostgresql/servergroupsv2',\n 'microsoft.dbforpostgresql/servers',\n 'microsoft.dbforpostgresql/serversv2',\n 'microsoft.desktopvirtualization/applicationgroups',\n 'microsoft.desktopvirtualization/hostpools',\n 'microsoft.desktopvirtualization/scalingplans',\n 'microsoft.desktopvirtualization/workspaces',\n 'microsoft.devices/elasticpools/iothubtenants',\n 'microsoft.devices/iothubs',\n 'microsoft.devices/provisioningservices',\n 'microsoft.digitaltwins/digitaltwinsinstances',\n 'microsoft.documentdb/cassandraclusters',\n 'microsoft.documentdb/databaseaccounts',\n 'microsoft.eventgrid/domains',\n 'microsoft.eventgrid/partnernamespaces',\n 'microsoft.eventgrid/partnertopics',\n 'microsoft.eventgrid/systemtopics',\n 'microsoft.eventgrid/topics',\n 'microsoft.eventhub/clusters',\n 'microsoft.eventhub/namespaces',\n 'microsoft.experimentation/experimentworkspaces',\n 'microsoft.fabric.admin/fabriclocations',\n 'microsoft.hdinsight/clusters',\n 'microsoft.healthcareapis/services',\n 'microsoft.healthcareapis/workspaces/dicomservices',\n 'microsoft.healthcareapis/workspaces/fhirservices',\n 'microsoft.insights/autoscalesettings',\n 'microsoft.insights/components',\n 'microsoft.insights/qos',\n 'microsoft.iotcentral/iotapps',\n 'microsoft.keyvault/managedhsms',\n 'microsoft.keyvault/vaults',\n 'microsoft.kubernetes/connectedclusters',\n 'microsoft.kusto/clusters',\n 'microsoft.loadtestservice/loadtests',\n 'microsoft.logic/integrationaccounts',\n 'microsoft.logic/integrationserviceenvironments',\n 'microsoft.logic/workflows',\n 'microsoft.machinelearningservices/workspaces',\n 'microsoft.media/mediaservices',\n 'microsoft.media/mediaservices/liveevents',\n 'microsoft.media/mediaservices/streamingendpoints',\n 'microsoft.media/videoanalyzers',\n 'microsoft.netapp/netappaccounts/capacitypools',\n 'microsoft.netapp/netappaccounts/capacitypools/volumes',\n 'microsoft.network/applicationgateways',\n 'microsoft.network/azurefirewalls',\n 'microsoft.network/bastionhosts',\n 'microsoft.network/connections',\n 'microsoft.network/dnszones',\n 'microsoft.network/expressroutecircuits',\n 'microsoft.network/expressroutegateways',\n 'microsoft.network/expressrouteports',\n 'microsoft.network/frontdoors',\n 'microsoft.network/loadbalancers',\n 'microsoft.network/natgateways',\n 'microsoft.network/networkinterfaces',\n 'microsoft.network/networksecuritygroups',\n 'microsoft.network/networksecurityperimeters',\n 'microsoft.network/networkvirtualappliances',\n 'microsoft.network/networkwatchers',\n 'microsoft.network/networkwatchers/connectionmonitors',\n 'microsoft.network/p2svpngateways',\n 'microsoft.network/privateendpoints',\n 'microsoft.network/privatelinkservices',\n 'microsoft.network/publicipaddresses',\n 'microsoft.network/trafficmanagerprofiles',\n 'microsoft.network/virtualnetworkgateways',\n 'microsoft.network/virtualnetworks',\n 'microsoft.network/vpngateways',\n 'microsoft.networkfunction/azuretrafficcollectors',\n 'microsoft.notificationhubs/namespaces',\n 'microsoft.notificationhubs/namespaces/notificationhubs',\n 'microsoft.openlogisticsplatform/workspaces',\n 'microsoft.operationalinsights/workspaces',\n 'microsoft.operationsmanagement/solutions',\n 'microsoft.peering/peeringservices',\n 'microsoft.powerbi/tenants',\n 'microsoft.powerbi/tenants/workspaces',\n 'microsoft.powerbidedicated/capacities',\n 'microsoft.purview/accounts',\n 'microsoft.recoveryservices/vaults',\n 'microsoft.relay/namespaces',\n 'microsoft.resources/subscriptions',\n 'microsoft.resources/subscriptions/resourcegroups',\n 'microsoft.search/searchservices',\n 'microsoft.security/antimalwaresettings',\n 'microsoft.securityinsights/settings',\n 'microsoft.servicebus/namespaces',\n 'microsoft.signalrservice/signalr',\n 'microsoft.signalrservice/webpubsub',\n 'microsoft.singularity/accounts',\n 'microsoft.sql/managedinstances',\n 'microsoft.sql/managedinstances/databases',\n 'microsoft.sql/servers/databases',\n 'microsoft.sql/servers/elasticpools',\n 'microsoft.storage/storageaccounts',\n 'microsoft.storage/storageaccounts/blobservices',\n 'microsoft.storage/storageaccounts/fileservices',\n 'microsoft.storage/storageaccounts/queueservices',\n 'microsoft.storage/storageaccounts/tableservices',\n 'microsoft.storagecache/caches',\n 'microsoft.storagesync/storagesyncservices',\n 'microsoft.streamanalytics/streamingjobs',\n 'microsoft.synapse/workspaces',\n 'microsoft.synapse/workspaces/bigdatapools',\n 'microsoft.synapse/workspaces/kustopools',\n 'microsoft.synapse/workspaces/scopepools',\n 'microsoft.synapse/workspaces/sqlpools',\n 'microsoft.timeseriesinsights/environments',\n 'microsoft.timeseriesinsights/environments/eventsources',\n 'microsoft.videoindexer/accounts',\n 'microsoft.vmwarecloudsimple/virtualmachines',\n 'microsoft.web/hostingenvironments',\n 'microsoft.web/hostingenvironments/workerpools',\n 'microsoft.web/serverfarms',\n 'microsoft.web/sites',\n 'microsoft.web/sites/slots',\n];\n","import { css } from '@emotion/css';\nimport React, { useEffect } from 'react';\n\nimport { GrafanaTheme2 } from '@grafana/data';\nimport { AccessoryButton } from '@grafana/experimental';\nimport { Input, Label, InlineField, Button, useStyles2 } from '@grafana/ui';\n\nimport { selectors } from '../../e2e/selectors';\nimport { AzureMonitorResource } from '../../types';\n\nexport interface ResourcePickerProps<T> {\n resources: T[];\n onChange: (resources: T[]) => void;\n}\n\nconst getStyles = (theme: GrafanaTheme2) => ({\n resourceList: css({ display: 'flex', columnGap: theme.spacing(1), flexWrap: 'wrap', marginBottom: theme.spacing(1) }),\n resource: css({ flex: '0 0 auto' }),\n resourceLabel: css({ padding: theme.spacing(1) }),\n resourceGroupAndName: css({ display: 'flex', columnGap: theme.spacing(0.5) }),\n});\n\nconst AdvancedResourcePicker = ({ resources, onChange }: ResourcePickerProps<AzureMonitorResource>) => {\n const styles = useStyles2(getStyles);\n\n useEffect(() => {\n // Ensure there is at least one resource\n if (resources.length === 0) {\n onChange([{}]);\n }\n }, [resources, onChange]);\n\n const onResourceChange = (index: number, resource: AzureMonitorResource) => {\n const newResources = [...resources];\n newResources[index] = resource;\n onChange(newResources);\n };\n\n const removeResource = (index: number) => {\n const newResources = [...resources];\n newResources.splice(index, 1);\n onChange(newResources);\n };\n\n const addResource = () => {\n onChange(\n resources.concat({\n subscription: resources[0]?.subscription,\n metricNamespace: resources[0]?.metricNamespace,\n resourceGroup: '',\n resourceName: '',\n })\n );\n };\n\n const onCommonPropChange = (r: Partial<AzureMonitorResource>) => {\n onChange(resources.map((resource) => ({ ...resource, ...r })));\n };\n\n return (\n <>\n <InlineField\n label=\"Subscription\"\n grow\n transparent\n htmlFor={`input-advanced-resource-picker-subscription`}\n labelWidth={15}\n data-testid={selectors.components.queryEditor.resourcePicker.advanced.subscription.input}\n >\n <Input\n id={`input-advanced-resource-picker-subscription`}\n value={resources[0]?.subscription ?? ''}\n onChange={(event) => onCommonPropChange({ subscription: event.currentTarget.value })}\n placeholder=\"aaaaaaaa-bbbb-cccc-dddd-eeeeeeee\"\n />\n </InlineField>\n <InlineField\n label=\"Namespace\"\n grow\n transparent\n htmlFor={`input-advanced-resource-picker-metricNamespace`}\n labelWidth={15}\n data-testid={selectors.components.queryEditor.resourcePicker.advanced.namespace.input}\n invalid={resources[0]?.metricNamespace?.endsWith('/')}\n error={'Namespace cannot end with a \"/\"'}\n >\n <Input\n id={`input-advanced-resource-picker-metricNamespace`}\n value={resources[0]?.metricNamespace ?? ''}\n onChange={(event) => onCommonPropChange({ metricNamespace: event.currentTarget.value })}\n placeholder=\"Microsoft.Insights/metricNamespaces\"\n />\n </InlineField>\n <InlineField\n label=\"Region\"\n grow\n transparent\n htmlFor={`input-advanced-resource-picker-region`}\n labelWidth={15}\n data-testid={selectors.components.queryEditor.resourcePicker.advanced.region.input}\n tooltip=\"The code region of the resource. Optional for one resource but mandatory when selecting multiple ones.\"\n >\n <Input\n id={`input-advanced-resource-picker-region`}\n value={resources[0]?.region ?? ''}\n onChange={(event) => onCommonPropChange({ region: event.currentTarget.value })}\n placeholder=\"northeurope\"\n />\n </InlineField>\n <div className={styles.resourceList}>\n {resources.map((resource, index) => (\n <div key={`resource-${index + 1}`} className={styles.resource}>\n {resources.length !== 1 && <Label className={styles.resourceLabel}>Resource {index + 1}</Label>}\n <InlineField\n label=\"Resource Group\"\n transparent\n htmlFor={`input-advanced-resource-picker-resourceGroup-${index + 1}`}\n labelWidth={15}\n data-testid={selectors.components.queryEditor.resourcePicker.advanced.resourceGroup.input}\n >\n <div className={styles.resourceGroupAndName}>\n <Input\n id={`input-advanced-resource-picker-resourceGroup-${index + 1}`}\n value={resource?.resourceGroup ?? ''}\n onChange={(event) =>\n onResourceChange(index, { ...resource, resourceGroup: event.currentTarget.value })\n }\n placeholder=\"resource-group\"\n />\n <AccessoryButton\n aria-label=\"remove\"\n icon=\"times\"\n variant=\"secondary\"\n onClick={() => removeResource(index)}\n hidden={resources.length === 1}\n data-testid={'remove-resource'}\n />\n </div>\n </InlineField>\n\n <InlineField\n label=\"Resource Name\"\n transparent\n htmlFor={`input-advanced-resource-picker-resourceName-${index + 1}`}\n labelWidth={15}\n data-testid={selectors.components.queryEditor.resourcePicker.advanced.resource.input}\n >\n <Input\n id={`input-advanced-resource-picker-resourceName-${index + 1}`}\n value={resource?.resourceName ?? ''}\n onChange={(event) => onResourceChange(index, { ...resource, resourceName: event.currentTarget.value })}\n placeholder=\"name\"\n />\n </InlineField>\n </div>\n ))}\n </div>\n <Button aria-label=\"Add\" icon=\"plus\" variant=\"secondary\" onClick={addResource} type=\"button\">\n Add resource\n </Button>\n </>\n );\n};\n\nexport default AdvancedResourcePicker;\n","import { AzureMetricDimension, AzureMonitorQuery } from '../../types';\n\nexport function setCustomNamespace(query: AzureMonitorQuery, selection: string | undefined): AzureMonitorQuery {\n if (query.azureMonitor?.customNamespace === selection) {\n return query;\n }\n\n if (selection?.toLowerCase().startsWith('microsoft.storage/storageaccounts/')) {\n return {\n ...query,\n azureMonitor: {\n ...query.azureMonitor,\n metricNamespace: selection,\n metricName: undefined,\n aggregation: undefined,\n timeGrain: '',\n dimensionFilters: [],\n },\n };\n }\n\n return {\n ...query,\n azureMonitor: {\n ...query.azureMonitor,\n customNamespace: selection,\n metricName: undefined,\n aggregation: undefined,\n timeGrain: '',\n dimensionFilters: [],\n },\n };\n}\n\nexport function setMetricName(query: AzureMonitorQuery, metricName: string | undefined): AzureMonitorQuery {\n if (query.azureMonitor?.metricName === metricName) {\n return query;\n }\n\n return {\n ...query,\n azureMonitor: {\n ...query.azureMonitor,\n metricName: metricName,\n aggregation: undefined,\n timeGrain: '',\n dimensionFilters: [],\n },\n };\n}\n\nexport function setAggregation(query: AzureMonitorQuery, aggregation: string): AzureMonitorQuery {\n if (query.azureMonitor?.aggregation === aggregation) {\n return query;\n }\n\n return {\n ...query,\n azureMonitor: {\n ...query.azureMonitor,\n aggregation: aggregation,\n },\n };\n}\n\nexport function setTimeGrain(query: AzureMonitorQuery, timeGrain: string): AzureMonitorQuery {\n if (query.azureMonitor?.timeGrain === timeGrain) {\n return query;\n }\n\n return {\n ...query,\n azureMonitor: {\n ...query.azureMonitor,\n timeGrain: timeGrain,\n },\n };\n}\n\nexport function setDimensionFilters(query: AzureMonitorQuery, dimensions: AzureMetricDimension[]): AzureMonitorQuery {\n if (query.azureMonitor?.dimensionFilters === dimensions) {\n return query;\n }\n\n return {\n ...query,\n azureMonitor: {\n ...query.azureMonitor,\n dimensionFilters: dimensions,\n },\n };\n}\n\nexport function appendDimensionFilter(\n query: AzureMonitorQuery,\n dimension = '',\n operator = 'eq',\n filters: string[] = []\n): AzureMonitorQuery {\n const existingFilters = query.azureMonitor?.dimensionFilters ?? [];\n\n return setDimensionFilters(query, [\n ...existingFilters,\n {\n dimension,\n operator,\n filters,\n },\n ]);\n}\n\nexport function removeDimensionFilter(query: AzureMonitorQuery, indexToRemove: number): AzureMonitorQuery {\n const existingFilters = query.azureMonitor?.dimensionFilters ?? [];\n const newFilters = [...existingFilters];\n newFilters.splice(indexToRemove, 1);\n return setDimensionFilters(query, newFilters);\n}\n\nexport function setDimensionFilterValue<Key extends keyof AzureMetricDimension>(\n query: AzureMonitorQuery,\n index: number,\n fieldName: Key,\n value: AzureMetricDimension[Key]\n): AzureMonitorQuery {\n const existingFilters = query.azureMonitor?.dimensionFilters ?? [];\n const newFilters = [...existingFilters];\n const newFilter = newFilters[index];\n newFilter[fieldName] = value;\n if (fieldName === 'dimension' || fieldName === 'operator') {\n newFilter.filters = [];\n }\n return setDimensionFilters(query, newFilters);\n}\n\nexport function setTop(query: AzureMonitorQuery, top: string): AzureMonitorQuery {\n if (query.azureMonitor?.top === top) {\n return query;\n }\n\n return {\n ...query,\n azureMonitor: {\n ...query.azureMonitor,\n top: top,\n },\n };\n}\n\nexport function setLegendAlias(query: AzureMonitorQuery, alias: string): AzureMonitorQuery {\n if (query.azureMonitor?.alias === alias) {\n return query;\n }\n\n return {\n ...query,\n azureMonitor: {\n ...query.azureMonitor,\n alias: alias,\n },\n };\n}\n","import React, { useCallback } from 'react';\n\nimport { SelectableValue } from '@grafana/data';\nimport { Select } from '@grafana/ui';\n\nimport { AzureQueryEditorFieldProps, AzureMonitorOption } from '../../types';\nimport { addValueToOptions } from '../../utils/common';\nimport { Field } from '../Field';\n\nimport { setAggregation } from './setQueryValue';\n\ninterface AggregationFieldProps extends AzureQueryEditorFieldProps {\n aggregationOptions: AzureMonitorOption[];\n isLoading: boolean;\n}\n\nconst AggregationField = ({\n query,\n variableOptionGroup,\n onQueryChange,\n aggregationOptions,\n isLoading,\n}: AggregationFieldProps) => {\n const handleChange = useCallback(\n (change: SelectableValue<string>) => {\n if (!change.value) {\n return;\n }\n\n const newQuery = setAggregation(query, change.value);\n onQueryChange(newQuery);\n },\n [onQueryChange, query]\n );\n\n const options = addValueToOptions(aggregationOptions, variableOptionGroup, query.azureMonitor?.aggregation);\n\n return (\n <Field label=\"Aggregation\">\n <Select\n inputId=\"azure-monitor-metrics-aggregation-field\"\n value={query.azureMonitor?.aggregation || null}\n onChange={handleChange}\n options={options}\n isLoading={isLoading}\n />\n </Field>\n );\n};\n\nexport default AggregationField;\n","import React, { useEffect, useMemo, useState } from 'react';\n\nimport { SelectableValue, DataFrame, PanelData, Labels } from '@grafana/data';\nimport { EditorList, AccessoryButton } from '@grafana/experimental';\nimport { Select, HorizontalGroup, MultiSelect } from '@grafana/ui';\n\nimport { AzureMetricDimension, AzureMonitorOption, AzureMonitorQuery, AzureQueryEditorFieldProps } from '../../types';\nimport { Field } from '../Field';\n\nimport { setDimensionFilters } from './setQueryValue';\n\ninterface DimensionFieldsProps extends AzureQueryEditorFieldProps {\n dimensionOptions: AzureMonitorOption[];\n}\n\ninterface DimensionLabels {\n [key: string]: Set<string>;\n}\n\nconst useDimensionLabels = (data: PanelData | undefined, query: AzureMonitorQuery) => {\n const [dimensionLabels, setDimensionLabels] = useState<DimensionLabels>({});\n useEffect(() => {\n let labelsObj: DimensionLabels = {};\n if (data?.series?.length) {\n // Identify which series' in the dataframe are relevant to the current query\n const series: DataFrame[] = data.series.flat().filter((series) => series.refId === query.refId);\n const fields = series.flatMap((series) => series.fields);\n // Retrieve labels for series fields\n const labels = fields\n .map((fields) => fields.labels)\n .flat()\n .filter((item): item is Labels => item !== null && item !== undefined);\n for (const label of labels) {\n // Labels only exist for series that have a dimension selected\n for (const [dimension, value] of Object.entries(label)) {\n const dimensionLower = dimension.toLowerCase();\n if (labelsObj[dimensionLower]) {\n labelsObj[dimensionLower].add(value);\n } else {\n labelsObj[dimensionLower] = new Set([value]);\n }\n }\n }\n }\n setDimensionLabels((prevLabels) => {\n const newLabels: DimensionLabels = {};\n const currentLabels = Object.keys(labelsObj);\n if (currentLabels.length === 0) {\n return prevLabels;\n }\n for (const label of currentLabels) {\n if (prevLabels[label] && labelsObj[label].size < prevLabels[label].size) {\n newLabels[label] = prevLabels[label];\n } else {\n newLabels[label] = labelsObj[label];\n }\n }\n return newLabels;\n });\n }, [data?.series, query.refId]);\n return dimensionLabels;\n};\n\nconst DimensionFields = ({ data, query, dimensionOptions, onQueryChange }: DimensionFieldsProps) => {\n const dimensionFilters = useMemo(\n () => query.azureMonitor?.dimensionFilters ?? [],\n [query.azureMonitor?.dimensionFilters]\n );\n\n const dimensionLabels = useDimensionLabels(data, query);\n\n const dimensionOperators: Array<SelectableValue<string>> = [\n { label: '==', value: 'eq' },\n { label: '!=', value: 'ne' },\n { label: 'starts with', value: 'sw' },\n ];\n\n const validDimensionOptions = useMemo(() => {\n // We filter out any dimensions that have already been used in a filter as the API doesn't support having multiple filters with the same dimension name.\n // The Azure portal also doesn't support this feature so it makes sense for consistency.\n let t = dimensionOptions;\n if (dimensionFilters.length) {\n t = dimensionOptions.filter(\n (val) => !dimensionFilters.some((dimensionFilter) => dimensionFilter.dimension === val.value)\n );\n }\n return t;\n }, [dimensionFilters, dimensionOptions]);\n\n const onFieldChange = <Key extends keyof AzureMetricDimension>(\n fieldName: Key,\n item: Partial<AzureMetricDimension>,\n value: AzureMetricDimension[Key],\n onChange: (item: Partial<AzureMetricDimension>) => void\n ) => {\n item[fieldName] = value;\n onChange(item);\n };\n\n const getValidDimensionOptions = (selectedDimension: string) => {\n return validDimensionOptions.concat(dimensionOptions.filter((item) => item.value === selectedDimension));\n };\n\n const getValidFilterOptions = (selectedFilter: string | undefined, dimension: string) => {\n const dimensionFilters = Array.from(dimensionLabels[dimension.toLowerCase()] ?? []);\n if (dimensionFilters.find((filter) => filter === selectedFilter)) {\n return dimensionFilters.map((filter) => ({ value: filter, label: filter }));\n }\n return [...dimensionFilters, ...(selectedFilter && selectedFilter !== '*' ? [selectedFilter] : [])].map((item) => ({\n value: item,\n label: item,\n }));\n };\n\n const getValidMultiSelectOptions = (selectedFilters: string[] | undefined, dimension: string) => {\n const labelOptions = getValidFilterOptions(undefined, dimension);\n if (selectedFilters) {\n for (const filter of selectedFilters) {\n if (!labelOptions.find((label) => label.value === filter)) {\n labelOptions.push({ value: filter, label: filter });\n }\n }\n }\n return labelOptions;\n };\n const getValidOperators = (selectedOperator: string) => {\n if (dimensionOperators.find((operator: SelectableValue) => operator.value === selectedOperator)) {\n return dimensionOperators;\n }\n return [...dimensionOperators, ...(selectedOperator ? [{ label: selectedOperator, value: selectedOperator }] : [])];\n };\n\n const changedFunc = (changed: Array<Partial<AzureMetricDimension>>) => {\n const properData: AzureMetricDimension[] = changed.map((x) => {\n return {\n dimension: x.dimension ?? '',\n operator: x.operator ?? 'eq',\n filters: x.filters ?? [],\n };\n });\n onQueryChange(setDimensionFilters(query, properData));\n };\n\n const renderFilters = (\n item: Partial<AzureMetricDimension>,\n onChange: (item: Partial<AzureMetricDimension>) => void,\n onDelete: () => void\n ) => {\n return (\n <HorizontalGroup spacing=\"none\">\n <Select\n menuShouldPortal\n placeholder=\"Field\"\n value={item.dimension}\n options={getValidDimensionOptions(item.dimension || '')}\n onChange={(e) => onFieldChange('dimension', item, e.value ?? '', onChange)}\n />\n <Select\n menuShouldPortal\n placeholder=\"Operation\"\n value={item.operator}\n options={getValidOperators(item.operator || 'eq')}\n onChange={(e) => onFieldChange('operator', item, e.value ?? '', onChange)}\n allowCustomValue\n />\n {item.operator === 'eq' || item.operator === 'ne' ? (\n <MultiSelect\n menuShouldPortal\n placeholder=\"Select value(s)\"\n value={item.filters}\n options={getValidMultiSelectOptions(item.filters, item.dimension ?? '')}\n onChange={(e) =>\n onFieldChange(\n 'filters',\n item,\n e.map((x) => x.value ?? ''),\n onChange\n )\n }\n aria-label={'dimension-labels-select'}\n allowCustomValue\n />\n ) : (\n // The API does not currently allow for multiple \"starts with\" clauses to be used.\n <Select\n menuShouldPortal\n placeholder=\"Select value\"\n value={item.filters ? item.filters[0] : ''}\n allowCustomValue\n options={getValidFilterOptions(item.filters ? item.filters[0] : '', item.dimension ?? '')}\n onChange={(e) => onFieldChange('filters', item, [e?.value ?? ''], onChange)}\n isClearable\n />\n )}\n <AccessoryButton aria-label=\"Remove\" icon=\"times\" variant=\"secondary\" onClick={onDelete} type=\"button\" />\n </HorizontalGroup>\n );\n };\n\n return (\n <Field label=\"Dimensions\">\n <EditorList items={dimensionFilters} onChange={changedFunc} renderItem={renderFilters} />\n </Field>\n );\n};\n\nexport default DimensionFields;\n","import React, { useCallback, useState } from 'react';\n\nimport { Input } from '@grafana/ui';\n\nimport { AzureQueryEditorFieldProps } from '../../types';\nimport { Field } from '../Field';\n\nimport { setLegendAlias } from './setQueryValue';\n\nconst LegendFormatField = ({ onQueryChange, query }: AzureQueryEditorFieldProps) => {\n const [value, setValue] = useState<string>(query.azureMonitor?.alias ?? '');\n\n // As calling onQueryChange initiates a the datasource refresh, we only want to call it once\n // the field loses focus\n const handleChange = useCallback((ev: React.FormEvent) => {\n if (ev.target instanceof HTMLInputElement) {\n setValue(ev.target.value);\n }\n }, []);\n\n const handleBlur = useCallback(() => {\n const newQuery = setLegendAlias(query, value);\n onQueryChange(newQuery);\n }, [onQueryChange, query, value]);\n\n return (\n <Field label=\"Legend format\">\n <Input\n id=\"azure-monitor-metrics-legend-field\"\n placeholder=\"Alias patterns\"\n value={value}\n onChange={handleChange}\n onBlur={handleBlur}\n width={38}\n />\n </Field>\n );\n};\n\nexport default LegendFormatField;\n","import React, { useCallback } from 'react';\n\nimport { SelectableValue } from '@grafana/data';\nimport { Select } from '@grafana/ui';\n\nimport { selectors } from '../../e2e/selectors';\nimport { AzureQueryEditorFieldProps, AzureMonitorOption } from '../../types';\nimport { addValueToOptions } from '../../utils/common';\nimport { Field } from '../Field';\n\nimport { setMetricName } from './setQueryValue';\n\ninterface MetricNameProps extends AzureQueryEditorFieldProps {\n metricNames: AzureMonitorOption[];\n}\n\nconst MetricNameField = ({ metricNames, query, variableOptionGroup, onQueryChange }: MetricNameProps) => {\n const handleChange = useCallback(\n (change: SelectableValue<string>) => {\n if (!change.value) {\n return;\n }\n\n const newQuery = setMetricName(query, change.value);\n onQueryChange(newQuery);\n },\n [onQueryChange, query]\n );\n\n const options = addValueToOptions(metricNames, variableOptionGroup, query.azureMonitor?.metricName);\n\n return (\n <Field label=\"Metric\" data-testid={selectors.components.queryEditor.metricsQueryEditor.metricName.input}>\n <Select\n inputId=\"azure-monitor-metrics-metric-field\"\n value={query.azureMonitor?.metricName ?? null}\n onChange={handleChange}\n options={options}\n allowCustomValue\n />\n </Field>\n );\n};\n\nexport default MetricNameField;\n","import React, { useCallback } from 'react';\n\nimport { SelectableValue } from '@grafana/data';\nimport { Select } from '@grafana/ui';\n\nimport { AzureQueryEditorFieldProps, AzureMonitorOption } from '../../types';\nimport { addValueToOptions } from '../../utils/common';\nimport { Field } from '../Field';\n\nimport { setCustomNamespace } from './setQueryValue';\n\ninterface MetricNamespaceFieldProps extends AzureQueryEditorFieldProps {\n metricNamespaces: AzureMonitorOption[];\n}\n\nconst MetricNamespaceField = ({\n metricNamespaces,\n query,\n variableOptionGroup,\n onQueryChange,\n}: MetricNamespaceFieldProps) => {\n const handleChange = useCallback(\n (change: SelectableValue<string>) => {\n if (!change.value) {\n return;\n }\n\n const newQuery = setCustomNamespace(query, change.value);\n onQueryChange(newQuery);\n },\n [onQueryChange, query]\n );\n\n const value = query.azureMonitor?.customNamespace || query.azureMonitor?.metricNamespace;\n const options = addValueToOptions(metricNamespaces, variableOptionGroup, value);\n\n return (\n <Field label=\"Metric namespace\">\n <Select\n inputId=\"azure-monitor-metrics-metric-namespace-field\"\n value={value || null}\n onChange={handleChange}\n options={options}\n allowCustomValue\n />\n </Field>\n );\n};\n\nexport default MetricNamespaceField;\n","import React, { useCallback, useMemo } from 'react';\n\nimport { SelectableValue } from '@grafana/data';\nimport { Select } from '@grafana/ui';\n\nimport TimegrainConverter from '../../time_grain_converter';\nimport { AzureQueryEditorFieldProps, AzureMonitorOption } from '../../types';\nimport { addValueToOptions } from '../../utils/common';\nimport { Field } from '../Field';\n\nimport { setTimeGrain } from './setQueryValue';\n\ninterface TimeGrainFieldProps extends AzureQueryEditorFieldProps {\n timeGrainOptions: AzureMonitorOption[];\n}\n\nconst TimeGrainField = ({ query, timeGrainOptions, variableOptionGroup, onQueryChange }: TimeGrainFieldProps) => {\n const handleChange = useCallback(\n (change: SelectableValue<string>) => {\n if (!change.value) {\n return;\n }\n\n const newQuery = setTimeGrain(query, change.value);\n onQueryChange(newQuery);\n },\n [onQueryChange, query]\n );\n\n const timeGrains = useMemo(() => {\n const autoInterval = TimegrainConverter.findClosestTimeGrain(\n '1m',\n timeGrainOptions.map((o) => TimegrainConverter.createKbnUnitFromISO8601Duration(o.value)) || [\n '1m',\n '5m',\n '15m',\n '30m',\n '1h',\n '6h',\n '12h',\n '1d',\n ]\n );\n\n const baseTimeGrains = timeGrainOptions.map((v) => (v.value === 'auto' ? { ...v, description: autoInterval } : v));\n\n const options = addValueToOptions(baseTimeGrains, variableOptionGroup, query.azureMonitor?.timeGrain);\n\n return options;\n }, [timeGrainOptions, variableOptionGroup, query.azureMonitor?.timeGrain]);\n\n return (\n <Field label=\"Time grain\">\n <Select\n inputId=\"azure-monitor-metrics-time-grain-field\"\n value={query.azureMonitor?.timeGrain}\n onChange={handleChange}\n options={timeGrains}\n />\n </Field>\n );\n};\n\nexport default TimeGrainField;\n","import React, { useCallback, useState } from 'react';\n\nimport { Input } from '@grafana/ui';\n\nimport { AzureQueryEditorFieldProps } from '../../types';\nimport { Field } from '../Field';\n\nimport { setTop } from './setQueryValue';\n\nconst TopField = ({ onQueryChange, query }: AzureQueryEditorFieldProps) => {\n const [value, setValue] = useState<string>(query.azureMonitor?.top ?? '');\n\n // As calling onQueryChange initiates a the datasource refresh, we only want to call it once\n // the field loses focus\n const handleChange = useCallback((ev: React.FormEvent) => {\n if (ev.target instanceof HTMLInputElement) {\n setValue(ev.target.value);\n }\n }, []);\n\n const handleBlur = useCallback(() => {\n const newQuery = setTop(query, value);\n onQueryChange(newQuery);\n }, [onQueryChange, query, value]);\n\n return (\n <Field label=\"Top\">\n <Input\n id=\"azure-monitor-metrics-top-field\"\n value={value}\n onChange={handleChange}\n onBlur={handleBlur}\n width={16}\n />\n </Field>\n );\n};\n\nexport default TopField;\n","import { useEffect, useMemo, useState } from 'react';\n\nexport function useAsyncState<T>(asyncFn: () => Promise<T>, setError: Function, dependencies: unknown[]) {\n // Use the lazy initial state functionality of useState to assign a random ID to the API call\n // to track where errors come from. See useLastError.\n const [errorSource] = useState(() => Math.random());\n const [value, setValue] = useState<T>();\n\n const finalValue = useMemo(() => value ?? [], [value]);\n\n useEffect(() => {\n asyncFn()\n .then((results) => {\n setValue(results);\n setError(errorSource, undefined);\n })\n .catch((err) => {\n setError(errorSource, err);\n });\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, dependencies);\n\n return finalValue;\n}\n","import { useEffect, useState } from 'react';\n\nimport { rangeUtil } from '@grafana/data';\n\nimport Datasource from '../../datasource';\nimport TimegrainConverter from '../../time_grain_converter';\nimport { AzureMonitorErrorish, AzureMonitorOption, AzureMonitorQuery, AzureMonitorResource } from '../../types';\nimport { toOption } from '../../utils/common';\nimport { useAsyncState } from '../../utils/useAsyncState';\n\nimport { setCustomNamespace } from './setQueryValue';\n\ntype SetErrorFn = (source: string, error: AzureMonitorErrorish | undefined) => void;\n\nexport type DataHook = (\n query: AzureMonitorQuery,\n datasource: Datasource,\n onChange: OnChangeFn,\n setError: SetErrorFn\n) => AzureMonitorOption[];\n\nexport type MetricsMetadataHook = (\n query: AzureMonitorQuery,\n datasource: Datasource,\n onChange: OnChangeFn\n) => MetricMetadata;\n\nexport interface MetricMetadata {\n aggOptions: AzureMonitorOption[];\n timeGrains: AzureMonitorOption[];\n dimensions: AzureMonitorOption[];\n isLoading: boolean;\n\n // These two properties are only used within the hook, and not elsewhere\n supportedAggTypes: string[];\n primaryAggType: string | undefined;\n}\n\ntype OnChangeFn = (newQuery: AzureMonitorQuery) => void;\n\nconst getResourceGroupAndName = (resources?: AzureMonitorResource[]) => {\n if (!resources || !resources.length) {\n return { resourceGroup: '', resourceName: '' };\n }\n return {\n resourceGroup: resources[0].resourceGroup ?? '',\n resourceName: resources[0].resourceName ?? '',\n };\n};\n\nexport const useMetricNamespaces: DataHook = (query, datasource, onChange, setError) => {\n const { subscription } = query;\n const { metricNamespace, resources } = query.azureMonitor ?? {};\n const { resourceGroup, resourceName } = getResourceGroupAndName(resources);\n\n const metricNamespaces = useAsyncState(\n async () => {\n if (!subscription || !resourceGroup || !resourceName) {\n return;\n }\n\n const results = await datasource.azureMonitorDatasource.getMetricNamespaces(\n {\n subscription,\n metricNamespace,\n resourceGroup,\n resourceName,\n },\n false\n );\n const options = formatOptions(results, metricNamespace);\n\n // Do some cleanup of the query state if need be\n if (!metricNamespace && options.length) {\n onChange(setCustomNamespace(query, options[0].value));\n }\n\n return options;\n },\n setError,\n [subscription, metricNamespace, resourceGroup, resourceName]\n );\n\n return metricNamespaces;\n};\n\nexport const useMetricNames: DataHook = (query, datasource, onChange, setError) => {\n const { subscription } = query;\n const { metricNamespace, metricName, resources, customNamespace } = query.azureMonitor ?? {};\n const { resourceGroup, resourceName } = getResourceGroupAndName(resources);\n const multipleResources = (resources && resources.length > 1) ?? false;\n const region = query.azureMonitor?.region ?? '';\n\n return useAsyncState(\n async () => {\n if (!subscription || !metricNamespace || !resourceGroup || !resourceName) {\n return;\n }\n const results = await datasource.azureMonitorDatasource.getMetricNames(\n {\n subscription,\n resourceGroup,\n resourceName,\n metricNamespace,\n customNamespace,\n },\n multipleResources,\n region\n );\n const options = formatOptions(results, metricName);\n\n return options;\n },\n setError,\n [subscription, resourceGroup, resourceName, metricNamespace, customNamespace, multipleResources]\n );\n};\n\nconst defaultMetricMetadata: MetricMetadata = {\n aggOptions: [],\n timeGrains: [],\n dimensions: [],\n isLoading: false,\n supportedAggTypes: [],\n primaryAggType: undefined,\n};\n\nexport const useMetricMetadata = (query: AzureMonitorQuery, datasource: Datasource, onChange: OnChangeFn) => {\n const [metricMetadata, setMetricMetadata] = useState<MetricMetadata>(defaultMetricMetadata);\n const { subscription } = query;\n const { resources, metricNamespace, metricName, aggregation, timeGrain, customNamespace, region } =\n query.azureMonitor ?? {};\n const { resourceGroup, resourceName } = getResourceGroupAndName(resources);\n const multipleResources = (resources && resources.length > 1) ?? false;\n\n // Fetch new metric metadata when the fields change\n useEffect(() => {\n if (!subscription || !resourceGroup || !resourceName || !metricNamespace || !metricName) {\n setMetricMetadata(defaultMetricMetadata);\n return;\n }\n datasource.azureMonitorDatasource\n .getMetricMetadata(\n { subscription, resourceGroup, resourceName, metricNamespace, metricName, customNamespace },\n multipleResources,\n region\n )\n .then((metadata) => {\n // TODO: Move the aggregationTypes and timeGrain defaults into `getMetricMetadata`\n const aggregations = (metadata.supportedAggTypes || [metadata.primaryAggType]).map((v) => ({\n label: v,\n value: v,\n }));\n\n setMetricMetadata({\n aggOptions: aggregations,\n timeGrains: metadata.supportedTimeGrains,\n dimensions: metadata.dimensions,\n isLoading: false,\n supportedAggTypes: metadata.supportedAggTypes ?? [],\n primaryAggType: metadata.primaryAggType,\n });\n });\n }, [\n region,\n datasource,\n subscription,\n resourceGroup,\n resourceName,\n metricNamespace,\n metricName,\n customNamespace,\n multipleResources,\n ]);\n\n // Update the query state in response to the meta data changing\n useEffect(() => {\n const newAggregation = aggregation || metricMetadata.primaryAggType;\n const newTimeGrain = timeGrain || 'auto';\n\n if (newAggregation !== aggregation || newTimeGrain !== timeGrain) {\n onChange({\n ...query,\n azureMonitor: {\n ...query.azureMonitor,\n aggregation: newAggregation,\n timeGrain: newTimeGrain,\n allowedTimeGrainsMs: metricMetadata.timeGrains\n .filter((timeGrain) => timeGrain.value !== 'auto')\n .map((timeGrain) =>\n rangeUtil.intervalToMs(TimegrainConverter.createKbnUnitFromISO8601Duration(timeGrain.value))\n ),\n },\n });\n }\n }, [onChange, metricMetadata, aggregation, timeGrain, query]);\n\n return metricMetadata;\n};\n\nfunction formatOptions(\n rawResults: Array<{\n text: string;\n value: string;\n }>,\n selectedValue?: string\n) {\n const options = rawResults.map(toOption);\n\n // account for custom values that might have been set in json file like ones crafted with a template variable (ex: \"cloud-datasource-resource-$Environment\")\n if (selectedValue && !options.find((option) => option.value === selectedValue.toLowerCase())) {\n options.push({ label: selectedValue, value: selectedValue });\n }\n\n return options;\n}\n","import React from 'react';\n\nimport { PanelData } from '@grafana/data/src/types';\nimport { EditorRows, EditorRow, EditorFieldGroup } from '@grafana/experimental';\n\nimport { multiResourceCompatibleTypes } from '../../azureMetadata';\nimport type Datasource from '../../datasource';\nimport { selectors } from '../../e2e/selectors';\nimport type { AzureMonitorQuery, AzureMonitorOption, AzureMonitorErrorish, AzureMonitorResource } from '../../types';\nimport ResourceField from '../ResourceField';\nimport { ResourceRow, ResourceRowGroup, ResourceRowType } from '../ResourcePicker/types';\nimport { parseResourceDetails } from '../ResourcePicker/utils';\n\nimport AdvancedResourcePicker from './AdvancedResourcePicker';\nimport AggregationField from './AggregationField';\nimport DimensionFields from './DimensionFields';\nimport LegendFormatField from './LegendFormatField';\nimport MetricNameField from './MetricNameField';\nimport MetricNamespaceField from './MetricNamespaceField';\nimport TimeGrainField from './TimeGrainField';\nimport TopField from './TopField';\nimport { useMetricNames, useMetricNamespaces, useMetricMetadata } from './dataHooks';\n\ninterface MetricsQueryEditorProps {\n data: PanelData | undefined;\n query: AzureMonitorQuery;\n datasource: Datasource;\n onChange: (newQuery: AzureMonitorQuery) => void;\n variableOptionGroup: { label: string; options: AzureMonitorOption[] };\n setError: (source: string, error: AzureMonitorErrorish | undefined) => void;\n}\n\nconst MetricsQueryEditor = ({\n data,\n query,\n datasource,\n variableOptionGroup,\n onChange,\n setError,\n}: MetricsQueryEditorProps) => {\n const metricsMetadata = useMetricMetadata(query, datasource, onChange);\n const metricNamespaces = useMetricNamespaces(query, datasource, onChange, setError);\n const metricNames = useMetricNames(query, datasource, onChange, setError);\n const resources =\n query.azureMonitor?.resources?.map((r) => ({\n subscription: query.subscription,\n resourceGroup: r.resourceGroup,\n metricNamespace: query.azureMonitor?.metricNamespace,\n resourceName: r.resourceName,\n region: query.azureMonitor?.region,\n })) ?? [];\n\n const supportMultipleResource = (namespace?: string) => {\n return multiResourceCompatibleTypes[namespace?.toLocaleLowerCase() ?? ''] ?? false;\n };\n\n const disableRow = (row: ResourceRow, selectedRows: ResourceRowGroup) => {\n if (selectedRows.length === 0) {\n // Only if there is some resource(s) selected we should disable rows\n return false;\n }\n\n const rowResource = parseResourceDetails(row.uri, row.location);\n const selectedRowSample = parseResourceDetails(selectedRows[0].uri, selectedRows[0].location);\n // Only resources:\n // - in the same subscription\n // - in the same region\n // - with the same metric namespace\n // - with a metric namespace that is compatible with multi-resource queries\n return (\n rowResource.subscription !== selectedRowSample.subscription ||\n rowResource.region !== selectedRowSample.region ||\n rowResource.metricNamespace?.toLocaleLowerCase() !== selectedRowSample.metricNamespace?.toLocaleLowerCase() ||\n !supportMultipleResource(rowResource.metricNamespace)\n );\n };\n\n const selectionNotice = (selectedRows: ResourceRowGroup) => {\n if (selectedRows.length === 0) {\n return '';\n }\n const selectedRowSample = parseResourceDetails(selectedRows[0].uri, selectedRows[0].location);\n return supportMultipleResource(selectedRowSample.metricNamespace)\n ? 'You can select items of the same resource type and location. To select resources of a different resource type or location, please first uncheck your current selection.'\n : '';\n };\n\n return (\n <span data-testid={selectors.components.queryEditor.metricsQueryEditor.container.input}>\n <EditorRows>\n <EditorRow>\n <EditorFieldGroup>\n <ResourceField\n query={query}\n datasource={datasource}\n variableOptionGroup={variableOptionGroup}\n onQueryChange={onChange}\n setError={setError}\n selectableEntryTypes={[ResourceRowType.Resource]}\n resources={resources ?? []}\n queryType={'metrics'}\n disableRow={disableRow}\n renderAdvanced={(resources, onChange) => (\n // It's required to cast resources because the resource picker\n // specifies the type to string | AzureMonitorResource.\n // eslint-disable-next-line\n <AdvancedResourcePicker resources={resources as AzureMonitorResource[]} onChange={onChange} />\n )}\n selectionNotice={selectionNotice}\n />\n <MetricNamespaceField\n metricNamespaces={metricNamespaces}\n query={query}\n datasource={datasource}\n variableOptionGroup={variableOptionGroup}\n onQueryChange={onChange}\n setError={setError}\n />\n <MetricNameField\n metricNames={metricNames}\n query={query}\n datasource={datasource}\n variableOptionGroup={variableOptionGroup}\n onQueryChange={onChange}\n setError={setError}\n />\n <AggregationField\n query={query}\n datasource={datasource}\n variableOptionGroup={variableOptionGroup}\n onQueryChange={onChange}\n setError={setError}\n aggregationOptions={metricsMetadata?.aggOptions ?? []}\n isLoading={metricsMetadata.isLoading}\n />\n <TimeGrainField\n query={query}\n datasource={datasource}\n variableOptionGroup={variableOptionGroup}\n onQueryChange={onChange}\n setError={setError}\n timeGrainOptions={metricsMetadata?.timeGrains ?? []}\n />\n </EditorFieldGroup>\n </EditorRow>\n <EditorRow>\n <EditorFieldGroup>\n <DimensionFields\n data={data}\n query={query}\n datasource={datasource}\n variableOptionGroup={variableOptionGroup}\n onQueryChange={onChange}\n setError={setError}\n dimensionOptions={metricsMetadata?.dimensions ?? []}\n />\n </EditorFieldGroup>\n </EditorRow>\n <EditorRow>\n <EditorFieldGroup>\n <TopField\n query={query}\n datasource={datasource}\n variableOptionGroup={variableOptionGroup}\n onQueryChange={onChange}\n setError={setError}\n />\n <LegendFormatField\n query={query}\n datasource={datasource}\n variableOptionGroup={variableOptionGroup}\n onQueryChange={onChange}\n setError={setError}\n />\n </EditorFieldGroup>\n </EditorRow>\n </EditorRows>\n </span>\n );\n};\n\nexport default MetricsQueryEditor;\n","import React, { useCallback } from 'react';\n\nimport { SelectableValue } from '@grafana/data';\nimport { EditorHeader, InlineSelect } from '@grafana/experimental';\n\nimport { selectors } from '../e2e/selectors';\nimport { AzureMonitorQuery, AzureQueryType } from '../types';\n\ninterface QueryTypeFieldProps {\n query: AzureMonitorQuery;\n onQueryChange: (newQuery: AzureMonitorQuery) => void;\n}\n\nexport const QueryHeader = ({ query, onQueryChange }: QueryTypeFieldProps) => {\n const queryTypes: Array<{ value: AzureQueryType; label: string }> = [\n { value: AzureQueryType.AzureMonitor, label: 'Metrics' },\n { value: AzureQueryType.LogAnalytics, label: 'Logs' },\n { value: AzureQueryType.AzureTraces, label: 'Traces' },\n { value: AzureQueryType.AzureResourceGraph, label: 'Azure Resource Graph' },\n ];\n\n const handleChange = useCallback(\n (change: SelectableValue<AzureQueryType>) => {\n if (change.value && change.value !== query.queryType) {\n onQueryChange({\n refId: query.refId,\n datasource: query.datasource,\n queryType: change.value,\n });\n }\n },\n [onQueryChange, query]\n );\n\n return (\n <span data-testid={selectors.components.queryEditor.header.select}>\n <EditorHeader>\n <InlineSelect\n label=\"Service\"\n value={query.queryType}\n placeholder=\"Service...\"\n allowCustomValue\n options={queryTypes}\n onChange={handleChange}\n />\n </EditorHeader>\n </span>\n );\n};\n","import { cx } from '@emotion/css';\nimport React, { RefCallback, SyntheticEvent, useState } from 'react';\nimport { lastValueFrom } from 'rxjs';\n\nimport { CoreApp, DataFrame, getDefaultTimeRange, SelectableValue, TimeRange } from '@grafana/data';\nimport { AccessoryButton } from '@grafana/experimental';\nimport {\n HorizontalGroup,\n Select,\n ButtonSelect,\n AsyncMultiSelect,\n getSelectStyles,\n useTheme2,\n Checkbox,\n} from '@grafana/ui';\n\nimport { AzureMonitorQuery, AzureQueryType, AzureTracesFilter } from '../../dataquery.gen';\nimport Datasource from '../../datasource';\nimport { VariableOptionGroup } from '../../types';\nimport { addValueToOptions } from '../../utils/common';\n\nexport interface FilterProps {\n query: AzureMonitorQuery;\n datasource: Datasource;\n propertyMap: Map<string, SelectableValue[]>;\n setPropertyMap: React.Dispatch<React.SetStateAction<Map<string, Array<SelectableValue<string>>>>>;\n queryTraceTypes: string[];\n properties: string[];\n variableOptionGroup: VariableOptionGroup;\n range?: TimeRange;\n}\n\nconst onFieldChange = <Key extends keyof AzureTracesFilter>(\n fieldName: Key,\n item: Partial<AzureTracesFilter>,\n selected: SelectableValue<AzureTracesFilter[Key]>,\n onChange: (item: Partial<AzureTracesFilter>) => void\n) => {\n if (fieldName === 'filters') {\n item[fieldName] = selected.map((item: SelectableValue<string>) => item.value);\n } else {\n item[fieldName] = selected.value;\n if (fieldName === 'property') {\n item.filters = [];\n }\n }\n onChange(item);\n};\n\nconst getTraceProperties = async (\n query: AzureMonitorQuery,\n datasource: Datasource,\n traceTypes: string[],\n propertyMap: Map<string, SelectableValue[]>,\n setPropertyMap: React.Dispatch<React.SetStateAction<Map<string, Array<SelectableValue<string>>>>>,\n filter?: Partial<AzureTracesFilter>,\n range?: TimeRange\n): Promise<SelectableValue[]> => {\n const { azureTraces } = query;\n if (!azureTraces) {\n return [];\n }\n\n const { resources } = azureTraces;\n\n if (!resources || !filter) {\n return [];\n }\n\n const property = filter.property;\n if (!property) {\n return [];\n }\n\n const queryString = `let ${property} = toscalar(union isfuzzy=true ${traceTypes.join(',')}\n | where $__timeFilter(timestamp)\n | summarize count=count() by ${property}\n | summarize make_list(pack_all()));\n print properties = bag_pack(\"${property}\", ${property});`;\n\n const results = await lastValueFrom(\n datasource.azureLogAnalyticsDatasource.query({\n requestId: 'azure-traces-properties-req',\n interval: '',\n intervalMs: 0,\n scopedVars: {},\n timezone: '',\n startTime: 0,\n app: CoreApp.Unknown,\n targets: [\n {\n ...query,\n azureLogAnalytics: {\n resources,\n query: queryString,\n },\n queryType: AzureQueryType.LogAnalytics,\n },\n ],\n range: range || getDefaultTimeRange(),\n })\n );\n if (results.data.length > 0) {\n const result: DataFrame = results.data[0];\n if (result.fields.length > 0) {\n const properties: { [key: string]: Array<{ [key: string]: string | number; count: number }> } = JSON.parse(\n result.fields[0].values.toArray()[0]\n );\n const values = properties[property].map((value) => {\n let label = value[property];\n if (value[property] === '') {\n label = '<Empty>';\n }\n return { label: label.toString(), value: value[property].toString(), count: value.count };\n });\n propertyMap.set(property, values);\n setPropertyMap(propertyMap);\n return values;\n }\n }\n\n return [];\n};\n\nexport function makeRenderItem(props: FilterProps) {\n function renderItem(\n item: Partial<AzureTracesFilter>,\n onChange: (item: Partial<AzureTracesFilter>) => void,\n onDelete: () => void\n ) {\n return <Filter {...props} item={item} onChange={onChange} onDelete={onDelete} />;\n }\n\n return renderItem;\n}\n\ninterface OptionProps {\n isFocused: boolean;\n isSelected: boolean;\n innerProps: JSX.IntrinsicElements['div'];\n innerRef: RefCallback<HTMLDivElement>;\n data: SelectableValue<string>;\n selectOption: (data: SelectableValue<string>) => void;\n}\n\nconst Option = (props: React.PropsWithChildren<OptionProps>) => {\n const { data, innerProps, innerRef, isFocused, isSelected } = props;\n const theme = useTheme2();\n const styles = getSelectStyles(theme);\n\n const onClickMultiOption = (e: SyntheticEvent) => {\n props.selectOption({ ...data });\n e.stopPropagation();\n e.preventDefault();\n };\n\n return (\n <div\n ref={innerRef}\n className={cx(\n styles.option,\n isFocused && styles.optionFocused,\n isSelected && styles.optionSelected,\n data.isDisabled && styles.optionDisabled\n )}\n {...innerProps}\n aria-label=\"Select option\"\n title={data.title}\n onClick={onClickMultiOption}\n onKeyDown={onClickMultiOption}\n role=\"checkbox\"\n aria-checked={isSelected}\n tabIndex={0}\n >\n <div className={styles.optionBody}>\n <Checkbox value={isSelected} label={data.label ? `${data.label} - (${data.count})` : ''} />\n </div>\n </div>\n );\n};\n\nconst Filter = (\n props: FilterProps & {\n item: Partial<AzureTracesFilter>;\n onChange: (item: Partial<AzureTracesFilter>) => void;\n onDelete: () => void;\n }\n) => {\n const {\n query,\n datasource,\n propertyMap,\n setPropertyMap,\n queryTraceTypes,\n properties,\n item,\n onChange,\n onDelete,\n variableOptionGroup,\n range,\n } = props;\n const [loading, setLoading] = useState(false);\n const [values, setValues] = useState<Array<SelectableValue<string> | VariableOptionGroup>>(\n addValueToOptions(propertyMap.get(item.property ?? '') ?? [], variableOptionGroup)\n );\n const [selected, setSelected] = useState<SelectableValue[]>(\n item.filters ? item.filters.map((filter) => ({ value: filter, label: filter === '' ? '<Empty>' : filter })) : []\n );\n\n const loadOptions = async () => {\n setLoading(true);\n if (item.property && item.property !== '') {\n const vals = propertyMap.get(item.property ?? '');\n if (!vals) {\n const promise = await getTraceProperties(\n query,\n datasource,\n queryTraceTypes,\n propertyMap,\n setPropertyMap,\n item,\n range\n );\n setValues(addValueToOptions(promise, variableOptionGroup));\n setLoading(false);\n return promise;\n } else {\n setValues(addValueToOptions(vals, variableOptionGroup));\n setLoading(false);\n return Promise.resolve(vals);\n }\n }\n const empty: Array<SelectableValue<string>> = [];\n return Promise.resolve(empty);\n };\n\n return (\n <HorizontalGroup spacing=\"none\">\n <Select\n menuShouldPortal\n placeholder=\"Property\"\n value={item.property ? { value: item.property, label: item.property } : null}\n options={addValueToOptions(\n properties.map((type) => ({ label: type, value: type })),\n variableOptionGroup\n )}\n onChange={(e) => onFieldChange('property', item, e, onChange)}\n width={25}\n />\n <ButtonSelect<string>\n value={item.operation ? { label: item.operation === 'eq' ? '=' : '!=', value: item.operation } : undefined}\n options={[\n { label: '=', value: 'eq' },\n { label: '!=', value: 'ne' },\n ]}\n onChange={(e) => onFieldChange('operation', item, e, onChange)}\n defaultValue={'eq'}\n />\n <AsyncMultiSelect\n blurInputOnSelect={false}\n menuShouldPortal\n placeholder=\"Value\"\n value={selected}\n loadOptions={loadOptions}\n isLoading={loading}\n onOpenMenu={loadOptions}\n onChange={(e: Array<SelectableValue<string>>) => {\n setSelected(e);\n if (e.length === 0) {\n onFieldChange('filters', item, selected, onChange);\n }\n }}\n width={35}\n defaultOptions={values}\n isClearable\n components={{ Option }}\n closeMenuOnSelect={false}\n onCloseMenu={() => onFieldChange('filters', item, selected, onChange)}\n hideSelectedOptions={false}\n />\n <AccessoryButton aria-label=\"Remove filter\" icon=\"times\" variant=\"secondary\" onClick={onDelete} type=\"button\" />\n </HorizontalGroup>\n );\n};\n\nexport default Filter;\n","import { omit } from 'lodash';\n\nexport const Tables = {\n availabilityResults: { label: 'Availablity Results', description: 'Availability test results.' },\n dependencies: {\n label: 'Dependencies',\n description: 'Calls your application makes to other services such as databases or REST APIs.',\n },\n customEvents: { label: 'Custom Events', description: 'Calls to TrackEvent that are inserted to monitor usage.' },\n exceptions: {\n label: 'Exceptions',\n description: 'Exceptions that are logged via TrackException, or uncaught exceptions.',\n },\n pageViews: { label: 'Page Views', description: 'Web client telemetry to create page view reports.' },\n requests: { label: 'Requests', description: 'HTTP requests received by the application.' },\n traces: {\n label: 'Traces',\n description:\n 'Diagnostic logs emitted using TrackTrace and similar methods. Note: Traces are not visualised if the result format is set to Trace',\n },\n};\n\n// Resource centric tables mapped to legacy tables\nexport const tables = {\n AppAvailabilityResults: 'availabilityResults',\n AppDependencies: 'dependencies',\n AppEvents: 'events',\n AppExceptions: 'exceptions',\n AppPageViews: 'pageViews',\n AppRequests: 'requests',\n AppTraces: 'traces',\n};\n\n// Properties to omit when generating the attributes bag\nexport const attributesOmit = [\n 'operationId',\n 'duration',\n 'id',\n 'name',\n 'problemId',\n 'operation_ParentId',\n 'timestamp',\n 'customDimensions',\n 'operation_Name',\n];\n\n// Common resource centric properties mapped to legacy property names\nexport const common = {\n appId: 'ResourceGUID',\n application_Version: 'AppVersion',\n appName: '_ResourceId',\n client_Browser: 'ClientBrowser',\n client_City: 'ClientCity',\n client_CountryOrRegion: 'ClientCountryOrRegion',\n client_IP: 'ClientIP',\n client_Model: 'ClientModel',\n client_OS: 'ClientOS',\n client_StateOrProvince: 'ClientStateOrProvince',\n client_Type: 'ClientType',\n cloud_RoleInstance: 'AppRoleInstance',\n cloud_RoleName: 'AppRoleName',\n customDimensions: 'Properties',\n customMeasurements: 'Measurements',\n duration: 'DurationMs',\n id: 'Id',\n iKey: 'IKey',\n itemCount: 'ItemCount',\n itemId: '_ItemId',\n itemType: 'Type',\n name: 'Name',\n operation_Id: 'OperationId',\n operation_Name: 'OperationName',\n operation_ParentId: 'OperationParentId',\n operation_SyntheticSource: 'OperationSyntheticSource',\n performanceBucket: 'PerformanceBucket',\n sdkVersion: 'SDKVersion',\n session_Id: 'SessionId',\n success: 'Success',\n timestamp: 'TimeGenerated',\n user_AccountId: 'UserAccountId',\n user_AuthenticatedId: 'UserAuthenticatedId',\n user_Id: 'UserId',\n};\n\n// Additional properties for availabilityResults\nexport const availabilityResultsSchema = {\n ...common,\n location: 'Location',\n message: 'Message',\n size: 'Size',\n};\n\n// Additional properties for dependencies\nexport const dependenciesSchema = {\n ...common,\n data: 'Data',\n resultCode: 'ResultCode',\n target: 'Target',\n type: 'DependencyType',\n};\n\n// Additional properties for events\nexport const eventsSchema = omit(common, ['duration', 'id', 'success', 'performanceBucket']);\n\n// Additional properties for pageVies\nexport const pageViewsSchema = omit(\n {\n ...common,\n url: 'Url',\n },\n ['success']\n);\n\n// Additional properties for requests\nexport const requestsSchema = {\n resultCode: 'ResultCode',\n source: 'Source',\n url: 'Url',\n};\n\n// Additional properties for exceptions\nexport const exceptionsSchema = omit(\n {\n ...common,\n assembly: 'Assembly',\n details: 'Details',\n handledAt: 'HandledAt',\n innermostAssembly: 'InnermostAssembly',\n innermostMessage: 'InnermostMessage',\n innermostMethod: 'InnermostMethod',\n innermostType: 'InnermostType',\n message: 'Message',\n method: 'Method',\n outerAssembly: 'OuterAssembly',\n outerMessage: 'OuterMessage',\n outerMethod: 'OuterMethod',\n outerType: 'OuterType',\n problemId: 'ProblemId',\n severityLevel: 'SeverityLevel',\n type: 'ExceptionType',\n },\n ['duration', 'id', 'name', 'performanceBucket', 'success']\n);\n\n// Additional properties for traces\nexport const tracesSchema = omit(\n {\n message: 'Message',\n severityLevel: 'SeverityLevel',\n },\n ['duration', 'id', 'name', 'performanceBucket', 'success']\n);\n\nexport const tablesSchema: { [key: string]: { [key: string]: string } } = {\n availabilityResults: availabilityResultsSchema,\n dependencies: dependenciesSchema,\n customEvents: eventsSchema,\n exceptions: exceptionsSchema,\n pageViews: pageViewsSchema,\n requests: requestsSchema,\n traces: tracesSchema,\n};\n\nexport const tableTags = Object.entries(tablesSchema).reduce(\n (val, [k, v]) => ({ ...val, [k]: Object.keys(omit(v, attributesOmit)).join(',') }),\n {}\n);\n","import { AzureMonitorQuery, AzureTracesFilter, ResultFormat } from '../../types';\n\nexport function setQueryOperationId(query: AzureMonitorQuery, operationId?: string): AzureMonitorQuery {\n return {\n ...query,\n azureTraces: {\n ...query.azureTraces,\n operationId,\n },\n };\n}\n\nexport function setFormatAs(query: AzureMonitorQuery, formatAs: ResultFormat): AzureMonitorQuery {\n return {\n ...query,\n azureTraces: {\n ...query.azureTraces,\n resultFormat: formatAs,\n },\n };\n}\n\nexport function setTraceTypes(query: AzureMonitorQuery, traceTypes: string[]): AzureMonitorQuery {\n return {\n ...query,\n azureTraces: {\n ...query.azureTraces,\n traceTypes,\n },\n };\n}\n\nexport function setFilters(query: AzureMonitorQuery, filters: AzureTracesFilter[]): AzureMonitorQuery {\n return {\n ...query,\n azureTraces: {\n ...query.azureTraces,\n filters,\n },\n };\n}\n","import { uniq } from 'lodash';\nimport React, { useEffect, useMemo, useState } from 'react';\n\nimport { SelectableValue } from '@grafana/data';\nimport { EditorList } from '@grafana/experimental';\nimport { Field } from '@grafana/ui';\n\nimport { AzureQueryEditorFieldProps, AzureTracesFilter } from '../../types';\n\nimport { makeRenderItem } from './Filter';\nimport { tablesSchema } from './consts';\nimport { setFilters } from './setQueryValue';\n\nconst Filters = ({ query, datasource, onQueryChange, variableOptionGroup, range }: AzureQueryEditorFieldProps) => {\n const { azureTraces } = query;\n const queryTraceTypes = azureTraces?.traceTypes ? azureTraces.traceTypes : Object.keys(tablesSchema);\n\n const excludedProperties = new Set([\n 'customDimensions',\n 'customMeasurements',\n 'details',\n 'duration',\n 'id',\n 'itemId',\n 'operation_Id',\n 'operation_ParentId',\n 'timestamp',\n ]);\n const properties = uniq(queryTraceTypes.map((type) => Object.keys(tablesSchema[type])).flat()).filter(\n (item) => !excludedProperties.has(item)\n );\n\n const [propertyMap, setPropertyMap] = useState(new Map<string, Array<SelectableValue<string>>>());\n const queryFilters = useMemo(() => query.azureTraces?.filters ?? [], [query.azureTraces?.filters]);\n const [filters, updateFilters] = useState(queryFilters);\n\n useEffect(() => {\n setPropertyMap(new Map<string, Array<SelectableValue<string>>>());\n }, [query.azureTraces?.resources, query.azureTraces?.traceTypes, query.azureTraces?.operationId]);\n\n const changedFunc = (changed: Array<Partial<AzureTracesFilter>>) => {\n let updateQuery = false;\n const properData: AzureTracesFilter[] = changed.map((x) => {\n if (x.property !== '' && x.filters && x.filters.length > 0 && x.operation !== '') {\n updateQuery = true;\n } else {\n updateQuery = false;\n }\n return {\n property: x.property ?? '',\n filters: x.filters ?? [],\n operation: x.operation ?? 'eq',\n };\n });\n updateFilters(properData);\n if (updateQuery || (queryFilters.length > 0 && properData.length === 0)) {\n onQueryChange(setFilters(query, properData));\n }\n };\n\n return (\n <Field label=\"Filters\">\n <EditorList\n items={filters}\n onChange={changedFunc}\n renderItem={makeRenderItem({\n query,\n datasource,\n propertyMap,\n setPropertyMap,\n queryTraceTypes,\n properties,\n variableOptionGroup,\n range,\n })}\n />\n </Field>\n );\n};\n\nexport default Filters;\n","import React, { useCallback, useMemo } from 'react';\n\nimport { SelectableValue } from '@grafana/data';\nimport { MultiSelect } from '@grafana/ui';\n\nimport { selectors } from '../../e2e/selectors';\nimport { AzureQueryEditorFieldProps, AzureMonitorOption } from '../../types';\nimport { findOptions } from '../../utils/common';\nimport { Field } from '../Field';\n\nimport { Tables } from './consts';\nimport { setTraceTypes } from './setQueryValue';\n\nconst TraceTypeField = ({ query, variableOptionGroup, onQueryChange }: AzureQueryEditorFieldProps) => {\n const tables: AzureMonitorOption[] = Object.entries(Tables).map(([key, value]) => ({\n label: value.label,\n description: value.description,\n value: key,\n }));\n const handleChange = useCallback(\n (change: Array<SelectableValue<string>>) => {\n const newQuery = setTraceTypes(\n query,\n change.map((type) => type.value ?? '')\n );\n onQueryChange(newQuery);\n },\n [onQueryChange, query]\n );\n\n const options = useMemo(() => [...tables, variableOptionGroup], [tables, variableOptionGroup]);\n\n // Select all trace event ypes by default\n const getDefaultOptions = () => {\n const allEventTypes = tables.map((t) => t.value);\n const defaultQuery = setTraceTypes(query, allEventTypes);\n onQueryChange(defaultQuery);\n return allEventTypes;\n };\n\n return (\n <Field label=\"Event Type\">\n <MultiSelect\n placeholder=\"Choose event types\"\n inputId=\"azure-monitor-traces-type-field\"\n value={findOptions(\n [...tables, ...variableOptionGroup.options],\n query.azureTraces?.traceTypes ?? getDefaultOptions()\n )}\n onChange={handleChange}\n options={options}\n allowCustomValue\n isClearable\n aria-label={selectors.components.queryEditor.tracesQueryEditor.traceTypes.select}\n />\n </Field>\n );\n};\n\nexport default TraceTypeField;\n","import React, { useCallback, useEffect, useState } from 'react';\nimport { usePrevious } from 'react-use';\n\nimport { TimeRange } from '@grafana/data';\nimport { EditorFieldGroup, EditorRow, EditorRows } from '@grafana/experimental';\nimport { Input } from '@grafana/ui';\n\nimport Datasource from '../../datasource';\nimport { selectors } from '../../e2e/selectors';\nimport { AzureMonitorErrorish, AzureMonitorOption, AzureMonitorQuery, ResultFormat } from '../../types';\nimport { Field } from '../Field';\nimport FormatAsField from '../FormatAsField';\nimport AdvancedResourcePicker from '../LogsQueryEditor/AdvancedResourcePicker';\nimport ResourceField from '../ResourceField';\nimport { ResourceRow, ResourceRowGroup, ResourceRowType } from '../ResourcePicker/types';\nimport { parseResourceDetails } from '../ResourcePicker/utils';\n\nimport Filters from './Filters';\nimport TraceTypeField from './TraceTypeField';\nimport { setFormatAs, setQueryOperationId } from './setQueryValue';\n\ninterface TracesQueryEditorProps {\n query: AzureMonitorQuery;\n datasource: Datasource;\n subscriptionId?: string;\n onChange: (newQuery: AzureMonitorQuery) => void;\n variableOptionGroup: { label: string; options: AzureMonitorOption[] };\n setError: (source: string, error: AzureMonitorErrorish | undefined) => void;\n range?: TimeRange;\n}\n\nconst TracesQueryEditor = ({\n query,\n datasource,\n subscriptionId,\n variableOptionGroup,\n onChange,\n setError,\n range,\n}: TracesQueryEditorProps) => {\n const disableRow = (row: ResourceRow, selectedRows: ResourceRowGroup) => {\n if (selectedRows.length === 0) {\n // Only if there is some resource(s) selected we should disable rows\n return false;\n }\n const rowResourceNS = parseResourceDetails(row.uri, row.location).metricNamespace?.toLowerCase();\n const selectedRowSampleNs = parseResourceDetails(\n selectedRows[0].uri,\n selectedRows[0].location\n ).metricNamespace?.toLowerCase();\n // Only resources with the same metricNamespace can be selected\n return rowResourceNS !== selectedRowSampleNs;\n };\n\n const [operationId, setOperationId] = useState<string>(query.azureTraces?.operationId ?? '');\n const previousOperationId = usePrevious(query.azureTraces?.operationId);\n\n useEffect(() => {\n if (query.azureTraces?.operationId) {\n if (previousOperationId !== query.azureTraces.operationId) {\n setOperationId(query.azureTraces.operationId);\n }\n }\n }, [setOperationId, previousOperationId, query, operationId]);\n\n const handleChange = useCallback((ev: React.FormEvent) => {\n if (ev.target instanceof HTMLInputElement) {\n setOperationId(ev.target.value);\n }\n }, []);\n\n const handleBlur = useCallback(\n (ev: React.FormEvent) => {\n const newQuery = setQueryOperationId(query, operationId);\n onChange(newQuery);\n },\n [onChange, operationId, query]\n );\n\n return (\n <span data-testid={selectors.components.queryEditor.tracesQueryEditor.container.input}>\n <EditorRows>\n <EditorRow>\n <EditorFieldGroup>\n <ResourceField\n query={query}\n datasource={datasource}\n subscriptionId={subscriptionId}\n variableOptionGroup={variableOptionGroup}\n onQueryChange={onChange}\n setError={setError}\n selectableEntryTypes={[\n ResourceRowType.Subscription,\n ResourceRowType.ResourceGroup,\n ResourceRowType.Resource,\n ResourceRowType.Variable,\n ]}\n resources={query.azureTraces?.resources ?? []}\n queryType=\"traces\"\n disableRow={disableRow}\n renderAdvanced={(resources, onChange) => (\n // It's required to cast resources because the resource picker\n // specifies the type to string | AzureMonitorResource.\n // eslint-disable-next-line\n <AdvancedResourcePicker resources={resources as string[]} onChange={onChange} />\n )}\n selectionNotice={() => 'You may only choose items of the same resource type.'}\n range={range}\n />\n </EditorFieldGroup>\n </EditorRow>\n <EditorRow>\n <EditorFieldGroup>\n <TraceTypeField\n datasource={datasource}\n onQueryChange={onChange}\n query={query}\n setError={setError}\n variableOptionGroup={variableOptionGroup}\n range={range}\n />\n <Field label=\"Operation ID\">\n <Input\n id=\"azure-monitor-traces-operation-id-field\"\n value={operationId}\n onChange={handleChange}\n onBlur={handleBlur}\n width={40}\n />\n </Field>\n </EditorFieldGroup>\n </EditorRow>\n <EditorRow>\n <EditorFieldGroup>\n <Filters\n datasource={datasource}\n onQueryChange={onChange}\n query={query}\n setError={setError}\n variableOptionGroup={variableOptionGroup}\n range={range}\n />\n </EditorFieldGroup>\n </EditorRow>\n <EditorRow>\n <EditorFieldGroup>\n <FormatAsField\n datasource={datasource}\n setError={setError}\n query={query}\n variableOptionGroup={variableOptionGroup}\n onQueryChange={onChange}\n inputId=\"azure-monitor-traces\"\n options={[\n { label: 'Table', value: ResultFormat.Table },\n { label: 'Trace', value: ResultFormat.Trace },\n ]}\n defaultValue={ResultFormat.Table}\n setFormatAs={setFormatAs}\n resultFormat={query.azureTraces?.resultFormat}\n range={range}\n />\n </EditorFieldGroup>\n </EditorRow>\n </EditorRows>\n </span>\n );\n};\n\nexport default TracesQueryEditor;\n","import { setKustoQuery } from '../components/LogsQueryEditor/setQueryValue';\nimport {\n appendDimensionFilter,\n setTimeGrain as setMetricsTimeGrain,\n} from '../components/MetricsQueryEditor/setQueryValue';\nimport { parseResourceDetails } from '../components/ResourcePicker/utils';\nimport TimegrainConverter from '../time_grain_converter';\nimport { AzureMetricDimension, AzureMonitorQuery, AzureQueryType } from '../types';\n\nconst OLD_DEFAULT_DROPDOWN_VALUE = 'select';\n\nexport default function migrateQuery(query: AzureMonitorQuery): AzureMonitorQuery {\n let workingQuery = query;\n\n if (!workingQuery.queryType) {\n workingQuery = {\n ...workingQuery,\n queryType: AzureQueryType.AzureMonitor,\n };\n }\n\n workingQuery = migrateLogAnalyticsToFromTimes(workingQuery);\n if (workingQuery.queryType === AzureQueryType.AzureMonitor && workingQuery.azureMonitor) {\n workingQuery = migrateTimeGrains(workingQuery);\n workingQuery = migrateToDefaultNamespace(workingQuery);\n workingQuery = migrateDimensionToDimensionFilter(workingQuery);\n workingQuery = migrateDimensionFilterToArray(workingQuery);\n workingQuery = migrateResourceUriToResourceObj(workingQuery);\n }\n\n if (workingQuery.azureMonitor?.resourceGroup || workingQuery.azureMonitor?.resourceName) {\n workingQuery = migrateResourceGroupAndName(workingQuery);\n }\n\n if (workingQuery.azureLogAnalytics?.resource) {\n workingQuery = {\n ...workingQuery,\n azureLogAnalytics: {\n ...workingQuery.azureLogAnalytics,\n resources: [workingQuery.azureLogAnalytics.resource],\n },\n };\n\n delete workingQuery.azureLogAnalytics?.resource;\n }\n\n if (workingQuery.azureLogAnalytics && workingQuery.azureLogAnalytics.dashboardTime === undefined) {\n if (workingQuery.azureLogAnalytics.intersectTime) {\n workingQuery = {\n ...workingQuery,\n azureLogAnalytics: {\n ...workingQuery.azureLogAnalytics,\n dashboardTime: true,\n },\n };\n } else {\n workingQuery = {\n ...workingQuery,\n azureLogAnalytics: {\n ...workingQuery.azureLogAnalytics,\n dashboardTime: false,\n },\n };\n }\n }\n\n return workingQuery;\n}\n\nfunction migrateTimeGrains(query: AzureMonitorQuery): AzureMonitorQuery {\n let workingQuery = query;\n\n if (workingQuery.azureMonitor?.timeGrainUnit && workingQuery.azureMonitor.timeGrain !== 'auto') {\n const newTimeGrain = TimegrainConverter.createISO8601Duration(\n workingQuery.azureMonitor.timeGrain ?? 'auto',\n workingQuery.azureMonitor.timeGrainUnit\n );\n workingQuery = setMetricsTimeGrain(workingQuery, newTimeGrain);\n\n delete workingQuery.azureMonitor?.timeGrainUnit;\n }\n\n return workingQuery;\n}\n\nfunction migrateLogAnalyticsToFromTimes(query: AzureMonitorQuery): AzureMonitorQuery {\n let workingQuery = query;\n\n if (workingQuery.azureLogAnalytics?.query?.match(/\\$__from\\s/gi)) {\n workingQuery = setKustoQuery(\n workingQuery,\n workingQuery.azureLogAnalytics.query.replace(/\\$__from\\s/gi, '$__timeFrom() ')\n );\n }\n\n if (workingQuery.azureLogAnalytics?.query?.match(/\\$__to\\s/gi)) {\n workingQuery = setKustoQuery(\n workingQuery,\n workingQuery.azureLogAnalytics.query.replace(/\\$__to\\s/gi, '$__timeTo() ')\n );\n }\n\n return workingQuery;\n}\n\nfunction migrateToDefaultNamespace(query: AzureMonitorQuery): AzureMonitorQuery {\n const haveMetricNamespace =\n query.azureMonitor?.metricNamespace && query.azureMonitor.metricNamespace !== OLD_DEFAULT_DROPDOWN_VALUE;\n\n if (!haveMetricNamespace && query.azureMonitor?.metricDefinition) {\n return {\n ...query,\n azureMonitor: {\n ...query.azureMonitor,\n metricNamespace: query.azureMonitor.metricDefinition,\n metricDefinition: undefined,\n },\n };\n }\n\n return query;\n}\n\nfunction migrateDimensionToDimensionFilter(query: AzureMonitorQuery): AzureMonitorQuery {\n let workingQuery = query;\n\n const oldDimension = workingQuery.azureMonitor?.dimension;\n if (oldDimension && oldDimension !== 'None') {\n workingQuery = appendDimensionFilter(workingQuery, oldDimension, 'eq', [\n workingQuery.azureMonitor?.dimensionFilter || '',\n ]);\n }\n\n delete workingQuery.azureMonitor?.dimension;\n delete workingQuery.azureMonitor?.dimensionFilter;\n\n return workingQuery;\n}\n\nfunction migrateDimensionFilterToArray(query: AzureMonitorQuery): AzureMonitorQuery {\n const azureMonitorQuery = query.azureMonitor;\n\n if (!azureMonitorQuery) {\n return query;\n }\n\n const newFilters: AzureMetricDimension[] = [];\n const dimensionFilters = azureMonitorQuery.dimensionFilters;\n if (dimensionFilters && dimensionFilters.length > 0) {\n dimensionFilters.forEach((filter) => {\n const staticProps = { dimension: filter.dimension, operator: filter.operator };\n if (!filter.filters && filter.filter) {\n newFilters.push({ ...staticProps, filters: [filter.filter] });\n } else {\n let hasFilter = false;\n if (filter.filters && filter.filter) {\n for (const oldFilter of filter.filters) {\n if (filter.filter === oldFilter) {\n hasFilter = true;\n break;\n }\n }\n if (!hasFilter && filter.filter !== '*') {\n filter.filters.push(filter.filter);\n }\n newFilters.push({ ...staticProps, filters: filter.filters });\n }\n }\n });\n if (newFilters.length > 0) {\n return { ...query, azureMonitor: { ...azureMonitorQuery, dimensionFilters: newFilters } };\n }\n }\n return query;\n}\n\nfunction migrateResourceUriToResourceObj(query: AzureMonitorQuery): AzureMonitorQuery {\n if (query.azureMonitor?.resourceUri && !query.azureMonitor.resourceUri.startsWith('$')) {\n const details = parseResourceDetails(query.azureMonitor.resourceUri);\n const isWellFormedUri = details?.subscription && details?.resourceGroup && details?.resourceName;\n return {\n ...query,\n subscription: details?.subscription,\n azureMonitor: {\n ...query.azureMonitor,\n resources: [{ resourceGroup: details?.resourceGroup, resourceName: details?.resourceName }],\n metricNamespace: details?.metricNamespace,\n resourceUri: isWellFormedUri ? undefined : query.azureMonitor.resourceUri,\n },\n };\n }\n\n return query;\n}\n\nfunction migrateResourceGroupAndName(query: AzureMonitorQuery): AzureMonitorQuery {\n let workingQuery = query;\n\n if (workingQuery.azureMonitor?.resourceGroup && workingQuery.azureMonitor?.resourceName) {\n workingQuery = {\n ...workingQuery,\n azureMonitor: {\n ...workingQuery.azureMonitor,\n resources: [\n {\n resourceGroup: workingQuery.azureMonitor.resourceGroup,\n resourceName: workingQuery.azureMonitor.resourceName,\n },\n ],\n },\n };\n\n delete workingQuery.azureMonitor?.resourceGroup;\n delete workingQuery.azureMonitor?.resourceName;\n }\n\n return workingQuery;\n}\n","import deepEqual from 'fast-deep-equal';\nimport { defaults } from 'lodash';\nimport { useEffect, useMemo } from 'react';\n\nimport { AzureMonitorQuery, AzureQueryType } from '../../types';\nimport migrateQuery from '../../utils/migrateQuery';\n\nconst DEFAULT_QUERY = {\n queryType: AzureQueryType.AzureMonitor,\n};\n\nconst prepareQuery = (query: AzureMonitorQuery) => {\n // Note: _.defaults does not apply default values deeply.\n const withDefaults = defaults({}, query, DEFAULT_QUERY);\n const migratedQuery = migrateQuery(withDefaults);\n\n // If we didn't make any changes to the object, then return the original object to keep the\n // identity the same, and not trigger any other useEffects or anything.\n return deepEqual(migratedQuery, query) ? query : migratedQuery;\n};\n\n/**\n * Returns queries with some defaults + migrations, and calls onChange function to notify if it changes\n */\nconst usePreparedQuery = (query: AzureMonitorQuery, onChangeQuery: (newQuery: AzureMonitorQuery) => void) => {\n const preparedQuery = useMemo(() => prepareQuery(query), [query]);\n\n useEffect(() => {\n if (preparedQuery !== query) {\n onChangeQuery(preparedQuery);\n }\n }, [preparedQuery, query, onChangeQuery]);\n\n return preparedQuery;\n};\n\nexport default usePreparedQuery;\n","import { css } from '@emotion/css';\nimport { debounce } from 'lodash';\nimport React, { useCallback, useMemo, useState } from 'react';\n\nimport { QueryEditorProps } from '@grafana/data';\nimport { reportInteraction } from '@grafana/runtime';\nimport { Alert, Button, CodeEditor, Space } from '@grafana/ui';\n\nimport AzureMonitorDatasource from '../../datasource';\nimport {\n AzureDataSourceJsonData,\n AzureMonitorErrorish,\n AzureMonitorOption,\n AzureMonitorQuery,\n AzureQueryType,\n} from '../../types';\nimport useLastError from '../../utils/useLastError';\nimport ArgQueryEditor from '../ArgQueryEditor';\nimport LogsQueryEditor from '../LogsQueryEditor';\nimport { AzureCheatSheetModal } from '../LogsQueryEditor/AzureCheatSheetModal';\nimport NewMetricsQueryEditor from '../MetricsQueryEditor/MetricsQueryEditor';\nimport { QueryHeader } from '../QueryHeader';\nimport TracesQueryEditor from '../TracesQueryEditor';\n\nimport usePreparedQuery from './usePreparedQuery';\n\nexport type AzureMonitorQueryEditorProps = QueryEditorProps<\n AzureMonitorDatasource,\n AzureMonitorQuery,\n AzureDataSourceJsonData\n>;\n\nconst QueryEditor = ({\n query: baseQuery,\n datasource,\n onChange,\n onRunQuery: baseOnRunQuery,\n data,\n range,\n}: AzureMonitorQueryEditorProps) => {\n const [errorMessage, setError] = useLastError();\n const onRunQuery = useMemo(() => debounce(baseOnRunQuery, 500), [baseOnRunQuery]);\n const [azureLogsCheatSheetModalOpen, setAzureLogsCheatSheetModalOpen] = useState(false);\n\n const onQueryChange = useCallback(\n (newQuery: AzureMonitorQuery) => {\n onChange(newQuery);\n onRunQuery();\n },\n [onChange, onRunQuery]\n );\n\n const query = usePreparedQuery(baseQuery, onQueryChange);\n\n const subscriptionId = query.subscription || datasource.azureMonitorDatasource.defaultSubscriptionId;\n const variableOptionGroup = {\n label: 'Template Variables',\n options: datasource.getVariables().map((v) => ({ label: v, value: v })),\n };\n\n return (\n <div data-testid=\"azure-monitor-query-editor\">\n <AzureCheatSheetModal\n datasource={datasource.azureLogAnalyticsDatasource}\n isOpen={azureLogsCheatSheetModalOpen}\n onClose={() => setAzureLogsCheatSheetModalOpen(false)}\n onChange={(a) => onChange({ ...a, queryType: AzureQueryType.LogAnalytics })}\n />\n <div className={css({ display: 'flex', alignItems: 'center' })}>\n <QueryHeader query={query} onQueryChange={onQueryChange} />\n {query.queryType === AzureQueryType.LogAnalytics && (\n <Button\n aria-label=\"Azure logs kick start your query button\"\n variant=\"secondary\"\n size=\"sm\"\n onClick={() => {\n setAzureLogsCheatSheetModalOpen((prevValue) => !prevValue);\n\n reportInteraction('grafana_azure_logs_query_patterns_opened', {\n version: 'v2',\n editorMode: query.azureLogAnalytics,\n });\n }}\n >\n Kick start your query\n </Button>\n )}\n </div>\n <EditorForQueryType\n data={data}\n subscriptionId={subscriptionId}\n query={query}\n datasource={datasource}\n onChange={onQueryChange}\n variableOptionGroup={variableOptionGroup}\n setError={setError}\n range={range}\n />\n\n {errorMessage && (\n <>\n <Space v={2} />\n <Alert severity=\"error\" title=\"An error occurred while requesting metadata from Azure Monitor\">\n {errorMessage instanceof Error ? errorMessage.message : errorMessage}\n </Alert>\n </>\n )}\n </div>\n );\n};\n\ninterface EditorForQueryTypeProps extends Omit<AzureMonitorQueryEditorProps, 'onRunQuery'> {\n subscriptionId?: string;\n variableOptionGroup: { label: string; options: AzureMonitorOption[] };\n setError: (source: string, error: AzureMonitorErrorish | undefined) => void;\n}\n\nconst EditorForQueryType = ({\n data,\n subscriptionId,\n query,\n datasource,\n variableOptionGroup,\n onChange,\n setError,\n range,\n}: EditorForQueryTypeProps) => {\n switch (query.queryType) {\n case AzureQueryType.AzureMonitor:\n return (\n <NewMetricsQueryEditor\n data={data}\n query={query}\n datasource={datasource}\n onChange={onChange}\n variableOptionGroup={variableOptionGroup}\n setError={setError}\n />\n );\n\n case AzureQueryType.LogAnalytics:\n return (\n <LogsQueryEditor\n data={data}\n subscriptionId={subscriptionId}\n query={query}\n datasource={datasource}\n onChange={onChange}\n variableOptionGroup={variableOptionGroup}\n setError={setError}\n timeRange={range}\n />\n );\n\n case AzureQueryType.AzureResourceGraph:\n return (\n <ArgQueryEditor\n subscriptionId={subscriptionId}\n query={query}\n datasource={datasource}\n onChange={onChange}\n variableOptionGroup={variableOptionGroup}\n setError={setError}\n />\n );\n\n case AzureQueryType.AzureTraces:\n return (\n <TracesQueryEditor\n subscriptionId={subscriptionId}\n query={query}\n datasource={datasource}\n onChange={onChange}\n variableOptionGroup={variableOptionGroup}\n setError={setError}\n range={range}\n />\n );\n\n default:\n const type = query.queryType as unknown;\n return (\n <Alert title=\"Unknown query type\">\n {(type === 'Application Insights' || type === 'Insights Analytics') && (\n <>\n {type} was deprecated in Grafana 9. See the{' '}\n <a\n href=\"https://grafana.com/docs/grafana/latest/datasources/azuremonitor/deprecated-application-insights/\"\n target=\"_blank\"\n rel=\"noreferrer\"\n >\n deprecation notice\n </a>{' '}\n to get more information about how to migrate your queries. This is the current query definition:\n <CodeEditor height=\"200px\" readOnly language=\"json\" value={JSON.stringify(query, null, 4)} />\n </>\n )}\n </Alert>\n );\n }\n};\n\nexport default QueryEditor;\n","import { TypedVariableModel } from '@grafana/data';\n\nimport { EngineSchema } from '../types';\nimport { AzureLogAnalyticsMetadata } from '../types/logAnalyticsMetadata';\n\n// matches (name):(type) = (defaultValue)\n// e.g. fromRangeStart:datetime = datetime(null)\n// - name: fromRangeStart\n// - type: datetime\n// - defaultValue: datetime(null)\nconst METADATA_FUNCTION_PARAMS = /([\\w\\W]+):([\\w]+)(?:\\s?=\\s?([\\w\\W]+))?/;\n\nfunction transformMetadataFunction(sourceSchema: AzureLogAnalyticsMetadata) {\n if (!sourceSchema.functions) {\n return [];\n }\n\n return sourceSchema.functions.map((fn) => {\n const params =\n fn.parameters &&\n fn.parameters\n .split(', ')\n .map((arg) => {\n const match = arg.match(METADATA_FUNCTION_PARAMS);\n if (!match) {\n return;\n }\n\n const [, name, type, defaultValue] = match;\n\n return {\n name,\n type,\n defaultValue,\n cslDefaultValue: defaultValue,\n };\n })\n .filter(<T>(v: T): v is Exclude<T, undefined> => !!v);\n\n return {\n name: fn.name,\n body: fn.body,\n inputParameters: params || [],\n };\n });\n}\n\nexport function transformMetadataToKustoSchema(\n sourceSchema: AzureLogAnalyticsMetadata,\n nameOrIdOrSomething: string,\n templateVariables: TypedVariableModel[]\n): EngineSchema {\n const database = {\n name: nameOrIdOrSomething,\n tables: sourceSchema.tables,\n functions: transformMetadataFunction(sourceSchema),\n majorVersion: 0,\n minorVersion: 0,\n };\n\n // Adding macros as known functions\n database.functions.push(\n {\n name: '$__timeFilter',\n body: '{ true }',\n inputParameters: [\n {\n name: 'timeColumn',\n type: 'System.String',\n defaultValue: '\"\"',\n cslDefaultValue: '\"\"',\n },\n ],\n },\n {\n name: '$__timeFrom',\n body: '{ datetime(2018-06-05T18:09:58.907Z) }',\n inputParameters: [],\n },\n {\n name: '$__timeTo',\n body: '{ datetime(2018-06-05T20:09:58.907Z) }',\n inputParameters: [],\n },\n {\n name: '$__escapeMulti',\n body: `{ @'\\\\grafana-vm\\Network(eth0)\\Total', @'\\\\hello!'}`,\n inputParameters: [\n {\n name: '$myVar',\n type: 'System.String',\n defaultValue: '$myVar',\n cslDefaultValue: '$myVar',\n },\n ],\n },\n {\n name: '$__contains',\n body: `{ colName in ('value1','value2') }`,\n inputParameters: [\n {\n name: 'colName',\n type: 'System.String',\n defaultValue: 'colName',\n cslDefaultValue: 'colName',\n },\n {\n name: '$myVar',\n type: 'System.String',\n defaultValue: '$myVar',\n cslDefaultValue: '$myVar',\n },\n ],\n }\n );\n\n // Adding macros as global parameters\n const globalScalarParameters = templateVariables.map((v) => {\n return {\n name: `$${v.name}`,\n type: 'dynamic',\n };\n });\n\n return {\n clusterType: 'Engine',\n cluster: {\n connectionString: nameOrIdOrSomething,\n databases: [database],\n },\n database: database,\n globalScalarParameters,\n };\n}\n","import { map } from 'lodash';\n\nimport { DataSourceInstanceSettings, ScopedVars } from '@grafana/data';\nimport { DataSourceWithBackend, getTemplateSrv, TemplateSrv } from '@grafana/runtime';\n\nimport ResponseParser from '../azure_monitor/response_parser';\nimport { getAuthType, getAzureCloud, getAzurePortalUrl } from '../credentials';\nimport {\n AzureAPIResponse,\n AzureDataSourceJsonData,\n AzureLogsVariable,\n AzureMonitorQuery,\n AzureQueryType,\n DatasourceValidationResult,\n Subscription,\n Workspace,\n} from '../types';\nimport { interpolateVariable, routeNames } from '../utils/common';\n\nimport { transformMetadataToKustoSchema } from './utils';\n\nexport default class AzureLogAnalyticsDatasource extends DataSourceWithBackend<\n AzureMonitorQuery,\n AzureDataSourceJsonData\n> {\n resourcePath: string;\n azurePortalUrl: string;\n declare applicationId: string;\n\n defaultSubscriptionId?: string;\n\n azureMonitorPath: string;\n firstWorkspace?: string;\n\n constructor(\n private instanceSettings: DataSourceInstanceSettings<AzureDataSourceJsonData>,\n private readonly templateSrv: TemplateSrv = getTemplateSrv()\n ) {\n super(instanceSettings);\n\n this.resourcePath = `${routeNames.logAnalytics}`;\n this.azureMonitorPath = `${routeNames.azureMonitor}/subscriptions`;\n const cloud = getAzureCloud(instanceSettings);\n this.azurePortalUrl = getAzurePortalUrl(cloud);\n\n this.defaultSubscriptionId = this.instanceSettings.jsonData.subscriptionId || '';\n }\n\n isConfigured(): boolean {\n // If validation didn't return any error then the data source is properly configured\n return !this.validateDatasource();\n }\n\n filterQuery(item: AzureMonitorQuery): boolean {\n return (\n item.hide !== true &&\n ((!!item.azureLogAnalytics?.query &&\n (!!item.azureLogAnalytics.resources?.length || !!item.azureLogAnalytics.workspace)) ||\n !!item.azureTraces?.resources?.length)\n );\n }\n\n async getSubscriptions(): Promise<Array<{ text: string; value: string }>> {\n if (!this.isConfigured()) {\n return [];\n }\n\n const path = `${this.azureMonitorPath}?api-version=2019-03-01`;\n return await this.getResource<AzureAPIResponse<Subscription>>(path).then((result) => {\n return ResponseParser.parseSubscriptions(result);\n });\n }\n\n async getWorkspaces(subscription: string): Promise<AzureLogsVariable[]> {\n const response = await this.getWorkspaceList(subscription);\n\n return (\n map(response.value, (val: Workspace) => {\n return {\n text: val.name,\n value: val.id,\n };\n }) || []\n );\n }\n\n private getWorkspaceList(subscription: string): Promise<AzureAPIResponse<Workspace>> {\n const subscriptionId = this.templateSrv.replace(subscription || this.defaultSubscriptionId);\n\n const workspaceListUrl =\n this.azureMonitorPath +\n `/${subscriptionId}/providers/Microsoft.OperationalInsights/workspaces?api-version=2017-04-26-preview`;\n return this.getResource<AzureAPIResponse<Workspace>>(workspaceListUrl);\n }\n\n async getMetadata(resourceUri: string) {\n const path = `${this.resourcePath}/v1${resourceUri}/metadata`;\n\n const resp = await this.getResource(path);\n return resp;\n }\n\n async getKustoSchema(resourceUri: string) {\n const interpolatedUri = this.templateSrv.replace(resourceUri, {}, interpolateVariable);\n const metadata = await this.getMetadata(interpolatedUri);\n return transformMetadataToKustoSchema(metadata, interpolatedUri, this.templateSrv.getVariables());\n }\n\n applyTemplateVariables(target: AzureMonitorQuery, scopedVars: ScopedVars): AzureMonitorQuery {\n let item;\n if (target.queryType === AzureQueryType.LogAnalytics && target.azureLogAnalytics) {\n item = target.azureLogAnalytics;\n const resources = this.expandResourcesForMultipleVariables(item.resources, scopedVars);\n let workspace = this.templateSrv.replace(item.workspace, scopedVars);\n\n if (!workspace && !resources && this.firstWorkspace) {\n workspace = this.firstWorkspace;\n }\n\n const query = this.templateSrv.replace(item.query, scopedVars, interpolateVariable);\n\n return {\n ...target,\n queryType: target.queryType || AzureQueryType.LogAnalytics,\n\n azureLogAnalytics: {\n resultFormat: item.resultFormat,\n query,\n resources,\n // Workspace was removed in Grafana 8, but remains for backwards compat\n workspace,\n dashboardTime: item.dashboardTime,\n timeColumn: this.templateSrv.replace(item.timeColumn, scopedVars),\n },\n };\n }\n\n if (target.queryType === AzureQueryType.AzureTraces && target.azureTraces) {\n item = target.azureTraces;\n const resources = this.expandResourcesForMultipleVariables(item.resources, scopedVars);\n const query = this.templateSrv.replace(item.query, scopedVars, interpolateVariable);\n const traceTypes = item.traceTypes?.map((t) => this.templateSrv.replace(t, scopedVars));\n const filters = (item.filters ?? [])\n .filter((f) => !!f.property)\n .map((f) => {\n const filtersReplaced = f.filters?.map((filter) => this.templateSrv.replace(filter ?? '', scopedVars));\n return {\n property: this.templateSrv.replace(f.property, scopedVars),\n operation: f.operation || 'eq',\n filters: filtersReplaced || [],\n };\n });\n\n return {\n ...target,\n queryType: target.queryType || AzureQueryType.AzureTraces,\n\n azureTraces: {\n resultFormat: item.resultFormat,\n query,\n resources,\n operationId: this.templateSrv.replace(target.azureTraces?.operationId, scopedVars),\n filters,\n traceTypes,\n },\n };\n }\n\n return target;\n }\n\n private expandResourcesForMultipleVariables(\n resources: string[] | undefined,\n scopedVars: ScopedVars\n ): string[] | undefined {\n if (!resources) {\n return undefined;\n }\n const expandedResources: string[] = [];\n resources.forEach((r: string) => {\n const tempVars = this.templateSrv.replace(r, scopedVars, 'raw');\n const values = tempVars.split(',');\n values.forEach((value) => {\n expandedResources.push(value);\n });\n });\n return expandedResources;\n }\n\n /*\n In 7.5.x it used to be possible to set a default workspace id in the config on the auth page.\n This has been deprecated, however is still used by a few legacy template queries.\n */\n getDeprecatedDefaultWorkSpace() {\n return this.instanceSettings.jsonData.logAnalyticsDefaultWorkspace;\n }\n\n async getDefaultOrFirstSubscription(): Promise<string | undefined> {\n if (this.defaultSubscriptionId) {\n return this.defaultSubscriptionId;\n }\n const subscriptions = await this.getSubscriptions();\n return subscriptions[0]?.value;\n }\n\n async getFirstWorkspace(): Promise<string | undefined> {\n if (this.firstWorkspace) {\n return this.firstWorkspace;\n }\n\n const subscriptionId = await this.getDefaultOrFirstSubscription();\n if (!subscriptionId) {\n return undefined;\n }\n\n const workspaces = await this.getWorkspaces(subscriptionId);\n const workspace = workspaces[0]?.value;\n\n if (workspace) {\n this.firstWorkspace = workspace;\n }\n\n return workspace;\n }\n\n private validateDatasource(): DatasourceValidationResult | undefined {\n const authType = getAuthType(this.instanceSettings);\n\n if (authType === 'clientsecret') {\n if (!this.isValidConfigField(this.instanceSettings.jsonData.tenantId)) {\n return {\n status: 'error',\n message: 'The Tenant Id field is required.',\n };\n }\n\n if (!this.isValidConfigField(this.instanceSettings.jsonData.clientId)) {\n return {\n status: 'error',\n message: 'The Client Id field is required.',\n };\n }\n }\n\n return undefined;\n }\n\n private isValidConfigField(field: string | undefined): boolean {\n return typeof field === 'string' && field.length > 0;\n }\n\n async getAzureLogAnalyticsCheatsheetQueries() {\n return await this.getResource(`${this.resourcePath}/v1/metadata`);\n }\n}\n","import { Namespace } from 'i18next';\nimport { find, startsWith } from 'lodash';\n\nimport { DataSourceInstanceSettings, ScopedVars } from '@grafana/data';\nimport { DataSourceWithBackend, getTemplateSrv, TemplateSrv } from '@grafana/runtime';\n\nimport { getAuthType, getAzureCloud, getAzurePortalUrl } from '../credentials';\nimport TimegrainConverter from '../time_grain_converter';\nimport {\n AzureDataSourceJsonData,\n AzureMonitorMetricsMetadataResponse,\n AzureMonitorQuery,\n AzureQueryType,\n DatasourceValidationResult,\n GetMetricNamespacesQuery,\n GetMetricNamesQuery,\n GetMetricMetadataQuery,\n AzureMetricQuery,\n AzureMonitorLocations,\n AzureMonitorProvidersResponse,\n AzureAPIResponse,\n AzureGetResourceNamesQuery,\n Subscription,\n Location,\n ResourceGroup,\n Metric,\n} from '../types';\nimport { routeNames } from '../utils/common';\nimport migrateQuery from '../utils/migrateQuery';\n\nimport ResponseParser from './response_parser';\nimport UrlBuilder from './url_builder';\n\nconst defaultDropdownValue = 'select';\n\nfunction hasValue(item?: string) {\n return !!(item && item !== defaultDropdownValue);\n}\n\nexport default class AzureMonitorDatasource extends DataSourceWithBackend<AzureMonitorQuery, AzureDataSourceJsonData> {\n apiVersion = '2018-01-01';\n apiPreviewVersion = '2017-12-01-preview';\n listByResourceGroupApiVersion = '2021-04-01';\n providerApiVersion = '2021-04-01';\n locationsApiVersion = '2020-01-01';\n defaultSubscriptionId?: string;\n resourcePath: string;\n azurePortalUrl: string;\n declare resourceGroup: string;\n declare resourceName: string;\n\n constructor(\n private instanceSettings: DataSourceInstanceSettings<AzureDataSourceJsonData>,\n private readonly templateSrv: TemplateSrv = getTemplateSrv()\n ) {\n super(instanceSettings);\n\n this.defaultSubscriptionId = instanceSettings.jsonData.subscriptionId;\n\n const cloud = getAzureCloud(instanceSettings);\n this.resourcePath = routeNames.azureMonitor;\n this.azurePortalUrl = getAzurePortalUrl(cloud);\n }\n\n isConfigured(): boolean {\n // If validation didn't return any error then the data source is properly configured\n return !this.validateDatasource();\n }\n\n filterQuery(item: AzureMonitorQuery): boolean {\n const hasResource =\n item?.azureMonitor?.resources &&\n item.azureMonitor.resources.length > 0 &&\n item.azureMonitor.resources.every((r) => hasValue(r.resourceGroup) && hasValue(r.resourceName)) &&\n hasValue(item?.azureMonitor?.metricDefinition || item?.azureMonitor?.metricNamespace);\n const hasResourceUri = hasValue(item.azureMonitor?.resourceUri);\n\n return !!(\n item.hide !== true &&\n (hasResource || hasResourceUri) &&\n hasValue(item?.azureMonitor?.metricName) &&\n hasValue(item?.azureMonitor?.aggregation)\n );\n }\n\n applyTemplateVariables(target: AzureMonitorQuery, scopedVars: ScopedVars): AzureMonitorQuery {\n const preMigrationQuery = target.azureMonitor;\n\n if (!preMigrationQuery) {\n throw new Error('Query is not a valid Azure Monitor Metrics query');\n }\n\n // These properties need to be replaced pre-migration to ensure values are correctly interpolated\n if (preMigrationQuery.resourceUri) {\n preMigrationQuery.resourceUri = this.templateSrv.replace(preMigrationQuery.resourceUri, scopedVars);\n }\n if (preMigrationQuery.metricDefinition) {\n preMigrationQuery.metricDefinition = this.templateSrv.replace(preMigrationQuery.metricDefinition, scopedVars);\n }\n\n // fix for timeGrainUnit which is a deprecated/removed field name\n if (preMigrationQuery.timeGrain && preMigrationQuery.timeGrainUnit && preMigrationQuery.timeGrain !== 'auto') {\n preMigrationQuery.timeGrain = TimegrainConverter.createISO8601Duration(\n preMigrationQuery.timeGrain,\n preMigrationQuery.timeGrainUnit\n );\n }\n\n const migratedTarget = migrateQuery(target);\n const migratedQuery = migratedTarget.azureMonitor;\n // This should never be triggered because the above error would've been thrown\n if (!migratedQuery) {\n throw new Error('Query is not a valid Azure Monitor Metrics query');\n }\n\n const subscriptionId = this.templateSrv.replace(\n migratedTarget.subscription || this.defaultSubscriptionId,\n scopedVars\n );\n const resources = migratedQuery.resources?.map((r) => this.replaceTemplateVariables(r, scopedVars)).flat();\n const metricNamespace = this.templateSrv.replace(migratedQuery.metricNamespace, scopedVars);\n const customNamespace = this.templateSrv.replace(migratedQuery.customNamespace, scopedVars);\n const timeGrain = this.templateSrv.replace((migratedQuery.timeGrain || '').toString(), scopedVars);\n const aggregation = this.templateSrv.replace(migratedQuery.aggregation, scopedVars);\n const top = this.templateSrv.replace(migratedQuery.top || '', scopedVars);\n\n const dimensionFilters = (migratedQuery.dimensionFilters ?? [])\n .filter((f) => f.dimension && f.dimension !== 'None')\n .map((f) => {\n const filters = f.filters?.map((filter) => this.templateSrv.replace(filter ?? '', scopedVars));\n return {\n dimension: this.templateSrv.replace(f.dimension, scopedVars),\n operator: f.operator || 'eq',\n filters: filters || [],\n };\n });\n\n const azMonitorQuery: AzureMetricQuery = {\n ...migratedQuery,\n resources,\n metricNamespace,\n customNamespace,\n timeGrain,\n allowedTimeGrainsMs: migratedQuery.allowedTimeGrainsMs,\n metricName: this.templateSrv.replace(migratedQuery.metricName, scopedVars),\n region: this.templateSrv.replace(migratedQuery.region, scopedVars),\n aggregation: aggregation,\n dimensionFilters,\n top: top || '10',\n alias: migratedQuery.alias,\n };\n\n return {\n ...target,\n subscription: subscriptionId,\n queryType: AzureQueryType.AzureMonitor,\n azureMonitor: azMonitorQuery,\n };\n }\n\n async getSubscriptions(): Promise<Array<{ text: string; value: string }>> {\n if (!this.isConfigured()) {\n return [];\n }\n\n return this.getResource<AzureAPIResponse<Subscription>>(\n `${this.resourcePath}/subscriptions?api-version=2019-03-01`\n ).then((result) => {\n return ResponseParser.parseSubscriptions(result);\n });\n }\n\n getResourceGroups(subscriptionId: string) {\n return this.getResource(\n `${this.resourcePath}/subscriptions/${subscriptionId}/resourceGroups?api-version=${this.listByResourceGroupApiVersion}`\n ).then((result: AzureAPIResponse<ResourceGroup>) => {\n return ResponseParser.parseResponseValues<ResourceGroup>(result, 'name', 'name');\n });\n }\n\n async getResourceNames(query: AzureGetResourceNamesQuery, skipToken?: string) {\n const promises = this.replaceTemplateVariables(query).map(\n ({ metricNamespace, subscriptionId, resourceGroup, region }) => {\n const validMetricNamespace = startsWith(metricNamespace?.toLowerCase(), 'microsoft.storage/storageaccounts/')\n ? 'microsoft.storage/storageaccounts'\n : metricNamespace;\n let url = `${this.resourcePath}/subscriptions/${subscriptionId}`;\n if (resourceGroup) {\n url += `/resourceGroups/${resourceGroup}`;\n }\n url += `/resources?api-version=${this.listByResourceGroupApiVersion}`;\n const filters: string[] = [];\n if (validMetricNamespace) {\n filters.push(`resourceType eq '${validMetricNamespace}'`);\n }\n if (region) {\n filters.push(`location eq '${region}'`);\n }\n if (filters.length > 0) {\n url += `&$filter=${filters.join(' and ')}`;\n }\n if (skipToken) {\n url += `&$skiptoken=${skipToken}`;\n }\n return this.getResource(url).then(async (result) => {\n let list: Array<{ text: string; value: string }> = [];\n if (startsWith(metricNamespace?.toLowerCase(), 'microsoft.storage/storageaccounts/')) {\n list = ResponseParser.parseResourceNames(result, 'microsoft.storage/storageaccounts');\n for (let i = 0; i < list.length; i++) {\n list[i].text += '/default';\n list[i].value += '/default';\n }\n } else {\n list = ResponseParser.parseResourceNames(result, metricNamespace);\n }\n\n if (result.nextLink) {\n // If there is a nextLink, we should request more pages\n const nextURL = new URL(result.nextLink);\n const nextToken = nextURL.searchParams.get('$skiptoken');\n if (!nextToken) {\n throw Error('unable to request the next page of resources');\n }\n const nextPage = await this.getResourceNames({ metricNamespace, subscriptionId, resourceGroup }, nextToken);\n list = list.concat(nextPage);\n }\n\n return list;\n });\n }\n );\n return (await Promise.all(promises)).flat();\n }\n\n getMetricNamespaces(query: GetMetricNamespacesQuery, globalRegion: boolean) {\n const url = UrlBuilder.buildAzureMonitorGetMetricNamespacesUrl(\n this.resourcePath,\n this.apiPreviewVersion,\n // Only use the first query, as the metric namespaces should be the same for all queries\n this.replaceSingleTemplateVariables(query),\n globalRegion,\n this.templateSrv\n );\n return this.getResource(url)\n .then((result: AzureAPIResponse<Namespace>) => {\n return ResponseParser.parseResponseValues(\n result,\n 'properties.metricNamespaceName',\n 'properties.metricNamespaceName'\n );\n })\n .then((result) => {\n if (url.toLowerCase().includes('microsoft.storage/storageaccounts')) {\n const storageNamespaces = [\n 'microsoft.storage/storageaccounts',\n 'microsoft.storage/storageaccounts/blobservices',\n 'microsoft.storage/storageaccounts/fileservices',\n 'microsoft.storage/storageaccounts/tableservices',\n 'microsoft.storage/storageaccounts/queueservices',\n ];\n for (const namespace of storageNamespaces) {\n if (!find(result, ['value', namespace.toLowerCase()])) {\n result.push({ value: namespace, text: namespace });\n }\n }\n }\n return result;\n });\n }\n\n getMetricNames(query: GetMetricNamesQuery, multipleResources?: boolean, region?: string) {\n const apiVersion = multipleResources ? this.apiPreviewVersion : this.apiVersion;\n const url = UrlBuilder.buildAzureMonitorGetMetricNamesUrl(\n this.resourcePath,\n apiVersion,\n // Only use the first query, as the metric names should be the same for all queries\n this.replaceSingleTemplateVariables(query),\n this.templateSrv,\n multipleResources,\n region\n );\n return this.getResource(url).then((result: AzureAPIResponse<Metric>) => {\n return ResponseParser.parseResponseValues(result, 'name.localizedValue', 'name.value');\n });\n }\n\n getMetricMetadata(query: GetMetricMetadataQuery, multipleResources?: boolean, region?: string) {\n const { metricName } = query;\n const apiVersion = multipleResources ? this.apiPreviewVersion : this.apiVersion;\n const url = UrlBuilder.buildAzureMonitorGetMetricNamesUrl(\n this.resourcePath,\n apiVersion,\n // Only use the first query, as the metric metadata should be the same for all queries\n this.replaceSingleTemplateVariables(query),\n this.templateSrv,\n multipleResources,\n region\n );\n return this.getResource(url).then((result: AzureMonitorMetricsMetadataResponse) => {\n return ResponseParser.parseMetadata(result, this.templateSrv.replace(metricName));\n });\n }\n\n private validateDatasource(): DatasourceValidationResult | undefined {\n const authType = getAuthType(this.instanceSettings);\n\n if (authType === 'clientsecret') {\n if (!this.isValidConfigField(this.instanceSettings.jsonData.tenantId)) {\n return {\n status: 'error',\n message: 'The Tenant Id field is required.',\n };\n }\n\n if (!this.isValidConfigField(this.instanceSettings.jsonData.clientId)) {\n return {\n status: 'error',\n message: 'The Client Id field is required.',\n };\n }\n }\n\n return undefined;\n }\n\n private isValidConfigField(field?: string): boolean {\n return typeof field === 'string' && field.length > 0;\n }\n\n private replaceSingleTemplateVariables<T extends { [K in keyof T]: string }>(query: T, scopedVars?: ScopedVars) {\n // This method evaluates template variables supporting multiple values but only returns the first value.\n // This will work as far as the the first combination of variables is valid.\n // For example if 'rg1' contains 'res1' and 'rg2' contains 'res2' then\n // { resourceGroup: ['rg1', 'rg2'], resourceName: ['res1', 'res2'] } would return\n // { resourceGroup: 'rg1', resourceName: 'res1' } which is valid but\n // { resourceGroup: ['rg1', 'rg2'], resourceName: ['res2'] } would result in\n // { resourceGroup: 'rg1', resourceName: 'res2' } which is not.\n return this.replaceTemplateVariables(query, scopedVars)[0];\n }\n\n private replaceTemplateVariables<T extends { [K in keyof T]: string }>(query: T, scopedVars?: ScopedVars) {\n const workingQueries: Array<{ [K in keyof T]: string }> = [{ ...query }];\n const keys = Object.keys(query) as Array<keyof T>;\n keys.forEach((key) => {\n const replaced = this.templateSrv.replace(workingQueries[0][key], scopedVars, 'raw');\n if (replaced.includes(',')) {\n const multiple = replaced.split(',');\n const currentQueries = [...workingQueries];\n multiple.forEach((value, i) => {\n currentQueries.forEach((q) => {\n if (i === 0) {\n q[key] = value;\n } else {\n workingQueries.push({ ...q, [key]: value });\n }\n });\n });\n } else {\n workingQueries.forEach((q) => {\n q[key] = replaced;\n });\n }\n });\n\n return workingQueries;\n }\n\n async getProvider(providerName: string) {\n return await this.getResource<AzureMonitorProvidersResponse>(\n `${routeNames.azureMonitor}/providers/${providerName}?api-version=${this.providerApiVersion}`\n );\n }\n\n async getLocations(subscriptions: string[]) {\n const locationMap = new Map<string, AzureMonitorLocations>();\n for (const subscription of subscriptions) {\n const subLocations = ResponseParser.parseLocations(\n await this.getResource<AzureAPIResponse<Location>>(\n `${routeNames.azureMonitor}/subscriptions/${this.templateSrv.replace(subscription)}/locations?api-version=${\n this.locationsApiVersion\n }`\n )\n );\n for (const location of subLocations) {\n locationMap.set(location.name, location);\n }\n }\n\n return locationMap;\n }\n}\n","// eslint-disable-next-line lodash/import-scope\nimport _ from 'lodash';\n\nimport { ScopedVars } from '@grafana/data';\nimport { getTemplateSrv, DataSourceWithBackend } from '@grafana/runtime';\n\nimport { AzureMonitorQuery, AzureDataSourceJsonData, AzureQueryType } from '../types';\nimport { interpolateVariable } from '../utils/common';\n\nexport default class AzureResourceGraphDatasource extends DataSourceWithBackend<\n AzureMonitorQuery,\n AzureDataSourceJsonData\n> {\n filterQuery(item: AzureMonitorQuery): boolean {\n return !!item.azureResourceGraph?.query && !!item.subscriptions && item.subscriptions.length > 0;\n }\n\n applyTemplateVariables(target: AzureMonitorQuery, scopedVars: ScopedVars): AzureMonitorQuery {\n const ts = getTemplateSrv();\n const item = target.azureResourceGraph;\n if (!item) {\n return target;\n }\n const variableNames = ts.getVariables().map((v) => `$${v.name}`);\n const subscriptionVar = _.find(target.subscriptions, (sub) => _.includes(variableNames, sub));\n const interpolatedSubscriptions = ts\n .replace(subscriptionVar, scopedVars, (v: string[] | string) => v)\n .split(',')\n .filter((v) => v.length > 0);\n const subscriptions = [\n ...interpolatedSubscriptions,\n ..._.filter(target.subscriptions, (sub) => !_.includes(variableNames, sub)),\n ];\n const query = ts.replace(item.query, scopedVars, interpolateVariable);\n\n return {\n ...target,\n queryType: AzureQueryType.AzureResourceGraph,\n subscriptions,\n azureResourceGraph: {\n resultFormat: 'table',\n query,\n },\n };\n }\n}\n","import { uniq } from 'lodash';\n\nimport { DataSourceInstanceSettings } from '@grafana/data';\nimport { DataSourceWithBackend, reportInteraction } from '@grafana/runtime';\n\nimport { logsResourceTypes, resourceTypeDisplayNames, resourceTypes } from '../azureMetadata';\nimport AzureMonitorDatasource from '../azure_monitor/azure_monitor_datasource';\nimport { ResourceRow, ResourceRowGroup, ResourceRowType } from '../components/ResourcePicker/types';\nimport {\n addResources,\n findRow,\n parseMultipleResourceDetails,\n parseResourceDetails,\n parseResourceURI,\n resourceToString,\n} from '../components/ResourcePicker/utils';\nimport {\n AzureDataSourceJsonData,\n AzureGraphResponse,\n AzureMonitorResource,\n AzureMonitorQuery,\n AzureResourceGraphOptions,\n AzureResourceSummaryItem,\n RawAzureResourceGroupItem,\n RawAzureResourceItem,\n RawAzureSubscriptionItem,\n} from '../types';\nimport { routeNames } from '../utils/common';\n\nconst RESOURCE_GRAPH_URL = '/providers/Microsoft.ResourceGraph/resources?api-version=2021-03-01';\n\nconst logsSupportedResourceTypesKusto = logsResourceTypes.map((v) => `\"${v}\"`).join(',');\n\nexport type ResourcePickerQueryType = 'logs' | 'metrics' | 'traces';\n\nexport default class ResourcePickerData extends DataSourceWithBackend<AzureMonitorQuery, AzureDataSourceJsonData> {\n private resourcePath: string;\n resultLimit = 200;\n azureMonitorDatasource;\n supportedMetricNamespaces = '';\n\n constructor(\n instanceSettings: DataSourceInstanceSettings<AzureDataSourceJsonData>,\n azureMonitorDatasource: AzureMonitorDatasource\n ) {\n super(instanceSettings);\n this.resourcePath = `${routeNames.resourceGraph}`;\n this.azureMonitorDatasource = azureMonitorDatasource;\n }\n\n async fetchInitialRows(\n type: ResourcePickerQueryType,\n currentSelection?: AzureMonitorResource[]\n ): Promise<ResourceRowGroup> {\n const subscriptions = await this.getSubscriptions();\n\n if (!currentSelection) {\n return subscriptions;\n }\n\n let resources = subscriptions;\n const promises = currentSelection.map((selection) => async () => {\n if (selection.subscription) {\n const resourceGroupURI = `/subscriptions/${selection.subscription}/resourceGroups/${selection.resourceGroup}`;\n\n if (selection.resourceGroup && !findRow(resources, resourceGroupURI)) {\n const resourceGroups = await this.getResourceGroupsBySubscriptionId(selection.subscription, type);\n resources = addResources(resources, `/subscriptions/${selection.subscription}`, resourceGroups);\n }\n\n const resourceURI = resourceToString(selection);\n if (selection.resourceName && !findRow(resources, resourceURI)) {\n const resourcesForResourceGroup = await this.getResourcesForResourceGroup(resourceGroupURI, type);\n resources = addResources(resources, resourceGroupURI, resourcesForResourceGroup);\n }\n }\n });\n\n for (const promise of promises) {\n // Fetch resources one by one, avoiding re-fetching the same resource\n // and race conditions updating the resources array\n await promise();\n }\n\n return resources;\n }\n\n async fetchAndAppendNestedRow(\n rows: ResourceRowGroup,\n parentRow: ResourceRow,\n type: ResourcePickerQueryType\n ): Promise<ResourceRowGroup> {\n const nestedRows =\n parentRow.type === ResourceRowType.Subscription\n ? await this.getResourceGroupsBySubscriptionId(parentRow.id, type)\n : await this.getResourcesForResourceGroup(parentRow.uri, type);\n\n return addResources(rows, parentRow.uri, nestedRows);\n }\n\n search = async (searchPhrase: string, searchType: ResourcePickerQueryType): Promise<ResourceRowGroup> => {\n let searchQuery = 'resources';\n if (searchType === 'logs') {\n searchQuery += `\n | union resourcecontainers`;\n }\n searchQuery += `\n | where id contains \"${searchPhrase}\"\n ${await this.filterByType(searchType)}\n | order by tolower(name) asc\n | limit ${this.resultLimit}\n `;\n const { data: response } = await this.makeResourceGraphRequest<RawAzureResourceItem[]>(searchQuery);\n return response.map((item) => {\n const parsedUri = parseResourceURI(item.id);\n if (!parsedUri || !(parsedUri.resourceName || parsedUri.resourceGroup || parsedUri.subscription)) {\n throw new Error('unable to fetch resource details');\n }\n let id = parsedUri.subscription ?? '';\n let type = ResourceRowType.Subscription;\n if (parsedUri.resourceName) {\n id = parsedUri.resourceName;\n type = ResourceRowType.Resource;\n } else if (parsedUri.resourceGroup) {\n id = parsedUri.resourceGroup;\n type = ResourceRowType.ResourceGroup;\n }\n return {\n name: item.name,\n id,\n uri: item.id,\n resourceGroupName: item.resourceGroup,\n type,\n typeLabel: resourceTypeDisplayNames[item.type] || item.type,\n location: item.location,\n };\n });\n };\n\n // private\n async getSubscriptions(): Promise<ResourceRowGroup> {\n const query = `\n resources\n | join kind=inner (\n ResourceContainers\n | where type == 'microsoft.resources/subscriptions'\n | project subscriptionName=name, subscriptionURI=id, subscriptionId\n ) on subscriptionId\n | summarize count() by subscriptionName, subscriptionURI, subscriptionId\n | order by subscriptionName desc\n `;\n\n let resources: RawAzureSubscriptionItem[] = [];\n\n let allFetched = false;\n let $skipToken = undefined;\n while (!allFetched) {\n // The response may include several pages\n let options: Partial<AzureResourceGraphOptions> = {};\n if ($skipToken) {\n options = {\n $skipToken,\n };\n }\n const resourceResponse = await this.makeResourceGraphRequest<RawAzureSubscriptionItem[]>(query, 1, options);\n if (!resourceResponse.data.length) {\n throw new Error('No subscriptions were found');\n }\n resources = resources.concat(resourceResponse.data);\n $skipToken = resourceResponse.$skipToken;\n allFetched = !$skipToken;\n }\n\n return resources.map((subscription) => ({\n name: subscription.subscriptionName,\n id: subscription.subscriptionId,\n uri: `/subscriptions/${subscription.subscriptionId}`,\n typeLabel: 'Subscription',\n type: ResourceRowType.Subscription,\n children: [],\n }));\n }\n\n async getResourceGroupsBySubscriptionId(\n subscriptionId: string,\n type: ResourcePickerQueryType\n ): Promise<ResourceRowGroup> {\n // We can use subscription ID for the filtering here as they're unique\n const query = `\n resources\n | join kind=inner (\n ResourceContainers\n | where type == 'microsoft.resources/subscriptions/resourcegroups'\n | project resourceGroupURI=id, resourceGroupName=name, resourceGroup, subscriptionId\n ) on resourceGroup, subscriptionId\n\n ${await this.filterByType(type)}\n | where subscriptionId == '${subscriptionId}'\n | summarize count() by resourceGroupName, resourceGroupURI\n | order by resourceGroupURI asc`;\n\n let resourceGroups: RawAzureResourceGroupItem[] = [];\n let allFetched = false;\n let $skipToken = undefined;\n while (!allFetched) {\n // The response may include several pages\n let options: Partial<AzureResourceGraphOptions> = {};\n if ($skipToken) {\n options = {\n $skipToken,\n };\n }\n const resourceResponse = await this.makeResourceGraphRequest<RawAzureResourceGroupItem[]>(query, 1, options);\n resourceGroups = resourceGroups.concat(resourceResponse.data);\n $skipToken = resourceResponse.$skipToken;\n allFetched = !$skipToken;\n }\n\n return resourceGroups.map((r) => {\n const parsedUri = parseResourceURI(r.resourceGroupURI);\n if (!parsedUri || !parsedUri.resourceGroup) {\n throw new Error('unable to fetch resource groups');\n }\n return {\n name: r.resourceGroupName,\n uri: r.resourceGroupURI,\n id: parsedUri.resourceGroup,\n type: ResourceRowType.ResourceGroup,\n typeLabel: 'Resource Group',\n children: [],\n };\n });\n }\n\n async getResourcesForResourceGroup(\n resourceGroupUri: string,\n type: ResourcePickerQueryType\n ): Promise<ResourceRowGroup> {\n // We use resource group URI for the filtering here because resource group names are not unique across subscriptions\n // We also add a slash at the end of the resource group URI to ensure we do not pull resources from a resource group\n // that has a similar naming prefix e.g. resourceGroup1 and resourceGroup10\n const { data: response } = await this.makeResourceGraphRequest<RawAzureResourceItem[]>(`\n resources\n | where id hasprefix \"${resourceGroupUri}/\"\n ${await this.filterByType(type)}\n `);\n\n return response.map((item) => {\n const parsedUri = parseResourceURI(item.id);\n if (!parsedUri || !parsedUri.resourceName) {\n throw new Error('unable to fetch resource details');\n }\n return {\n name: item.name,\n id: parsedUri.resourceName,\n uri: item.id,\n resourceGroupName: item.resourceGroup,\n type: ResourceRowType.Resource,\n typeLabel: resourceTypeDisplayNames[item.type] || item.type,\n locationDisplayName: item.location,\n location: item.location,\n };\n });\n }\n\n // used to make the select resource button that launches the resource picker show a nicer file path to users\n async getResourceURIDisplayProperties(resourceURI: string): Promise<AzureMonitorResource> {\n const { subscription, resourceGroup, resourceName } = parseResourceDetails(resourceURI) ?? {};\n\n if (!subscription) {\n throw new Error('Invalid resource URI passed');\n }\n\n // resourceGroupURI and resourceURI could be invalid values, but that's okay because the join\n // will just silently fail as expected\n const subscriptionURI = `/subscriptions/${subscription}`;\n const resourceGroupURI = `${subscriptionURI}/resourceGroups/${resourceGroup}`;\n\n const query = `\n resourcecontainers\n | where type == \"microsoft.resources/subscriptions\"\n | where id =~ \"${subscriptionURI}\"\n | project subscriptionName=name, subscriptionId\n\n | join kind=leftouter (\n resourcecontainers \n | where type == \"microsoft.resources/subscriptions/resourcegroups\"\n | where id =~ \"${resourceGroupURI}\"\n | project resourceGroupName=name, resourceGroup, subscriptionId\n ) on subscriptionId\n\n | join kind=leftouter (\n resources\n | where id =~ \"${resourceURI}\"\n | project resourceName=name, subscriptionId\n ) on subscriptionId\n\n | project subscriptionName, resourceGroupName, resourceName\n `;\n\n const { data: response } = await this.makeResourceGraphRequest<AzureResourceSummaryItem[]>(query);\n\n if (!response.length) {\n throw new Error('unable to fetch resource details');\n }\n\n const { subscriptionName, resourceGroupName, resourceName: responseResourceName } = response[0];\n // if the name is undefined it could be because the id is undefined or because we are using a template variable.\n // Either way we can use it as a fallback. We don't really want to interpolate these variables because we want\n // to show the user when they are using template variables `$sub/$rg/$resource`\n return {\n subscription: subscriptionName || subscription,\n resourceGroup: resourceGroupName || resourceGroup,\n resourceName: responseResourceName || resourceName,\n };\n }\n\n async getResourceURIFromWorkspace(workspace: string) {\n const { data: response } = await this.makeResourceGraphRequest<RawAzureResourceItem[]>(`\n resources\n | where properties['customerId'] == \"${workspace}\"\n | project id\n `);\n\n if (!response.length) {\n throw new Error('unable to find resource for workspace ' + workspace);\n }\n\n return response[0].id;\n }\n\n async makeResourceGraphRequest<T = unknown>(\n query: string,\n maxRetries = 1,\n reqOptions?: Partial<AzureResourceGraphOptions>\n ): Promise<AzureGraphResponse<T>> {\n try {\n return await this.postResource(this.resourcePath + RESOURCE_GRAPH_URL, {\n query: query,\n options: {\n resultFormat: 'objectArray',\n ...reqOptions,\n },\n });\n } catch (error) {\n if (maxRetries > 0) {\n return this.makeResourceGraphRequest(query, maxRetries - 1);\n }\n\n throw error;\n }\n }\n\n private filterByType = async (t: ResourcePickerQueryType) => {\n if (this.supportedMetricNamespaces === '' && t !== 'logs') {\n await this.fetchAllNamespaces();\n }\n return t === 'logs'\n ? `| where type in (${logsSupportedResourceTypesKusto})`\n : `| where type in (${this.supportedMetricNamespaces})`;\n };\n\n private async fetchAllNamespaces() {\n const subscriptions = await this.getSubscriptions();\n reportInteraction('grafana_ds_azuremonitor_subscriptions_loaded', { subscriptions: subscriptions.length });\n let supportedMetricNamespaces: string[] = [];\n for await (const subscription of subscriptions) {\n const namespaces = await this.azureMonitorDatasource.getMetricNamespaces(\n {\n resourceUri: `/subscriptions/${subscription.id}`,\n },\n true\n );\n if (namespaces) {\n const namespaceVals = namespaces.map((namespace) => `\"${namespace.value.toLocaleLowerCase()}\"`);\n supportedMetricNamespaces = supportedMetricNamespaces.concat(namespaceVals);\n }\n }\n\n if (supportedMetricNamespaces.length === 0) {\n throw new Error(\n 'Unable to resolve a list of valid metric namespaces. Validate the datasource configuration is correct and required permissions have been granted for all subscriptions. Grafana requires at least the Reader role to be assigned.'\n );\n }\n this.supportedMetricNamespaces = uniq(\n supportedMetricNamespaces.concat(resourceTypes.map((namespace) => `\"${namespace}\"`))\n ).join(',');\n }\n\n parseRows(resources: Array<string | AzureMonitorResource>): ResourceRow[] {\n const resourceObjs = parseMultipleResourceDetails(resources);\n const newSelectedRows: ResourceRow[] = [];\n resourceObjs.forEach((resource, i) => {\n let id = resource.resourceName;\n let name = resource.resourceName;\n let rtype = ResourceRowType.Resource;\n if (!id) {\n id = resource.resourceGroup;\n name = resource.resourceGroup;\n rtype = ResourceRowType.ResourceGroup;\n if (!id) {\n id = resource.subscription;\n name = resource.subscription;\n rtype = ResourceRowType.Subscription;\n }\n }\n newSelectedRows.push({\n id: id ?? '',\n name: name ?? '',\n type: rtype,\n uri: resourceToString(resource),\n typeLabel:\n resourceTypeDisplayNames[resource.metricNamespace?.toLowerCase() ?? ''] ?? resource.metricNamespace ?? '',\n location: resource.region,\n });\n });\n return newSelectedRows;\n }\n}\n","import { AnnotationQuery } from '@grafana/data';\n\nimport { AzureMonitorQuery, AzureQueryType } from '../types';\n\n// The old Angular annotations editor put some properties (rawQuery, workspace, subscription)\n// on the root annotation object, rather than down in the 'targets' query value\n// This migration moves them to a Log Analytics query compatible with the React query editor\n// The old Angular annotations editor did not support any other query types.\nexport default function migrateAnnotation(annotation: AnnotationQuery<AzureMonitorQuery>) {\n const oldQuery = typeof annotation.rawQuery === 'string' ? annotation.rawQuery : null;\n const oldWorkspace = typeof annotation.workspace === 'string' ? annotation.workspace : null;\n\n if (!(oldQuery && oldWorkspace && !annotation.target?.azureLogAnalytics?.query)) {\n return annotation;\n }\n\n const newQuery: AzureMonitorQuery = {\n ...(annotation.target ?? {}),\n refId: annotation.target?.refId ?? 'Anno',\n queryType: AzureQueryType.LogAnalytics,\n azureLogAnalytics: {\n query: oldQuery,\n resources: [oldWorkspace],\n },\n };\n\n return {\n ...annotation,\n rawQuery: undefined,\n workspace: undefined,\n subscription: undefined,\n queryType: undefined,\n target: newQuery,\n };\n}\n","import { isGUIDish } from './components/ResourcePicker/utils';\nimport DataSource from './datasource';\nimport { AzureMonitorQuery, AzureQueryType } from './types';\nimport {\n AppInsightsGroupByQuery,\n AppInsightsMetricNameQuery,\n GrafanaTemplateVariableQuery,\n MetricNamespaceQuery,\n MetricNamesQuery,\n ResourceGroupsQuery,\n ResourceNamesQuery,\n SubscriptionsQuery,\n WorkspacesQuery,\n} from './types/templateVariables';\n\n/* \n Grafana Template Variable Functions\n ex: Subscriptions()\n\n These are helper functions we have created and exposed to users to make the writing of template variables easier. \n Due to legacy reasons, we still need to parse strings to determine if a query is a Grafana Template Variable Function \n or if it's a KQL-type query\n*/\n\nexport const grafanaTemplateVariableFnMatches = (query: string) => {\n return {\n subscriptions: query.match(/^Subscriptions\\(\\)/i),\n resourceGroups: query.match(/^ResourceGroups\\(\\)/i),\n resourceGroupsWithSub: query.match(/^ResourceGroups\\(([^\\)]+?)(,\\s?([^,]+?))?\\)/i),\n namespaces: query.match(/^Namespaces\\(([^\\)]+?)(,\\s?([^,]+?))?\\)/i),\n namespacesWithSub: query.match(/^Namespaces\\(([^,]+?),\\s?([^,]+?)\\)/i),\n resourceNames: query.match(/^ResourceNames\\(([^,]+?),\\s?([^,]+?)\\)/i),\n resourceNamesWithSub: query.match(/^ResourceNames\\(([^,]+?),\\s?([^,]+?),\\s?(.+?)\\)/i),\n metricNamespace: query.match(/^MetricNamespace\\(([^,]+?),\\s?([^,]+?),\\s?([^,]+?)\\)/i),\n metricNamespaceWithSub: query.match(/^metricnamespace\\(([^,]+?),\\s?([^,]+?),\\s?([^,]+?),\\s?([^,]+?)\\)/i),\n metricNames: query.match(/^MetricNames\\(([^,]+?),\\s?([^,]+?),\\s?([^,]+?),\\s?([^,]+?)\\)/i),\n metricNamesWithSub: query.match(/^MetricNames\\(([^,]+?),\\s?([^,]+?),\\s?([^,]+?),\\s?([^,]+?),\\s?(.+?)\\)/i),\n appInsightsMetricNameQuery: query.match(/^AppInsightsMetricNames\\(\\)/i),\n appInsightsGroupByQuery: query.match(/^AppInsightsGroupBys\\(([^\\)]+?)(,\\s?([^,]+?))?\\)/i),\n workspacesQuery: query.match(/^workspaces\\(\\)/i),\n workspacesQueryWithSub: query.match(/^workspaces\\([\"']?([^\\)]+?)[\"']?\\)/i),\n };\n};\n\nconst isGrafanaTemplateVariableFnQuery = (query: string) => {\n const matches: Record<string, RegExpMatchArray | null> = grafanaTemplateVariableFnMatches(query);\n return Object.keys(matches).some((key) => !!matches[key]);\n};\n\nconst createGrafanaTemplateVariableQuery = (rawQuery: string, datasource: DataSource): AzureMonitorQuery => {\n const matchesForQuery = grafanaTemplateVariableFnMatches(rawQuery);\n const defaultSubscriptionId = datasource.azureMonitorDatasource.defaultSubscriptionId;\n const createGrafanaTemplateVariableDetails = (): GrafanaTemplateVariableQuery => {\n // deprecated app insights template variables (will most likely remove in grafana 9)\n if (matchesForQuery.appInsightsMetricNameQuery) {\n const queryDetails: AppInsightsMetricNameQuery = { rawQuery, kind: 'AppInsightsMetricNameQuery' };\n return queryDetails;\n }\n\n if (matchesForQuery.appInsightsGroupByQuery) {\n const queryDetails: AppInsightsGroupByQuery = {\n kind: 'AppInsightsGroupByQuery',\n rawQuery,\n metricName: matchesForQuery.appInsightsGroupByQuery[1],\n };\n return queryDetails;\n }\n\n if (matchesForQuery.subscriptions) {\n const queryDetails: SubscriptionsQuery = {\n kind: 'SubscriptionsQuery',\n rawQuery,\n };\n return queryDetails;\n }\n\n if (matchesForQuery.resourceGroupsWithSub) {\n const queryDetails: ResourceGroupsQuery = {\n kind: 'ResourceGroupsQuery',\n rawQuery,\n subscription: matchesForQuery.resourceGroupsWithSub[1],\n };\n return queryDetails;\n }\n\n if (matchesForQuery.resourceGroups && defaultSubscriptionId) {\n const queryDetails: ResourceGroupsQuery = {\n kind: 'ResourceGroupsQuery',\n rawQuery,\n subscription: defaultSubscriptionId,\n };\n return queryDetails;\n }\n\n if (matchesForQuery.namespacesWithSub) {\n const queryDetails: MetricNamespaceQuery = {\n kind: 'MetricNamespaceQuery',\n rawQuery,\n subscription: matchesForQuery.namespacesWithSub[1],\n resourceGroup: matchesForQuery.namespacesWithSub[2],\n };\n return queryDetails;\n }\n\n if (matchesForQuery.namespaces && defaultSubscriptionId) {\n const queryDetails: MetricNamespaceQuery = {\n kind: 'MetricNamespaceQuery',\n rawQuery,\n subscription: defaultSubscriptionId,\n resourceGroup: matchesForQuery.namespaces[1],\n };\n return queryDetails;\n }\n\n if (matchesForQuery.resourceNamesWithSub) {\n const queryDetails: ResourceNamesQuery = {\n kind: 'ResourceNamesQuery',\n rawQuery,\n subscription: matchesForQuery.resourceNamesWithSub[1],\n resourceGroup: matchesForQuery.resourceNamesWithSub[2],\n metricNamespace: matchesForQuery.resourceNamesWithSub[3],\n };\n return queryDetails;\n }\n\n if (matchesForQuery.resourceNames && defaultSubscriptionId) {\n const queryDetails: ResourceNamesQuery = {\n kind: 'ResourceNamesQuery',\n rawQuery,\n subscription: defaultSubscriptionId,\n resourceGroup: matchesForQuery.resourceNames[1],\n metricNamespace: matchesForQuery.resourceNames[2],\n };\n return queryDetails;\n }\n\n if (matchesForQuery.metricNamespaceWithSub) {\n const queryDetails: MetricNamespaceQuery = {\n kind: 'MetricNamespaceQuery',\n rawQuery,\n subscription: matchesForQuery.metricNamespaceWithSub[1],\n resourceGroup: matchesForQuery.metricNamespaceWithSub[2],\n metricNamespace: matchesForQuery.metricNamespaceWithSub[3],\n resourceName: matchesForQuery.metricNamespaceWithSub[4],\n };\n return queryDetails;\n }\n\n if (matchesForQuery.metricNamespace && defaultSubscriptionId) {\n const queryDetails: MetricNamespaceQuery = {\n kind: 'MetricNamespaceQuery',\n rawQuery,\n subscription: defaultSubscriptionId,\n resourceGroup: matchesForQuery.metricNamespace[1],\n metricNamespace: matchesForQuery.metricNamespace[2],\n resourceName: matchesForQuery.metricNamespace[3],\n };\n return queryDetails;\n }\n\n if (matchesForQuery.metricNames && defaultSubscriptionId) {\n if (matchesForQuery.metricNames[3].indexOf(',') === -1) {\n const queryDetails: MetricNamesQuery = {\n kind: 'MetricNamesQuery',\n rawQuery,\n subscription: defaultSubscriptionId,\n resourceGroup: matchesForQuery.metricNames[1],\n metricNamespace: matchesForQuery.metricNames[2],\n resourceName: matchesForQuery.metricNames[3],\n };\n return queryDetails;\n }\n }\n\n if (matchesForQuery.metricNamesWithSub) {\n const queryDetails: MetricNamesQuery = {\n kind: 'MetricNamesQuery',\n rawQuery,\n subscription: matchesForQuery.metricNamesWithSub[1],\n resourceGroup: matchesForQuery.metricNamesWithSub[2],\n metricNamespace: matchesForQuery.metricNamesWithSub[3],\n resourceName: matchesForQuery.metricNamesWithSub[4],\n };\n return queryDetails;\n }\n\n if (matchesForQuery.workspacesQueryWithSub) {\n const queryDetails: WorkspacesQuery = {\n kind: 'WorkspacesQuery',\n rawQuery,\n subscription: (matchesForQuery.workspacesQueryWithSub[1] || '').trim(),\n };\n return queryDetails;\n }\n\n if (matchesForQuery.workspacesQuery && defaultSubscriptionId) {\n const queryDetails: WorkspacesQuery = {\n kind: 'WorkspacesQuery',\n rawQuery,\n subscription: defaultSubscriptionId,\n };\n return queryDetails;\n }\n\n // fallback\n const queryDetails: SubscriptionsQuery = { kind: 'SubscriptionsQuery', rawQuery };\n return queryDetails;\n };\n\n const query: AzureMonitorQuery = {\n refId: 'A',\n queryType: AzureQueryType.GrafanaTemplateVariableFn,\n grafanaTemplateVariableFn: createGrafanaTemplateVariableDetails(),\n subscription: defaultSubscriptionId,\n };\n return query;\n};\n\nconst createLogAnalyticsTemplateVariableQuery = async (\n rawQuery: string,\n datasource: DataSource\n): Promise<AzureMonitorQuery> => {\n const defaultSubscriptionId = datasource.azureMonitorDatasource.defaultSubscriptionId;\n let resource = '';\n // if there's an existing query, we try to get the resourcesuri from a deprecated default workspace\n // a note this is very similar logic to what is used in useMigrations but moved out of the react-hook land\n if (rawQuery) {\n const defaultWorkspaceId = datasource.azureLogAnalyticsDatasource.getDeprecatedDefaultWorkSpace();\n if (defaultWorkspaceId) {\n const isWorkspaceGUID = isGUIDish(defaultWorkspaceId);\n if (isWorkspaceGUID) {\n resource = await datasource.resourcePickerData.getResourceURIFromWorkspace(defaultWorkspaceId);\n } else {\n resource = defaultWorkspaceId;\n }\n } else {\n const maybeFirstWorkspace = await datasource.azureLogAnalyticsDatasource.getFirstWorkspace();\n resource = maybeFirstWorkspace || '';\n }\n }\n\n return {\n refId: 'A',\n queryType: AzureQueryType.LogAnalytics,\n azureLogAnalytics: {\n query: rawQuery,\n resources: resource ? [resource] : [],\n },\n subscription: defaultSubscriptionId,\n };\n};\n\nconst migrateGrafanaTemplateVariableFn = (query: AzureMonitorQuery) => {\n const { queryType, grafanaTemplateVariableFn } = query;\n if (queryType !== AzureQueryType.GrafanaTemplateVariableFn || !grafanaTemplateVariableFn) {\n return query;\n }\n\n const migratedQuery: AzureMonitorQuery = {\n ...query,\n };\n if ('subscription' in grafanaTemplateVariableFn) {\n migratedQuery.subscription = grafanaTemplateVariableFn.subscription;\n }\n if ('resourceGroup' in grafanaTemplateVariableFn) {\n migratedQuery.resourceGroup = grafanaTemplateVariableFn.resourceGroup;\n }\n if ('metricNamespace' in grafanaTemplateVariableFn) {\n migratedQuery.namespace = grafanaTemplateVariableFn.metricNamespace;\n }\n if ('resourceName' in grafanaTemplateVariableFn) {\n migratedQuery.resource = grafanaTemplateVariableFn.resourceName;\n }\n\n switch (grafanaTemplateVariableFn.kind) {\n case 'SubscriptionsQuery':\n migratedQuery.queryType = AzureQueryType.SubscriptionsQuery;\n break;\n case 'ResourceGroupsQuery':\n migratedQuery.queryType = AzureQueryType.ResourceGroupsQuery;\n break;\n case 'ResourceNamesQuery':\n migratedQuery.queryType = AzureQueryType.ResourceNamesQuery;\n break;\n case 'MetricNamespaceQuery':\n migratedQuery.queryType = AzureQueryType.NamespacesQuery;\n break;\n case 'MetricDefinitionsQuery':\n migratedQuery.queryType = AzureQueryType.NamespacesQuery;\n break;\n case 'MetricNamesQuery':\n migratedQuery.queryType = AzureQueryType.MetricNamesQuery;\n break;\n case 'WorkspacesQuery':\n migratedQuery.queryType = AzureQueryType.WorkspacesQuery;\n break;\n }\n\n return migratedQuery;\n};\n\nexport const migrateStringQueriesToObjectQueries = async (\n rawQuery: string | AzureMonitorQuery,\n options: { datasource: DataSource }\n): Promise<AzureMonitorQuery> => {\n // no need to migrate already migrated queries\n if (typeof rawQuery !== 'string') {\n return rawQuery;\n }\n\n return isGrafanaTemplateVariableFnQuery(rawQuery)\n ? createGrafanaTemplateVariableQuery(rawQuery, options.datasource)\n : createLogAnalyticsTemplateVariableQuery(rawQuery, options.datasource);\n};\n\nexport const migrateQuery = async (\n rawQuery: string | AzureMonitorQuery,\n options: { datasource: DataSource }\n): Promise<AzureMonitorQuery> => {\n let query = await migrateStringQueriesToObjectQueries(rawQuery, options);\n\n if (query.queryType === AzureQueryType.GrafanaTemplateVariableFn) {\n query = migrateGrafanaTemplateVariableFn(query);\n }\n\n return query;\n};\n","import React, { ChangeEvent, useCallback, useEffect, useState } from 'react';\n\nimport { InlineField, Input } from '@grafana/ui';\n\nimport DataSource from '../../datasource';\nimport { migrateStringQueriesToObjectQueries } from '../../grafanaTemplateVariableFns';\nimport { AzureMonitorQuery, AzureQueryType } from '../../types';\n\nconst GrafanaTemplateVariableFnInput = ({\n query,\n updateQuery,\n datasource,\n}: {\n query: AzureMonitorQuery;\n updateQuery: (val: AzureMonitorQuery) => void;\n datasource: DataSource;\n}) => {\n const [inputVal, setInputVal] = useState('');\n\n useEffect(() => {\n setInputVal(query.grafanaTemplateVariableFn?.rawQuery || '');\n }, [query.grafanaTemplateVariableFn?.rawQuery]);\n\n const onRunQuery = useCallback(\n (newQuery: string) => {\n migrateStringQueriesToObjectQueries(newQuery, { datasource }).then((updatedQuery) => {\n if (updatedQuery.queryType === AzureQueryType.GrafanaTemplateVariableFn) {\n updateQuery(updatedQuery);\n } else {\n updateQuery({\n ...query,\n grafanaTemplateVariableFn: {\n kind: 'UnknownQuery',\n rawQuery: newQuery,\n },\n });\n }\n });\n },\n [datasource, query, updateQuery]\n );\n\n const onChange = (event: ChangeEvent<HTMLInputElement>) => {\n setInputVal(event.target.value);\n };\n\n return (\n <InlineField label=\"Grafana template variable function\">\n <Input\n placeholder={'type a grafana template variable function, ex: Subscriptions()'}\n value={inputVal}\n onChange={onChange}\n onBlur={() => onRunQuery(inputVal)}\n />\n </InlineField>\n );\n};\n\nexport default GrafanaTemplateVariableFnInput;\n","import { get, isEqual } from 'lodash';\nimport React, { useEffect, useState } from 'react';\nimport { useEffectOnce } from 'react-use';\n\nimport { SelectableValue } from '@grafana/data';\nimport { Alert, Field, Select, Space } from '@grafana/ui';\n\nimport DataSource from '../../datasource';\nimport { selectors } from '../../e2e/selectors';\nimport { migrateQuery } from '../../grafanaTemplateVariableFns';\nimport { AzureMonitorOption, AzureMonitorQuery, AzureQueryType } from '../../types';\nimport useLastError from '../../utils/useLastError';\nimport ArgQueryEditor from '../ArgQueryEditor';\nimport LogsQueryEditor from '../LogsQueryEditor';\n\nimport GrafanaTemplateVariableFnInput from './GrafanaTemplateVariableFn';\n\ntype Props = {\n query: AzureMonitorQuery | string;\n onChange: (query: AzureMonitorQuery) => void;\n datasource: DataSource;\n};\n\nconst removeOption: SelectableValue = { label: '-', value: '' };\n\nconst VariableEditor = (props: Props) => {\n const { query, onChange, datasource } = props;\n const AZURE_QUERY_VARIABLE_TYPE_OPTIONS = [\n { label: 'Subscriptions', value: AzureQueryType.SubscriptionsQuery },\n { label: 'Resource Groups', value: AzureQueryType.ResourceGroupsQuery },\n { label: 'Namespaces', value: AzureQueryType.NamespacesQuery },\n { label: 'Regions', value: AzureQueryType.LocationsQuery },\n { label: 'Resource Names', value: AzureQueryType.ResourceNamesQuery },\n { label: 'Metric Names', value: AzureQueryType.MetricNamesQuery },\n { label: 'Workspaces', value: AzureQueryType.WorkspacesQuery },\n { label: 'Resource Graph', value: AzureQueryType.AzureResourceGraph },\n { label: 'Logs', value: AzureQueryType.LogAnalytics },\n ];\n if (typeof props.query === 'object' && props.query.queryType === AzureQueryType.GrafanaTemplateVariableFn) {\n // Add the option for the GrafanaTemplateVariableFn only if it's already in use\n AZURE_QUERY_VARIABLE_TYPE_OPTIONS.push({\n label: 'Grafana Query Function',\n value: AzureQueryType.GrafanaTemplateVariableFn,\n });\n }\n const [variableOptionGroup, setVariableOptionGroup] = useState<{ label: string; options: AzureMonitorOption[] }>({\n label: 'Template Variables',\n options: [],\n });\n const [requireSubscription, setRequireSubscription] = useState(false);\n const [hasResourceGroup, setHasResourceGroup] = useState(false);\n const [hasNamespace, setHasNamespace] = useState(false);\n const [hasRegion, setHasRegion] = useState(false);\n const [requireResourceGroup, setRequireResourceGroup] = useState(false);\n const [requireNamespace, setRequireNamespace] = useState(false);\n const [requireResource, setRequireResource] = useState(false);\n const [subscriptions, setSubscriptions] = useState<SelectableValue[]>([]);\n const [resourceGroups, setResourceGroups] = useState<SelectableValue[]>([]);\n const [namespaces, setNamespaces] = useState<SelectableValue[]>([]);\n const [resources, setResources] = useState<SelectableValue[]>([]);\n const [regions, setRegions] = useState<SelectableValue[]>([]);\n const [errorMessage, setError] = useLastError();\n const queryType = typeof query === 'string' ? '' : query.queryType;\n\n useEffect(() => {\n migrateQuery(query, { datasource: datasource }).then((migratedQuery) => {\n if (!isEqual(query, migratedQuery)) {\n onChange(migratedQuery);\n }\n });\n }, [query, datasource, onChange]);\n\n useEffect(() => {\n setRequireSubscription(false);\n setHasResourceGroup(false);\n setHasNamespace(false);\n setRequireResourceGroup(false);\n setRequireNamespace(false);\n setRequireResource(false);\n switch (queryType) {\n case AzureQueryType.ResourceGroupsQuery:\n case AzureQueryType.WorkspacesQuery:\n setRequireSubscription(true);\n break;\n case AzureQueryType.NamespacesQuery:\n setRequireSubscription(true);\n setHasResourceGroup(true);\n break;\n case AzureQueryType.ResourceNamesQuery:\n setRequireSubscription(true);\n setHasResourceGroup(true);\n setHasNamespace(true);\n setHasRegion(true);\n break;\n case AzureQueryType.MetricNamesQuery:\n setRequireSubscription(true);\n setRequireResourceGroup(true);\n setRequireNamespace(true);\n setRequireResource(true);\n break;\n case AzureQueryType.LocationsQuery:\n setRequireSubscription(true);\n break;\n }\n }, [queryType]);\n\n useEffect(() => {\n const options: AzureMonitorOption[] = [];\n datasource.getVariablesRaw().forEach((v) => {\n if (get(v, 'query.queryType') !== queryType) {\n options.push({ label: v.label || v.name, value: `$${v.name}` });\n }\n });\n setVariableOptionGroup({\n label: 'Template Variables',\n options,\n });\n }, [datasource, queryType]);\n\n useEffectOnce(() => {\n datasource.getSubscriptions().then((subs) => {\n setSubscriptions(subs.map((s) => ({ label: s.text, value: s.value })));\n });\n });\n\n const subscription = typeof query === 'object' && query.subscription;\n useEffect(() => {\n if (subscription) {\n datasource.getResourceGroups(subscription).then((rgs) => {\n setResourceGroups(rgs.map((s) => ({ label: s.text, value: s.value })));\n });\n }\n }, [datasource, subscription]);\n\n const resourceGroup = (typeof query === 'object' && query.resourceGroup) || '';\n useEffect(() => {\n if (subscription) {\n datasource.getMetricNamespaces(subscription, resourceGroup).then((rgs) => {\n setNamespaces(rgs.map((s) => ({ label: s.text, value: s.value })));\n });\n }\n }, [datasource, subscription, resourceGroup]);\n\n useEffect(() => {\n if (subscription) {\n datasource.azureMonitorDatasource.getLocations([subscription]).then((rgs) => {\n const regions: SelectableValue[] = [];\n rgs.forEach((r) => regions.push({ label: r.displayName, value: r.name }));\n setRegions(regions);\n });\n }\n }, [datasource, subscription, resourceGroup]);\n\n const namespace = (typeof query === 'object' && query.namespace) || '';\n useEffect(() => {\n if (subscription) {\n datasource.getResourceNames(subscription, resourceGroup, namespace).then((rgs) => {\n setResources(rgs.map((s) => ({ label: s.text, value: s.value })));\n });\n }\n }, [datasource, subscription, resourceGroup, namespace]);\n\n if (typeof query === 'string') {\n // still migrating the query\n return null;\n }\n\n const onQueryTypeChange = (selectableValue: SelectableValue) => {\n if (selectableValue.value) {\n onChange({\n ...query,\n queryType: selectableValue.value,\n subscription: undefined,\n resourceGroup: undefined,\n namespace: undefined,\n resource: undefined,\n });\n }\n };\n\n const onChangeSubscription = (selectableValue: SelectableValue) => {\n if (selectableValue.value) {\n onChange({\n ...query,\n subscription: selectableValue.value,\n resourceGroup: undefined,\n namespace: undefined,\n resource: undefined,\n });\n }\n };\n\n const onChangeResourceGroup = (selectableValue: SelectableValue) => {\n onChange({\n ...query,\n resourceGroup: selectableValue.value,\n namespace: undefined,\n resource: undefined,\n });\n };\n\n const onChangeNamespace = (selectableValue: SelectableValue) => {\n onChange({\n ...query,\n namespace: selectableValue.value,\n resource: undefined,\n });\n };\n\n const onChangeRegion = (selectableValue: SelectableValue) => {\n onChange({\n ...query,\n region: selectableValue.value,\n });\n };\n\n const onChangeResource = (selectableValue: SelectableValue) => {\n onChange({\n ...query,\n resource: selectableValue.value,\n });\n };\n\n const onQueryChange = (queryChange: AzureMonitorQuery) => {\n onChange(queryChange);\n };\n\n return (\n <>\n <Field label=\"Query Type\" data-testid={selectors.components.variableEditor.queryType.input}>\n <Select\n aria-label=\"select query type\"\n onChange={onQueryTypeChange}\n options={AZURE_QUERY_VARIABLE_TYPE_OPTIONS}\n width={25}\n value={queryType}\n />\n </Field>\n {query.queryType === AzureQueryType.LogAnalytics && (\n <>\n <LogsQueryEditor\n subscriptionId={query.subscription}\n query={query}\n datasource={datasource}\n onChange={onQueryChange}\n variableOptionGroup={variableOptionGroup}\n setError={setError}\n hideFormatAs={true}\n />\n {errorMessage && (\n <>\n <Space v={2} />\n <Alert severity=\"error\" title=\"An error occurred while requesting metadata from Azure Monitor\">\n {errorMessage instanceof Error ? errorMessage.message : errorMessage}\n </Alert>\n </>\n )}\n </>\n )}\n {query.queryType === AzureQueryType.GrafanaTemplateVariableFn && (\n <GrafanaTemplateVariableFnInput query={query} updateQuery={props.onChange} datasource={datasource} />\n )}\n {requireSubscription && (\n <Field label=\"Subscription\" data-testid={selectors.components.variableEditor.subscription.input}>\n <Select\n aria-label=\"select subscription\"\n onChange={onChangeSubscription}\n options={subscriptions.concat(variableOptionGroup)}\n width={25}\n value={query.subscription || null}\n />\n </Field>\n )}\n {(requireResourceGroup || hasResourceGroup) && (\n <Field label=\"Resource Group\" data-testid={selectors.components.variableEditor.resourceGroup.input}>\n <Select\n aria-label=\"select resource group\"\n onChange={onChangeResourceGroup}\n options={\n requireResourceGroup\n ? resourceGroups.concat(variableOptionGroup)\n : resourceGroups.concat(variableOptionGroup, removeOption)\n }\n width={25}\n value={query.resourceGroup || null}\n placeholder={requireResourceGroup ? undefined : 'Optional'}\n />\n </Field>\n )}\n {(requireNamespace || hasNamespace) && (\n <Field label=\"Namespace\" data-testid={selectors.components.variableEditor.namespace.input}>\n <Select\n aria-label=\"select namespace\"\n onChange={onChangeNamespace}\n options={\n requireNamespace\n ? namespaces.concat(variableOptionGroup)\n : namespaces.concat(variableOptionGroup, removeOption)\n }\n width={25}\n value={query.namespace || null}\n placeholder={requireNamespace ? undefined : 'Optional'}\n />\n </Field>\n )}\n {hasRegion && (\n <Field label=\"Region\" data-testid={selectors.components.variableEditor.region.input}>\n <Select\n aria-label=\"select region\"\n onChange={onChangeRegion}\n options={regions.concat(variableOptionGroup)}\n width={25}\n value={query.region || null}\n placeholder=\"Optional\"\n />\n </Field>\n )}\n {requireResource && (\n <Field label=\"Resource\" data-testid={selectors.components.variableEditor.resource.input}>\n <Select\n aria-label=\"select resource\"\n onChange={onChangeResource}\n options={resources.concat(variableOptionGroup)}\n width={25}\n value={query.resource || null}\n />\n </Field>\n )}\n {query.queryType === AzureQueryType.AzureResourceGraph && (\n <>\n <ArgQueryEditor\n subscriptionId={datasource.azureLogAnalyticsDatasource.defaultSubscriptionId}\n query={query}\n datasource={datasource}\n onChange={onQueryChange}\n variableOptionGroup={variableOptionGroup}\n setError={setError}\n />\n {errorMessage && (\n <>\n <Space v={2} />\n <Alert severity=\"error\" title=\"An error occurred while requesting metadata from Azure Monitor\">\n {errorMessage instanceof Error ? errorMessage.message : errorMessage}\n </Alert>\n </>\n )}\n </>\n )}\n </>\n );\n};\n\nexport default VariableEditor;\n","import { from, lastValueFrom, Observable } from 'rxjs';\n\nimport {\n CustomVariableSupport,\n DataQueryRequest,\n DataQueryResponse,\n MetricFindValue,\n toDataFrame,\n} from '@grafana/data';\nimport { getTemplateSrv, TemplateSrv } from '@grafana/runtime';\n\nimport VariableEditor from './components/VariableEditor/VariableEditor';\nimport DataSource from './datasource';\nimport { migrateQuery } from './grafanaTemplateVariableFns';\nimport { AzureMonitorQuery, AzureQueryType } from './types';\nimport { GrafanaTemplateVariableQuery } from './types/templateVariables';\nimport messageFromError from './utils/messageFromError';\n\nexport class VariableSupport extends CustomVariableSupport<DataSource, AzureMonitorQuery> {\n constructor(\n private readonly datasource: DataSource,\n private readonly templateSrv: TemplateSrv = getTemplateSrv()\n ) {\n super();\n this.datasource = datasource;\n }\n\n editor = VariableEditor;\n\n hasValue(...values: string[]) {\n return values.every((v) => !!this.templateSrv.replace(v));\n }\n\n query(request: DataQueryRequest<AzureMonitorQuery>): Observable<DataQueryResponse> {\n const promisedResults = async () => {\n const queryObj = await migrateQuery(request.targets[0], { datasource: this.datasource });\n\n try {\n switch (queryObj.queryType) {\n case AzureQueryType.SubscriptionsQuery:\n const res = await this.datasource.getSubscriptions();\n return {\n data: res?.length ? [toDataFrame(res)] : [],\n };\n case AzureQueryType.ResourceGroupsQuery:\n if (queryObj.subscription && this.hasValue(queryObj.subscription)) {\n const rgs = await this.datasource.getResourceGroups(queryObj.subscription);\n return {\n data: rgs?.length ? [toDataFrame(rgs)] : [],\n };\n }\n return { data: [] };\n case AzureQueryType.NamespacesQuery:\n if (queryObj.subscription && this.hasValue(queryObj.subscription)) {\n const rgs = await this.datasource.getMetricNamespaces(queryObj.subscription, queryObj.resourceGroup);\n return {\n data: rgs?.length ? [toDataFrame(rgs)] : [],\n };\n }\n return { data: [] };\n case AzureQueryType.ResourceNamesQuery:\n if (queryObj.subscription && this.hasValue(queryObj.subscription)) {\n const rgs = await this.datasource.getResourceNames(\n queryObj.subscription,\n queryObj.resourceGroup,\n queryObj.namespace,\n queryObj.region\n );\n return {\n data: rgs?.length ? [toDataFrame(rgs)] : [],\n };\n }\n return { data: [] };\n case AzureQueryType.MetricNamesQuery:\n if (\n queryObj.subscription &&\n queryObj.resourceGroup &&\n queryObj.namespace &&\n queryObj.resource &&\n this.hasValue(queryObj.subscription, queryObj.resourceGroup, queryObj.namespace, queryObj.resource)\n ) {\n const rgs = await this.datasource.getMetricNames(\n queryObj.subscription,\n queryObj.resourceGroup,\n queryObj.namespace,\n queryObj.resource\n );\n return {\n data: rgs?.length ? [toDataFrame(rgs)] : [],\n };\n }\n return { data: [] };\n case AzureQueryType.WorkspacesQuery:\n if (queryObj.subscription && this.hasValue(queryObj.subscription)) {\n const rgs = await this.datasource.getAzureLogAnalyticsWorkspaces(queryObj.subscription);\n return {\n data: rgs?.length ? [toDataFrame(rgs)] : [],\n };\n }\n return { data: [] };\n case AzureQueryType.GrafanaTemplateVariableFn:\n if (queryObj.grafanaTemplateVariableFn) {\n const templateVariablesResults = await this.callGrafanaTemplateVariableFn(\n queryObj.grafanaTemplateVariableFn\n );\n return {\n data: templateVariablesResults?.length ? [toDataFrame(templateVariablesResults)] : [],\n };\n }\n return { data: [] };\n case AzureQueryType.LocationsQuery:\n if (queryObj.subscription && this.hasValue(queryObj.subscription)) {\n const locationMap = await this.datasource.azureMonitorDatasource.getLocations([queryObj.subscription]);\n const res: Array<{ text: string; value: string }> = [];\n locationMap.forEach((loc) => {\n res.push({ text: loc.displayName, value: loc.name });\n });\n return {\n data: res?.length ? [toDataFrame(res)] : [],\n };\n }\n default:\n request.targets[0] = queryObj;\n const queryResp = await lastValueFrom(this.datasource.query(request));\n return {\n data: queryResp.data,\n error: queryResp.error ? new Error(messageFromError(queryResp.error)) : undefined,\n };\n }\n } catch (err) {\n return { data: [], error: new Error(messageFromError(err)) };\n }\n };\n\n return from(promisedResults());\n }\n\n // Deprecated\n callGrafanaTemplateVariableFn(query: GrafanaTemplateVariableQuery): Promise<MetricFindValue[]> | null {\n if (query.kind === 'SubscriptionsQuery') {\n return this.datasource.getSubscriptions();\n }\n\n if (query.kind === 'ResourceGroupsQuery') {\n return this.datasource.getResourceGroups(this.replaceVariable(query.subscription));\n }\n\n if (query.kind === 'ResourceNamesQuery') {\n return this.datasource.getResourceNames(\n this.replaceVariable(query.subscription),\n this.replaceVariable(query.resourceGroup),\n this.replaceVariable(query.metricNamespace)\n );\n }\n\n if (query.kind === 'MetricNamespaceQuery') {\n return this.datasource.azureMonitorDatasource.getMetricNamespaces(query, true);\n }\n\n if (query.kind === 'MetricNamesQuery') {\n return this.datasource.azureMonitorDatasource.getMetricNames(query);\n }\n\n if (query.kind === 'WorkspacesQuery') {\n return this.datasource.azureLogAnalyticsDatasource.getWorkspaces(this.replaceVariable(query.subscription));\n }\n\n return null;\n }\n\n replaceVariable(metric: string) {\n return this.templateSrv.replace((metric || '').trim());\n }\n}\n","import { cloneDeep } from 'lodash';\nimport { forkJoin, Observable, of } from 'rxjs';\nimport { map } from 'rxjs/operators';\n\nimport {\n DataFrame,\n DataQueryRequest,\n DataQueryResponse,\n DataSourceInstanceSettings,\n LoadingState,\n QueryFixAction,\n ScopedVars,\n} from '@grafana/data';\nimport { DataSourceWithBackend, getTemplateSrv, TemplateSrv } from '@grafana/runtime';\n\nimport AzureLogAnalyticsDatasource from './azure_log_analytics/azure_log_analytics_datasource';\nimport AzureMonitorDatasource from './azure_monitor/azure_monitor_datasource';\nimport AzureResourceGraphDatasource from './azure_resource_graph/azure_resource_graph_datasource';\nimport ResourcePickerData from './resourcePicker/resourcePickerData';\nimport { AzureDataSourceJsonData, AzureMonitorQuery, AzureQueryType } from './types';\nimport migrateAnnotation from './utils/migrateAnnotation';\nimport migrateQuery from './utils/migrateQuery';\nimport { VariableSupport } from './variables';\n\nexport default class Datasource extends DataSourceWithBackend<AzureMonitorQuery, AzureDataSourceJsonData> {\n annotations = {\n prepareAnnotation: migrateAnnotation,\n };\n\n azureMonitorDatasource: AzureMonitorDatasource;\n azureLogAnalyticsDatasource: AzureLogAnalyticsDatasource;\n resourcePickerData: ResourcePickerData;\n azureResourceGraphDatasource: AzureResourceGraphDatasource;\n\n pseudoDatasource: {\n [key in AzureQueryType]?: AzureMonitorDatasource | AzureLogAnalyticsDatasource | AzureResourceGraphDatasource;\n } = {};\n\n declare optionsKey: Record<AzureQueryType, string>;\n\n constructor(\n instanceSettings: DataSourceInstanceSettings<AzureDataSourceJsonData>,\n private readonly templateSrv: TemplateSrv = getTemplateSrv()\n ) {\n super(instanceSettings);\n this.azureMonitorDatasource = new AzureMonitorDatasource(instanceSettings);\n this.azureLogAnalyticsDatasource = new AzureLogAnalyticsDatasource(instanceSettings);\n this.azureResourceGraphDatasource = new AzureResourceGraphDatasource(instanceSettings);\n this.resourcePickerData = new ResourcePickerData(instanceSettings, this.azureMonitorDatasource);\n\n this.pseudoDatasource = {\n [AzureQueryType.AzureMonitor]: this.azureMonitorDatasource,\n [AzureQueryType.LogAnalytics]: this.azureLogAnalyticsDatasource,\n [AzureQueryType.AzureResourceGraph]: this.azureResourceGraphDatasource,\n };\n\n this.variables = new VariableSupport(this);\n }\n\n filterQuery(item: AzureMonitorQuery): boolean {\n if (!item.queryType) {\n return false;\n }\n const ds = this.pseudoDatasource[item.queryType];\n return ds?.filterQuery?.(item) ?? true;\n }\n\n query(options: DataQueryRequest<AzureMonitorQuery>): Observable<DataQueryResponse> {\n const byType = new Map<AzureQueryType, DataQueryRequest<AzureMonitorQuery>>();\n\n for (const baseTarget of options.targets) {\n // Migrate old query structures\n const target = migrateQuery(baseTarget);\n\n // Skip hidden or invalid queries or ones without properties\n if (!target.queryType || target.hide || !hasQueryForType(target)) {\n continue;\n }\n\n // Initialize the list of queries\n if (!byType.has(target.queryType)) {\n const queryForType = cloneDeep(options);\n queryForType.requestId = `${queryForType.requestId}-${target.refId}`;\n queryForType.targets = [];\n byType.set(target.queryType, queryForType);\n }\n\n const queryForType = byType.get(target.queryType);\n queryForType?.targets.push(target);\n }\n\n const observables: Array<Observable<DataQueryResponse>> = Array.from(byType.entries()).map(([queryType, req]) => {\n const mappedQueryType = queryType === AzureQueryType.AzureTraces ? AzureQueryType.LogAnalytics : queryType;\n const ds = this.pseudoDatasource[mappedQueryType];\n if (!ds) {\n throw new Error('Data source not created for query type ' + queryType);\n }\n\n return ds.query(req);\n });\n\n // Single query can skip merge\n if (observables.length === 1) {\n return observables[0];\n }\n\n if (observables.length > 1) {\n return forkJoin(observables).pipe(\n map((results: DataQueryResponse[]) => {\n const data: DataFrame[] = [];\n for (const result of results) {\n for (const frame of result.data) {\n data.push(frame);\n }\n }\n\n return { state: LoadingState.Done, data };\n })\n );\n }\n\n return of({ state: LoadingState.Done, data: [] });\n }\n\n targetContainsTemplate(query: AzureMonitorQuery) {\n if (query.subscription && this.templateSrv.containsTemplate(query.subscription)) {\n return true;\n }\n\n let subQuery;\n if (query.queryType === AzureQueryType.AzureMonitor) {\n subQuery = JSON.stringify(query.azureMonitor);\n } else if (query.queryType === AzureQueryType.LogAnalytics) {\n subQuery = JSON.stringify(query.azureLogAnalytics);\n } else if (query.queryType === AzureQueryType.AzureResourceGraph) {\n subQuery = JSON.stringify([query.azureResourceGraph, query.subscriptions]);\n }\n\n return !!subQuery && this.templateSrv.containsTemplate(subQuery);\n }\n\n /* Azure Monitor REST API methods */\n getResourceGroups(subscriptionId: string) {\n return this.azureMonitorDatasource.getResourceGroups(this.templateSrv.replace(subscriptionId));\n }\n\n getMetricNamespaces(subscriptionId: string, resourceGroup?: string) {\n let url = `/subscriptions/${subscriptionId}`;\n if (resourceGroup) {\n url += `/resourceGroups/${resourceGroup};`;\n }\n return this.azureMonitorDatasource.getMetricNamespaces({ resourceUri: url }, true);\n }\n\n getResourceNames(subscriptionId: string, resourceGroup?: string, metricNamespace?: string, region?: string) {\n return this.azureMonitorDatasource.getResourceNames({ subscriptionId, resourceGroup, metricNamespace, region });\n }\n\n getMetricNames(subscriptionId: string, resourceGroup: string, metricNamespace: string, resourceName: string) {\n return this.azureMonitorDatasource.getMetricNames({\n subscription: subscriptionId,\n resourceGroup,\n metricNamespace,\n resourceName,\n });\n }\n\n /*Azure Log Analytics */\n getAzureLogAnalyticsWorkspaces(subscriptionId: string) {\n return this.azureLogAnalyticsDatasource.getWorkspaces(subscriptionId);\n }\n\n getSubscriptions() {\n return this.azureMonitorDatasource.getSubscriptions();\n }\n\n interpolateVariablesInQueries(queries: AzureMonitorQuery[], scopedVars: ScopedVars): AzureMonitorQuery[] {\n const mapped = queries.map((query) => {\n if (!query.queryType) {\n return query;\n }\n\n const queryType = query.queryType === AzureQueryType.AzureTraces ? AzureQueryType.LogAnalytics : query.queryType;\n const ds = this.pseudoDatasource[queryType];\n return {\n datasource: ds?.getRef(),\n ...(ds?.applyTemplateVariables(query, scopedVars) ?? query),\n };\n });\n\n return mapped;\n }\n\n getVariables() {\n return this.templateSrv.getVariables().map((v) => `$${v.name}`);\n }\n\n getVariablesRaw() {\n return this.templateSrv.getVariables();\n }\n\n modifyQuery(query: AzureMonitorQuery, action: QueryFixAction): AzureMonitorQuery {\n if (!action.options) {\n return query;\n }\n let expression = query.azureLogAnalytics?.query;\n if (expression === undefined) {\n return query;\n }\n switch (action.type) {\n case 'ADD_FILTER': {\n expression += `\\n| where ${action.options.key} == \"${action.options.value}\"`;\n break;\n }\n case 'ADD_FILTER_OUT': {\n expression += `\\n| where ${action.options.key} != \"${action.options.value}\"`;\n break;\n }\n }\n return { ...query, azureLogAnalytics: { ...query.azureLogAnalytics, query: expression } };\n }\n}\n\nfunction hasQueryForType(query: AzureMonitorQuery): boolean {\n switch (query.queryType) {\n case AzureQueryType.AzureMonitor:\n return !!query.azureMonitor;\n\n case AzureQueryType.LogAnalytics:\n return !!query.azureLogAnalytics;\n\n case AzureQueryType.AzureResourceGraph:\n return !!query.azureResourceGraph;\n\n case AzureQueryType.AzureTraces:\n return !!query.azureTraces;\n\n case AzureQueryType.GrafanaTemplateVariableFn:\n return !!query.grafanaTemplateVariableFn;\n\n default:\n return false;\n }\n}\n","import { reportInteraction } from '@grafana/runtime';\n\n/**\n * Loaded the first time a dashboard containing azure queries is loaded (not on every render)\n * Note: The queries used here are the ones pre-migration and pre-filterQuery\n *\n * This allows answering questions about:\n * - the adoption of the three query types (Azure Monitor, Azure Logs Analytics and Azure Resource Graph)\n * - stats about number of azure dashboards loaded, number of users\n * - stats about the grafana and plugins versions used by our users\n *\n * Dashboard: https://ops.grafana.net/d/Ad0pti0N/data-sources-adoption-tracking?orgId=1\n * Changelog:\n * - v9.1.0 : list of queries logged\n * - v9.1.2 : list removed in favour of stats, user_id removed\n */\nexport const trackAzureMonitorDashboardLoaded = (props: AzureMonitorDashboardLoadedProps) => {\n reportInteraction('grafana_ds_azuremonitor_dashboard_loaded', props);\n};\n\nexport type AzureMonitorDashboardLoadedProps = {\n grafana_version?: string;\n dashboard_id: string;\n org_id?: number;\n\n /** number of non hidden queries of type Azure Monitor if any */\n azure_monitor_queries: number;\n /** number of hidden queries (not executed) of type Azure Monitor if any */\n azure_monitor_queries_hidden: number;\n /** number of Azure Monitor queries using multiple resources */\n azure_monitor_multiple_resource: number;\n /** number of Azure Monitor queries */\n azure_monitor_query: number;\n\n /** number of non hidden queries of type Azure Logs Analytics if any */\n azure_log_analytics_queries: number;\n /** number of hidden queries (not executed) of type Azure Logs Analytics if any */\n azure_log_analytics_queries_hidden: number;\n /** number of Azure Log Analytics queries using multiple resources */\n azure_log_multiple_resource: number;\n /** number of Azure Log Analytics queries using time-range defined explicitly in query */\n azure_log_analytics_queries_query_time: number;\n /** number of Azure Log Analytics queries using Grafana time-range */\n azure_log_analytics_queries_grafana_time: number;\n /** number of Azure Log Analytics queries */\n azure_log_query: number;\n\n /** number of non hidden queries of type Azure Resource Graph if any */\n azure_resource_graph_queries: number;\n /** number of hidden queries (not executed) of type Azure Resource Graph if any */\n azure_resource_graph_queries_hidden: number;\n /** number of Azure Resource Graph queries using multiple subscriptions */\n azure_resource_graph_multiple_subscription: number;\n /** number of Azure Resource Graph queries */\n azure_resource_graph_query: number;\n\n /** number of non hidden queries of type Azure Traces if any */\n azure_traces_queries: number;\n /** number of hidden queries of type Azure Traces if any */\n azure_traces_queries_hidden: number;\n /** number of trace queries using multiple resources */\n azure_traces_multiple_resource: number;\n /** number of trace queries using table format */\n azure_traces_table: number;\n /** number of trace queries using trace format */\n azure_traces_trace: number;\n /** number of trace queries specifying operation ID */\n azure_traces_operation_id_specified: number;\n /** number of trace queries specifying event types */\n azure_traces_event_type_specified: number;\n /** number of trace queries using filters */\n azure_traces_filters: number;\n /** number of Azure Traces queries */\n azure_traces_query: number;\n\n /** variable query tracking */\n azure_subscriptions_query: number;\n azure_resource_groups_query: number;\n azure_namespaces_query: number;\n azure_resource_names_query: number;\n azure_metric_names_query: number;\n azure_workspaces_query: number;\n azure_grafana_template_variable_query: number;\n azure_locations_query: number;\n azure_unknown_query: number;\n};\n","import { DataSourcePlugin, DashboardLoadedEvent } from '@grafana/data';\nimport { getAppEvents } from '@grafana/runtime';\n\nimport { ConfigEditor } from './components/ConfigEditor';\nimport AzureMonitorQueryEditor from './components/QueryEditor';\nimport Datasource from './datasource';\nimport pluginJson from './plugin.json';\nimport { trackAzureMonitorDashboardLoaded } from './tracking';\nimport { AzureMonitorQuery, AzureDataSourceJsonData, AzureQueryType, ResultFormat } from './types';\n\nexport const plugin = new DataSourcePlugin<Datasource, AzureMonitorQuery, AzureDataSourceJsonData>(Datasource)\n .setConfigEditor(ConfigEditor)\n .setQueryEditor(AzureMonitorQueryEditor);\n\ninterface Statistics {\n hidden: number;\n visible: number;\n multiResource: number;\n count: number;\n [key: string]: number;\n}\n\n// Track dashboard loads to RudderStack\ngetAppEvents().subscribe<DashboardLoadedEvent<AzureMonitorQuery>>(\n DashboardLoadedEvent,\n ({ payload: { dashboardId, orgId, userId, grafanaVersion, queries } }) => {\n const azureQueries = queries[pluginJson.id];\n const common = {\n hidden: 0,\n visible: 0,\n multiResource: 0,\n count: 0,\n };\n let stats: { [key in AzureQueryType | string]: Statistics } = {\n [AzureQueryType.AzureMonitor]: {\n ...common,\n },\n [AzureQueryType.LogAnalytics]: {\n ...common,\n grafanaTime: 0,\n queryTime: 0,\n },\n [AzureQueryType.AzureResourceGraph]: {\n ...common,\n },\n [AzureQueryType.AzureTraces]: {\n ...common,\n table: 0,\n trace: 0,\n operationIdSpecified: 0,\n eventTypesSpecified: 0,\n filtersSpecified: 0,\n },\n [AzureQueryType.SubscriptionsQuery]: { ...common },\n [AzureQueryType.ResourceGroupsQuery]: { ...common },\n [AzureQueryType.NamespacesQuery]: { ...common },\n [AzureQueryType.ResourceNamesQuery]: { ...common },\n [AzureQueryType.MetricNamesQuery]: { ...common },\n [AzureQueryType.WorkspacesQuery]: { ...common },\n [AzureQueryType.GrafanaTemplateVariableFn]: { ...common },\n [AzureQueryType.LocationsQuery]: { ...common },\n unknown: { ...common },\n };\n\n azureQueries.forEach((query) => {\n if (query.queryType === AzureQueryType.AzureMonitor) {\n stats[AzureQueryType.AzureMonitor][query.hide ? 'hidden' : 'visible']++;\n if (query.azureMonitor?.resources && query.azureMonitor.resources.length > 1) {\n stats[AzureQueryType.AzureMonitor].multiResource++;\n }\n }\n if (query.queryType === AzureQueryType.LogAnalytics) {\n stats[AzureQueryType.LogAnalytics][query.hide ? 'hidden' : 'visible']++;\n stats[AzureQueryType.LogAnalytics][query.azureLogAnalytics?.dashboardTime ? 'grafanaTime' : 'queryTime']++;\n if (query.azureLogAnalytics?.resources && query.azureLogAnalytics.resources.length > 1) {\n stats[AzureQueryType.LogAnalytics].multiResource++;\n }\n }\n if (query.queryType === AzureQueryType.AzureResourceGraph) {\n stats[AzureQueryType.AzureResourceGraph][query.hide ? 'hidden' : 'visible']++;\n if (query.subscriptions && query.subscriptions.length > 1) {\n stats[AzureQueryType.AzureResourceGraph].multiResource++;\n }\n }\n if (query.queryType === AzureQueryType.AzureTraces) {\n stats[AzureQueryType.AzureTraces][query.hide ? 'hidden' : 'visible']++;\n if (query.azureTraces) {\n if (query.azureTraces.resultFormat) {\n stats[AzureQueryType.AzureTraces][\n query.azureTraces.resultFormat === ResultFormat.Trace ? ResultFormat.Trace : ResultFormat.Table\n ]++;\n }\n if (query.azureTraces.resources && query.azureTraces.resources.length > 1) {\n stats[AzureQueryType.AzureTraces].multiResource++;\n }\n if (query.azureTraces.operationId && query.azureTraces.operationId !== '') {\n stats[AzureQueryType.AzureTraces].operationIdSpecified++;\n }\n if (query.azureTraces.traceTypes && query.azureTraces.traceTypes.length > 0) {\n stats[AzureQueryType.AzureTraces].eventTypesSpecified++;\n }\n if (query.azureTraces.filters && query.azureTraces.filters.length > 0) {\n stats[AzureQueryType.AzureTraces].filtersSpecified++;\n }\n }\n }\n\n switch (query.queryType) {\n case AzureQueryType.AzureMonitor:\n case AzureQueryType.LogAnalytics:\n case AzureQueryType.AzureResourceGraph:\n case AzureQueryType.AzureTraces:\n case AzureQueryType.SubscriptionsQuery:\n case AzureQueryType.ResourceGroupsQuery:\n case AzureQueryType.NamespacesQuery:\n case AzureQueryType.ResourceNamesQuery:\n case AzureQueryType.MetricNamesQuery:\n case AzureQueryType.WorkspacesQuery:\n case AzureQueryType.GrafanaTemplateVariableFn:\n case AzureQueryType.LocationsQuery:\n stats[query.queryType].count++;\n break;\n default:\n stats.unknown.count++;\n }\n });\n\n if (azureQueries && azureQueries.length > 0) {\n trackAzureMonitorDashboardLoaded({\n grafana_version: grafanaVersion,\n dashboard_id: dashboardId,\n org_id: orgId,\n // Metrics queries stats\n azure_monitor_queries: stats[AzureQueryType.AzureMonitor].visible,\n azure_monitor_queries_hidden: stats[AzureQueryType.AzureMonitor].hidden,\n azure_monitor_multiple_resource: stats[AzureQueryType.AzureMonitor].multiResource,\n azure_monitor_query: stats[AzureQueryType.AzureMonitor].count,\n\n // Logs queries stats\n azure_log_analytics_queries: stats[AzureQueryType.LogAnalytics].visible,\n azure_log_analytics_queries_hidden: stats[AzureQueryType.LogAnalytics].hidden,\n azure_log_multiple_resource: stats[AzureQueryType.LogAnalytics].multiResource,\n azure_log_analytics_queries_grafana_time: stats[AzureQueryType.LogAnalytics].grafanaTime,\n azure_log_analytics_queries_query_time: stats[AzureQueryType.LogAnalytics].queryTime,\n azure_log_query: stats[AzureQueryType.LogAnalytics].count,\n\n // ARG queries stats\n azure_resource_graph_queries: stats[AzureQueryType.AzureResourceGraph].visible,\n azure_resource_graph_queries_hidden: stats[AzureQueryType.AzureResourceGraph].hidden,\n azure_resource_graph_multiple_subscription: stats[AzureQueryType.AzureResourceGraph].multiResource,\n azure_resource_graph_query: stats[AzureQueryType.AzureResourceGraph].count,\n\n // Traces queries stats\n azure_traces_queries: stats[AzureQueryType.AzureTraces].visible,\n azure_traces_queries_hidden: stats[AzureQueryType.AzureTraces].hidden,\n azure_traces_multiple_resource: stats[AzureQueryType.AzureTraces].multiResource,\n azure_traces_table: stats[AzureQueryType.AzureTraces].table,\n azure_traces_trace: stats[AzureQueryType.AzureTraces].trace,\n azure_traces_operation_id_specified: stats[AzureQueryType.AzureTraces].operationIdSpecified,\n azure_traces_event_type_specified: stats[AzureQueryType.AzureTraces].eventTypesSpecified,\n azure_traces_filters: stats[AzureQueryType.AzureTraces].filtersSpecified,\n azure_traces_query: stats[AzureQueryType.AzureTraces].count,\n\n // Variable queries stats\n azure_subscriptions_query: stats[AzureQueryType.SubscriptionsQuery].count,\n azure_resource_groups_query: stats[AzureQueryType.ResourceGroupsQuery].count,\n azure_namespaces_query: stats[AzureQueryType.NamespacesQuery].count,\n azure_resource_names_query: stats[AzureQueryType.ResourceNamesQuery].count,\n azure_metric_names_query: stats[AzureQueryType.MetricNamesQuery].count,\n azure_workspaces_query: stats[AzureQueryType.WorkspacesQuery].count,\n azure_grafana_template_variable_query: stats[AzureQueryType.GrafanaTemplateVariableFn].count,\n azure_locations_query: stats[AzureQueryType.LocationsQuery].count,\n\n // Unknown query type\n azure_unknown_query: stats.unknown.count,\n });\n }\n }\n);\n"],"names":["EditorHeader","children","styles","getStyles","theme","__defProp","__defProps","__getOwnPropDescs","__getOwnPropSymbols","__hasOwnProp","__propIsEnum","__defNormalProp","obj","key","value","__spreadValues","a","b","prop","__spreadProps","__objRest","source","exclude","target","InlineSelect","_a","_b","labelProp","props","getSelectStyles","id","components","SelectContainer","ValueContainer","className","TimeGrainConverter","timeGrain","timeGrainUnit","timeIntervals","interval","unit","toMinutes","allowedTimeGrains","timeGrains","o","closest","intervalMs","i","duration","offset","text","ResponseParser","result","textFieldName","valueFieldName","list","metricNamespace","metricName","defaultAggTypes","metricData","v","metricAvailabilities","avail","metadataDimensions","dimension","locations","location","hasOption","options","findOptions","values","set","accum","item","option","toOption","addValueToOptions","variableOptionGroup","optionValues","m","p","routeNames","interpolateVariable","variable","val","defaultAzureMonitorQuery","AzureQueryType","defaultAzureMetricQuery","defaultAzureLogsQuery","defaultAzureTracesQuery","defaultAzureTracesFilter","ResultFormat","defaultAzureMetricDimension","AzureCloud","concealed","getAuthType","config","getDefaultAzureCloud","getAzurePortalUrl","azureCloud","getAzureCloud","getSecret","secret","isCredentialsComplete","credentials","getCredentials","authType","updateCredentials","selectors","AzureCredentialsForm","azureCloudOptions","onCredentialsChange","disabled","managedIdentityEnabled","workloadIdentityEnabled","authTypeOptions","opts","onAuthTypeChange","selected","defaultAuthType","updated","onAzureCloudChange","onTenantIdChange","event","onClientIdChange","onClientSecretChange","onClientSecretReset","ConfigSection","Field","Select","opt","Input","Button","DefaultSubscription","subscriptions","getSubscriptions","onSubscriptionChange","onSubscriptionsChange","hasRequiredFields","loadSubscriptionsClicked","onLoadSubscriptions","updateSubscriptions","canceled","received","autoSelect","onChange","azureClouds","MonitorConfig","updateOptions","setSubscriptions","subscriptionId","receivedSubscriptions","useEffectOnce","ConfigEditor","optionsFunc","query","err","onOptionsChange","error","DataSourceDescription","Divider","Alert","SecureSocksProxySettings","messageFromElement","messageFromError","maybeAMessage","useLastError","errors","setErrors","addError","errorSource","errorsCopy","index","vSource","recentError","onQueryChange","newQuery","CodeEditor","DEFAULT_LABEL_WIDTH","labelWidth","inlineField","remainingProps","InlineField","EditorField","setError","setValues","change","containsSelectAll","c","allSubs","newSubs","FieldValidationMessage","ERROR_SOURCE","selectSubscriptions","fetchedSubscriptions","currentSubscriptions","currentSubscription","querySubscriptions","templateVars","sub","commonSubscriptions","datasource","results","selectAllSubscriptionOption","EditorRows","EditorRow","EditorFieldGroup","inputId","formatOptions","defaultValue","setFormatAs","resultFormat","handleChange","resources","renderAdvanced","isAdvancedOpen","setIsAdvancedOpen","Collapse","Space","ResourceRowType","EntryIcon","isOpen","type","Icon","NestedEntry","entry","isSelected","isDisabled","isSelectable","level","scrollIntoView","onToggleCollapse","onSelectedChange","hasChildren","handleToggleCollapse","handleSelectedChanged","ev","checkboxId","IconButton","Checkbox","UrlBuilder","templateSrv","resource","multipleResources","urlArray","subscription","resourceGroup","resourceName","metricNamespaceProcessed","metricNamespaceArray","resourceNameProcessed","resourceNameArray","provider","parentResource","baseUrl","apiVersion","globalRegion","resourceUri","region","customNamespace","url","RESOURCE_URI_REGEX","parseNamespaceAndName","metricNamespaceAndName","stringArray","namespaceArray","nextElem","parseResourceURI","resourceURI","groups","metricNamespaceAndResource","parseMultipleResourceDetails","parseResourceDetails","res","resourcesToStrings","resourceToString","isGUIDish","input","compareNamespaceAndName","rowNamespace","rowName","resourceNamespace","matchURI","rowURI","targetParams","rowParams","findRows","rows","uris","uri","row","findRow","addResources","targetParentId","newResources","draftState","draftRow","setResources","parsedResource","NestedRow","selectedRows","requestNestedRows","onRowSelectedChange","selectableEntryTypes","disableRow","rowStatus","setRowStatus","onRowToggleCollapse","selectedRow","childRow","FadeTransition","LoadingPlaceholder","searchFn","searchFilter","setSearchFilter","debouncedSearch","searchPhrase","resourcePickerData","onApply","onCancel","queryType","selectionNotice","isLoading","setIsLoading","setRows","setSelectedRows","internalSelected","setInternalSelected","errorMessage","setErrorMessage","shouldShowLimitFlag","setShouldShowLimitFlag","selectionNoticeText","loadInitialData","isValid","r","sanitized","found","parentRow","nestedRows","handleSelectionChanged","newRes","newSelected","newInternalSelected","handleApply","handleSearch","searchWord","searchResults","Modal","ResourceField","pickerIsOpen","setPickerIsOpen","handleOpenPicker","closePicker","ResourceLabel","resourcesComponents","setResourcesComponents","FormattedResource","icon","items","onResourceChange","removeResource","addResource","Label","Tooltip","AccessoryButton","setKustoQuery","kustoQuery","formatAs","setDashboardTime","dashboardTime","setTimeColumn","timeColumn","schema","monaco","setMonaco","editor","languages","model","handleEditorMount","TimeManagement","defaultTimeColumns","setDefaultTimeColumns","timeColumns","setTimeColumns","setDefaultColumn","column","timeColumnOptions","timeColumnsSet","defaultColumnsMap","db","table","cols","prev","curr","defaultColumns","handleTimeColumnChange","RadioButtonGroup","migrateWorkspaceQueryToResourceQuery","isWorkspaceGUID","useMigrations","migrationError","setMigrationError","hideFormatAs","timeRange","data","rowResourceNS","selectedRowSampleNs","setSchema","portalLinkButton","querySeries","RawQuery","lang","highlighted","QUERY_COMMANDS","COMPARISON_OPERATORS","ARITHMETIC_OPERATORS","NUMERIC_OPERATORS","GENERAL_FUNCTIONS","STRING_FUNCTIONS","DATETIME_FUNCTIONS","IP_FUNCTIONS","BOOLEAN_FUNCTIONS","AGGREGATION_FUNCTIONS_STATS","NON_AGGREGATION_FUNCS_STATS","STATS_FUNCS","KEYWORDS","FUNCTIONS","command","f","cheatsheetQueries","setCheatsheetQueries","areDropdownsOpen","setAreDropdownsOpen","visibleQueries","setVisibleQueries","searchInputValue","setSearchInputValue","dropdownMenu","category","getCheatsheetQueries","alphabetizedQueries","queriesByCategory","categoryQueries","queryId","filterQueriesBySearch","searchValue","visibleQueriesCategories","filteredQueries","filteredQueriesBySearch","filters","filterQueriesByCategory","categories","updatedVisibleQueries","selectedCategory","queryCategory","e","totalQueries","CustomScrollbar","Card","AzureCheatSheetModal","onClose","resourceTypeDisplayNames","multiResourceCompatibleTypes","resourceTypes","logsResourceTypes","onCommonPropChange","setCustomNamespace","selection","setMetricName","setAggregation","aggregation","setTimeGrain","setDimensionFilters","dimensions","appendDimensionFilter","operator","existingFilters","removeDimensionFilter","indexToRemove","newFilters","setDimensionFilterValue","fieldName","newFilter","setTop","top","setLegendAlias","alias","aggregationOptions","useDimensionLabels","dimensionLabels","setDimensionLabels","labelsObj","labels","series","fields","label","dimensionLower","prevLabels","newLabels","currentLabels","dimensionOptions","dimensionFilters","dimensionOperators","validDimensionOptions","t","dimensionFilter","onFieldChange","getValidDimensionOptions","selectedDimension","getValidFilterOptions","selectedFilter","filter","getValidMultiSelectOptions","selectedFilters","labelOptions","getValidOperators","selectedOperator","changedFunc","changed","properData","x","renderFilters","onDelete","EditorList","setValue","handleBlur","metricNames","metricNamespaces","timeGrainOptions","autoInterval","baseTimeGrains","useAsyncState","asyncFn","dependencies","finalValue","getResourceGroupAndName","useMetricNamespaces","useMetricNames","defaultMetricMetadata","useMetricMetadata","metricMetadata","setMetricMetadata","metadata","aggregations","newAggregation","newTimeGrain","rawResults","selectedValue","metricsMetadata","supportMultipleResource","namespace","rowResource","selectedRowSample","QueryHeader","queryTypes","getTraceProperties","traceTypes","propertyMap","setPropertyMap","range","azureTraces","property","queryString","lastValueFrom","makeRenderItem","renderItem","Filter","Option","innerProps","innerRef","isFocused","onClickMultiOption","queryTraceTypes","properties","loading","setLoading","setSelected","loadOptions","vals","promise","empty","ButtonSelect","Tables","tables","attributesOmit","availabilityResultsSchema","dependenciesSchema","eventsSchema","pageViewsSchema","requestsSchema","exceptionsSchema","tracesSchema","tablesSchema","tableTags","k","setQueryOperationId","operationId","setTraceTypes","setFilters","excludedProperties","queryFilters","updateFilters","updateQuery","getDefaultOptions","allEventTypes","defaultQuery","setOperationId","previousOperationId","usePrevious","OLD_DEFAULT_DROPDOWN_VALUE","migrateQuery","workingQuery","migrateLogAnalyticsToFromTimes","migrateTimeGrains","migrateToDefaultNamespace","migrateDimensionToDimensionFilter","migrateDimensionFilterToArray","migrateResourceUriToResourceObj","migrateResourceGroupAndName","oldDimension","azureMonitorQuery","staticProps","hasFilter","oldFilter","details","isWellFormedUri","DEFAULT_QUERY","prepareQuery","withDefaults","migratedQuery","onChangeQuery","preparedQuery","QueryEditor","baseQuery","baseOnRunQuery","onRunQuery","azureLogsCheatSheetModalOpen","setAzureLogsCheatSheetModalOpen","prevValue","EditorForQueryType","METADATA_FUNCTION_PARAMS","transformMetadataFunction","sourceSchema","fn","params","arg","match","name","transformMetadataToKustoSchema","nameOrIdOrSomething","templateVariables","database","globalScalarParameters","AzureLogAnalyticsDatasource","DataSourceWithBackend","instanceSettings","cloud","path","response","workspaceListUrl","interpolatedUri","scopedVars","workspace","filtersReplaced","expandedResources","field","defaultDropdownValue","hasValue","AzureMonitorDatasource","hasResource","hasResourceUri","preMigrationQuery","migratedTarget","azMonitorQuery","skipToken","promises","validMetricNamespace","nextToken","nextPage","storageNamespaces","workingQueries","replaced","multiple","currentQueries","q","providerName","locationMap","subLocations","AzureResourceGraphDatasource","ts","variableNames","subscriptionVar","RESOURCE_GRAPH_URL","logsSupportedResourceTypesKusto","ResourcePickerData","azureMonitorDatasource","searchType","searchQuery","parsedUri","currentSelection","resourceGroupURI","resourceGroups","resourcesForResourceGroup","allFetched","$skipToken","resourceResponse","resourceGroupUri","subscriptionURI","subscriptionName","resourceGroupName","responseResourceName","maxRetries","reqOptions","supportedMetricNamespaces","namespaces","namespaceVals","resourceObjs","newSelectedRows","rtype","migrateAnnotation","annotation","oldQuery","oldWorkspace","grafanaTemplateVariableFnMatches","isGrafanaTemplateVariableFnQuery","matches","createGrafanaTemplateVariableQuery","rawQuery","matchesForQuery","defaultSubscriptionId","createGrafanaTemplateVariableDetails","createLogAnalyticsTemplateVariableQuery","defaultWorkspaceId","migrateGrafanaTemplateVariableFn","grafanaTemplateVariableFn","migrateStringQueriesToObjectQueries","inputVal","setInputVal","updatedQuery","removeOption","AZURE_QUERY_VARIABLE_TYPE_OPTIONS","setVariableOptionGroup","requireSubscription","setRequireSubscription","hasResourceGroup","setHasResourceGroup","hasNamespace","setHasNamespace","hasRegion","setHasRegion","requireResourceGroup","setRequireResourceGroup","requireNamespace","setRequireNamespace","requireResource","setRequireResource","setResourceGroups","setNamespaces","regions","setRegions","subs","s","rgs","onQueryTypeChange","selectableValue","onChangeSubscription","onChangeResourceGroup","onChangeNamespace","onChangeRegion","onChangeResource","queryChange","GrafanaTemplateVariableFn","VariableSupport","request","promisedResults","queryObj","templateVariablesResults","loc","queryResp","from","metric","Datasource","byType","baseTarget","hasQueryForType","queryForType","observables","req","mappedQueryType","ds","forkJoin","map","frame","of","subQuery","queries","action","expression","trackAzureMonitorDashboardLoaded","dashboardId","orgId","userId","grafanaVersion","azureQueries","common","stats"],"sourceRoot":""}
Edit
Rename
Chmod
Delete
FILE
FOLDER
INFO
Name
Size
Permission
Action
static
---
0755
0.c88fc16b6533c8976681.js
11857 bytes
0644
0.c88fc16b6533c8976681.js.map
46011 bytes
0644
1118.6d1cbbd2070e00a7483d.js
9459 bytes
0644
1118.6d1cbbd2070e00a7483d.js.map
22012 bytes
0644
1121.6c31bf81768d3312b0d4.js
11557 bytes
0644
1121.6c31bf81768d3312b0d4.js.map
40274 bytes
0644
1122.1b3b5a9bdf4a2fc70a83.js
4310 bytes
0644
1122.1b3b5a9bdf4a2fc70a83.js.map
9301 bytes
0644
1133.cd705902767ed2e9bf55.js
107191 bytes
0644
1133.cd705902767ed2e9bf55.js.map
459177 bytes
0644
1216.ddb58ad09e0c4e3f4079.js
12860 bytes
0644
1216.ddb58ad09e0c4e3f4079.js.map
47906 bytes
0644
1282.2347f27d5b3a18a42a1e.js
2965 bytes
0644
1282.2347f27d5b3a18a42a1e.js.map
6699 bytes
0644
1345.8570fef914aafab94513.js
2223 bytes
0644
1345.8570fef914aafab94513.js.map
5201 bytes
0644
1347.8ad23b870a6e21306189.js
32035 bytes
0644
1347.8ad23b870a6e21306189.js.map
89851 bytes
0644
1420.f2553cafc235b7c32261.js
14576 bytes
0644
1420.f2553cafc235b7c32261.js.map
32839 bytes
0644
1438.897db349b7f48a15b9eb.js
2830 bytes
0644
1438.897db349b7f48a15b9eb.js.map
6911 bytes
0644
1446.babd36e7134aac1046c4.js
1832 bytes
0644
1446.babd36e7134aac1046c4.js.map
3282 bytes
0644
1488.ff35935a06f41b02b6cc.js
316 bytes
0644
1488.ff35935a06f41b02b6cc.js.map
1206 bytes
0644
1560.30962127c91e5eae9982.js
8916 bytes
0644
1560.30962127c91e5eae9982.js.map
20515 bytes
0644
1660.e1f66118fb028d12074f.js
21866 bytes
0644
1660.e1f66118fb028d12074f.js.map
71039 bytes
0644
1698.68ff1ef08e94a87836b3.js
12570 bytes
0644
1698.68ff1ef08e94a87836b3.js.map
46006 bytes
0644
1708.f42a783c0f6c7a317d49.js
2249 bytes
0644
1708.f42a783c0f6c7a317d49.js.map
2954 bytes
0644
1710.d96221051fceaf8c89dd.js
10172 bytes
0644
1710.d96221051fceaf8c89dd.js.map
22097 bytes
0644
1740.e57d920c47a11759ade4.js
6204 bytes
0644
1740.e57d920c47a11759ade4.js.map
13740 bytes
0644
1888.0ede69d3190c536744b9.js
6822 bytes
0644
1888.0ede69d3190c536744b9.js.map
15421 bytes
0644
1914.58113477b565d57e8bfe.js
10710 bytes
0644
1914.58113477b565d57e8bfe.js.map
23555 bytes
0644
198.b84c0e4f5759344ae05a.js
8267 bytes
0644
198.b84c0e4f5759344ae05a.js.map
19446 bytes
0644
205.6c51b5e35c8147226738.js
3542 bytes
0644
205.6c51b5e35c8147226738.js.map
8376 bytes
0644
2058.0e5df44647184aaf02e2.js
1252 bytes
0644
2058.0e5df44647184aaf02e2.js.map
4744 bytes
0644
2077.12b2df3682085a92a810.js
34133 bytes
0644
2077.12b2df3682085a92a810.js.map
122011 bytes
0644
2094.259625d8acf28b9c7361.js
16518 bytes
0644
2094.259625d8acf28b9c7361.js.map
41269 bytes
0644
21.afca69f2d336e287a655.js
6172 bytes
0644
21.afca69f2d336e287a655.js.map
17305 bytes
0644
2136.9c8dcd43d3af327f51f5.js
498667 bytes
0644
2136.9c8dcd43d3af327f51f5.js.map
1908011 bytes
0644
2228.cf629cf4a83c5b6c2671.js
269 bytes
0644
2228.cf629cf4a83c5b6c2671.js.map
457 bytes
0644
2244.9324c28eca7d2ffb7568.js
3396 bytes
0644
2244.9324c28eca7d2ffb7568.js.map
7683 bytes
0644
2261.ac6a26854d5acee00776.js
106373 bytes
0644
2261.ac6a26854d5acee00776.js.map
478562 bytes
0644
2278.bdd73b14b6337c6b14e4.js
5754 bytes
0644
2278.bdd73b14b6337c6b14e4.js.map
13399 bytes
0644
2398.3de0e7aa3057b7dcf9da.js
8016 bytes
0644
2398.3de0e7aa3057b7dcf9da.js.map
18383 bytes
0644
2514.c86950e9813e27962050.js
1983 bytes
0644
2514.c86950e9813e27962050.js.map
4863 bytes
0644
2571.345ecfd2b82551018f2e.js
162139 bytes
0644
2571.345ecfd2b82551018f2e.js.map
2046 bytes
0644
2586.972e9a7d564398afee76.js
6385 bytes
0644
2586.972e9a7d564398afee76.js.map
14676 bytes
0644
2658.f4100815829c4d37d35c.js
5432 bytes
0644
2658.f4100815829c4d37d35c.js.map
13650 bytes
0644
2686.2fbaa7db9c01d59cad8d.js
2815 bytes
0644
2686.2fbaa7db9c01d59cad8d.js.map
6564 bytes
0644
2692.20098ad0182743d98d62.js
2282 bytes
0644
2692.20098ad0182743d98d62.js.map
5680 bytes
0644
2694.a31d749361a36eb167da.js
2726 bytes
0644
2694.a31d749361a36eb167da.js.map
3618 bytes
0644
2745.2e5ec1fdf377d2940fb4.js
33584 bytes
0644
2745.2e5ec1fdf377d2940fb4.js.map
120277 bytes
0644
2962.4c3147d8ee365fe296ef.js
7640 bytes
0644
2962.4c3147d8ee365fe296ef.js.map
17621 bytes
0644
3042.248a4194805a8500fd28.js
19010 bytes
0644
3042.248a4194805a8500fd28.js.map
38148 bytes
0644
3062.4e9a427c2a59d53f902e.js
4663 bytes
0644
3062.4e9a427c2a59d53f902e.js.map
10650 bytes
0644
3082.c09cff56c35d736ee8b6.js
52872 bytes
0644
3082.c09cff56c35d736ee8b6.js.map
56822 bytes
0644
3096.8d41728a4f5010bc56a2.js
4378 bytes
0644
3096.8d41728a4f5010bc56a2.js.map
10739 bytes
0644
3098.f22ad6dab13d06477be0.js
31462 bytes
0644
3098.f22ad6dab13d06477be0.js.map
85588 bytes
0644
3182.1d531f28507c00e391fc.js
13817 bytes
0644
3182.1d531f28507c00e391fc.js.map
26653 bytes
0644
3407.666eb88a718e66b93f72.js
34425 bytes
0644
3407.666eb88a718e66b93f72.js.map
103716 bytes
0644
3418.d31d882b87bd5a2ef66f.js
33061 bytes
0644
3418.d31d882b87bd5a2ef66f.js.map
114234 bytes
0644
3541.8d063e3d43d55745d89b.js
20582 bytes
0644
3541.8d063e3d43d55745d89b.js.map
67154 bytes
0644
3543.eecef49ce94da5ee0418.js
136752 bytes
0644
3543.eecef49ce94da5ee0418.js.map
446118 bytes
0644
3622.976b1aef94b333e450b9.js
1260 bytes
0644
3622.976b1aef94b333e450b9.js.map
2819 bytes
0644
3686.102abfc00452299017bb.js
87 bytes
0644
3718.3993946b7a0eb8f64b4d.js
23620 bytes
0644
3718.3993946b7a0eb8f64b4d.js.map
92024 bytes
0644
3726.3adfe210678d2cd26969.js
31765 bytes
0644
3726.3adfe210678d2cd26969.js.map
118227 bytes
0644
398.4e93ffb675609ea7a9c6.js
2990 bytes
0644
398.4e93ffb675609ea7a9c6.js.map
7145 bytes
0644
4114.953b39a9ce57caa0e87a.js
2536 bytes
0644
4114.953b39a9ce57caa0e87a.js.map
6028 bytes
0644
4120.67bf5d203ed4a2eb5f1b.js
3229 bytes
0644
4120.67bf5d203ed4a2eb5f1b.js.map
7533 bytes
0644
4209.c7060d489834063658f5.js
17352 bytes
0644
4209.c7060d489834063658f5.js.map
30980 bytes
0644
4254.c5f4a5512b252e3a5796.js
71716 bytes
0644
4254.c5f4a5512b252e3a5796.js.map
237783 bytes
0644
4289.d5662b0904798ff437e9.js
16496 bytes
0644
4289.d5662b0904798ff437e9.js.map
32015 bytes
0644
4334.bc078c368a20ed3257b6.js
2598 bytes
0644
4334.bc078c368a20ed3257b6.js.map
6308 bytes
0644
4630.b604ea691184ba563d59.js
5585 bytes
0644
4630.b604ea691184ba563d59.js.map
11866 bytes
0644
4680.358dfdd92851f69ecc97.js
4573 bytes
0644
4680.358dfdd92851f69ecc97.js.map
10841 bytes
0644
4698.696713071ff5d9929a11.js
3682 bytes
0644
4698.696713071ff5d9929a11.js.map
8967 bytes
0644
4787.bd938ea7cb58d64ee246.js
738 bytes
0644
4787.bd938ea7cb58d64ee246.js.map
2168 bytes
0644
4839.17a10e0ceca3eb8954b4.js
39585 bytes
0644
4839.17a10e0ceca3eb8954b4.js.map
145699 bytes
0644
494.8cf705bc1ea509187c88.js
3796 bytes
0644
494.8cf705bc1ea509187c88.js.map
8987 bytes
0644
4958.cd447d877778fc5af081.js
4923 bytes
0644
4958.cd447d877778fc5af081.js.map
11000 bytes
0644
4962.0da526ad79f816a15985.js
2242 bytes
0644
4962.0da526ad79f816a15985.js.map
4978 bytes
0644
50.7b1e44d5b9dbbed566be.js
617497 bytes
0644
50.7b1e44d5b9dbbed566be.js.map
2271464 bytes
0644
5017.003cacead1bba1cba035.js
3567142 bytes
0644
5017.003cacead1bba1cba035.js.map
13214665 bytes
0644
5130.4d31108de97088a3b014.js
2850 bytes
0644
5130.4d31108de97088a3b014.js.map
6536 bytes
0644
5196.064b914693b6a5591a48.js
4035 bytes
0644
5196.064b914693b6a5591a48.js.map
10273 bytes
0644
5240.eceb5f73f807ac22d800.js
704 bytes
0644
5240.eceb5f73f807ac22d800.js.map
2618 bytes
0644
5277.ce6608b6f47246e32767.js
269 bytes
0644
5277.ce6608b6f47246e32767.js.map
457 bytes
0644
5280.4348c762594edebf7d0e.js
16657 bytes
0644
5280.4348c762594edebf7d0e.js.map
89146 bytes
0644
5356.eabc0dc2021a3814a65f.js
10156 bytes
0644
5356.eabc0dc2021a3814a65f.js.map
25249 bytes
0644
5358.7c5e9e1b192582f3082d.js
6173 bytes
0644
5358.7c5e9e1b192582f3082d.js.map
19652 bytes
0644
5364.ac21c32fd45a27bc998a.js
3070 bytes
0644
5364.ac21c32fd45a27bc998a.js.map
7368 bytes
0644
5398.d0c11aa7c1232f4afe44.js
81872 bytes
0644
5398.d0c11aa7c1232f4afe44.js.map
769414 bytes
0644
5428.e85b0800b30feca9d7dc.js
330175 bytes
0644
5428.e85b0800b30feca9d7dc.js.map
530929 bytes
0644
5511.93023985e5c5efe49ae2.js
21275 bytes
0644
5511.93023985e5c5efe49ae2.js.map
93188 bytes
0644
5550.9284e42acc3f2bbdfc9d.js
7039 bytes
0644
5550.9284e42acc3f2bbdfc9d.js.map
16382 bytes
0644
558.701e8b4db7b852c4a10d.js
12211 bytes
0644
558.701e8b4db7b852c4a10d.js.map
24505 bytes
0644
5618.638c32d58d896f3f7261.js
3348 bytes
0644
5618.638c32d58d896f3f7261.js.map
8181 bytes
0644
5648.cb3fd92dbbc06f7d45d2.js
57392 bytes
0644
5648.cb3fd92dbbc06f7d45d2.js.map
60585 bytes
0644
5786.db7abc3b8e4f474a8f7b.js
5325 bytes
0644
5786.db7abc3b8e4f474a8f7b.js.map
11885 bytes
0644
5807.f05d997ece5811bbc849.js
2922915 bytes
0644
5807.f05d997ece5811bbc849.js.map
10524334 bytes
0644
5950.30ec6aaa9dcece6c3b3c.js
4616249 bytes
0644
5950.30ec6aaa9dcece6c3b3c.js.map
19277501 bytes
0644
6018.f4de7ac19ac8f0c774e6.js
5861 bytes
0644
6018.f4de7ac19ac8f0c774e6.js.map
13314 bytes
0644
6029.0549a3fcb50e73c4b256.js
409895 bytes
0644
6029.0549a3fcb50e73c4b256.js.map
998408 bytes
0644
6185.883629fcc773b4968b24.js
2258 bytes
0644
6185.883629fcc773b4968b24.js.map
4788 bytes
0644
6263.e4ef9aaa3073ebacc3a5.js
54594 bytes
0644
6263.e4ef9aaa3073ebacc3a5.js.map
242030 bytes
0644
6302.257b2eb06c25ee74090e.js
8440 bytes
0644
6302.257b2eb06c25ee74090e.js.map
19322 bytes
0644
6359.f824c85233ec703f8cea.js
11411 bytes
0644
6359.f824c85233ec703f8cea.js.map
41881 bytes
0644
6377.45d36c143a694fc45bd3.js
20571 bytes
0644
6377.45d36c143a694fc45bd3.js.map
79590 bytes
0644
6378.27b1e6d863a0a3b85962.js
977993 bytes
0644
6378.27b1e6d863a0a3b85962.js.map
3865587 bytes
0644
6414.192cf271de6ecbbbcb11.js
3984 bytes
0644
6414.192cf271de6ecbbbcb11.js.map
9134 bytes
0644
6446.b4b93ee91aa1bb57ea93.js
7731 bytes
0644
6446.b4b93ee91aa1bb57ea93.js.map
17485 bytes
0644
6464.f379e014f9909e621de6.js
34429 bytes
0644
6464.f379e014f9909e621de6.js.map
113303 bytes
0644
6499.9f52e0855fd4782a8b45.js
78297 bytes
0644
6499.9f52e0855fd4782a8b45.js.map
273155 bytes
0644
6587.bfb1ca0c32c6f325b0df.js
135004 bytes
0644
6587.bfb1ca0c32c6f325b0df.js.map
541974 bytes
0644
660.838743295c2108f3492d.js
43101 bytes
0644
660.838743295c2108f3492d.js.map
100340 bytes
0644
6678.a615dbe07b8a3e591e66.js
14725 bytes
0644
6678.a615dbe07b8a3e591e66.js.map
51145 bytes
0644
680.1a328432fae403eacab3.js
53846 bytes
0644
680.1a328432fae403eacab3.js.map
57615 bytes
0644
6830.0c200fec1efc2be388e2.js
5811 bytes
0644
6830.0c200fec1efc2be388e2.js.map
13972 bytes
0644
6934.fa19d392db34411fb300.js
168944 bytes
0644
6934.fa19d392db34411fb300.js.map
540337 bytes
0644
6940.9c5d3a2dcf9d7d58fa2c.js
3408 bytes
0644
6940.9c5d3a2dcf9d7d58fa2c.js.map
8039 bytes
0644
6969.f8f153735314f9426000.js
1119 bytes
0644
6969.f8f153735314f9426000.js.map
4230 bytes
0644
6990.cc2f5674128929a3f870.js
4418 bytes
0644
6990.cc2f5674128929a3f870.js.map
10503 bytes
0644
7048.117de444b1e1cb5a1360.js
4365 bytes
0644
7048.117de444b1e1cb5a1360.js.map
10316 bytes
0644
7166.480da6892ee84ee8bb53.js
593985 bytes
0644
7166.480da6892ee84ee8bb53.js.map
2430098 bytes
0644
7200.dc60128b9d612fc7b5b0.js
3634 bytes
0644
7200.dc60128b9d612fc7b5b0.js.map
8184 bytes
0644
7246.3adf293a34fa2043387b.js
4306 bytes
0644
7246.3adf293a34fa2043387b.js.map
9084 bytes
0644
7400.024c96bd5b99b8b47a63.js
14112 bytes
0644
7400.024c96bd5b99b8b47a63.js.map
64001 bytes
0644
7409.24316c87d08c1053c46a.js
3287 bytes
0644
7409.24316c87d08c1053c46a.js.map
11649 bytes
0644
7455.845968885abe369e6479.js
19801 bytes
0644
7455.845968885abe369e6479.js.map
77213 bytes
0644
7466.09e6e197d2507f62097d.js
11670 bytes
0644
7466.09e6e197d2507f62097d.js.map
24830 bytes
0644
7515.95323f0dfbd0de010e5c.js
1083 bytes
0644
7515.95323f0dfbd0de010e5c.js.map
1321 bytes
0644
7613.6334cff4df12cc157522.js
808779 bytes
0644
7613.6334cff4df12cc157522.js.map
991378 bytes
0644
7836.6a7e4207e70fc2dc235f.js
7192 bytes
0644
7836.6a7e4207e70fc2dc235f.js.map
17613 bytes
0644
7882.1a3cc418752c83396970.js
3743 bytes
0644
7882.1a3cc418752c83396970.js.map
14950 bytes
0644
7886.485c46f14540aa23cf70.js
8668 bytes
0644
7886.485c46f14540aa23cf70.js.map
20124 bytes
0644
7914.2b1a06c504df18e20fe4.js
2390 bytes
0644
7914.2b1a06c504df18e20fe4.js.map
6418 bytes
0644
7982.6761217193d3060dbf0e.js
188973 bytes
0644
7982.6761217193d3060dbf0e.js.map
1737667 bytes
0644
8054.094788468423bb88ee68.js
38124 bytes
0644
8054.094788468423bb88ee68.js.map
132296 bytes
0644
8107.92bd414247a1d05c014f.js
5144 bytes
0644
8107.92bd414247a1d05c014f.js.map
15320 bytes
0644
8230.2eedae6021a4715c6dea.js
2413 bytes
0644
8230.2eedae6021a4715c6dea.js.map
5812 bytes
0644
8332.f4b05d2f028641445650.js
3177 bytes
0644
8332.f4b05d2f028641445650.js.map
7186 bytes
0644
8334.c95ec0eb6900c0cf7e89.js
7803 bytes
0644
8334.c95ec0eb6900c0cf7e89.js.map
17714 bytes
0644
8390.1fd9505094c8cf8830ab.js
2096 bytes
0644
8390.1fd9505094c8cf8830ab.js.map
5157 bytes
0644
84.a6f8658e6a033d642231.js
30608 bytes
0644
84.a6f8658e6a033d642231.js.map
142543 bytes
0644
8494.4470c87b7093ddf70db7.js
2180 bytes
0644
8494.4470c87b7093ddf70db7.js.map
4863 bytes
0644
8542.1391ab96a455b01963a7.js
1514 bytes
0644
8542.1391ab96a455b01963a7.js.map
3249 bytes
0644
8566.e05562713181c6ca30fe.js
3852 bytes
0644
8566.e05562713181c6ca30fe.js.map
8781 bytes
0644
8730.3dcdd8cbf22c63b45d78.js
2109 bytes
0644
8730.3dcdd8cbf22c63b45d78.js.map
2893 bytes
0644
8786.1b0e43b80c82c73e2096.js
1535 bytes
0644
8786.1b0e43b80c82c73e2096.js.map
4055 bytes
0644
8902.37d0b14aa6ef24687b7b.js
2673 bytes
0644
8902.37d0b14aa6ef24687b7b.js.map
5993 bytes
0644
8990.5a822b8788ebf0bdba81.js
3969 bytes
0644
8990.5a822b8788ebf0bdba81.js.map
9161 bytes
0644
9034.200fc7a09b466256c9a9.js
3486 bytes
0644
9034.200fc7a09b466256c9a9.js.map
8180 bytes
0644
9038.7ae2448b9cc5c423aeca.js
4937 bytes
0644
9038.7ae2448b9cc5c423aeca.js.map
11973 bytes
0644
9118.3121c6b96ec7dc211973.js
48311 bytes
0644
9118.3121c6b96ec7dc211973.js.map
62149 bytes
0644
9150.9eb62d45f9b21cb38850.js
10056 bytes
0644
9150.9eb62d45f9b21cb38850.js.map
21143 bytes
0644
9199.9897e268d6d13e834d4c.js
2307 bytes
0644
9199.9897e268d6d13e834d4c.js.map
8853 bytes
0644
9320.c403e78b78aa6df1d0bd.js
336139 bytes
0644
9320.c403e78b78aa6df1d0bd.js.map
1624993 bytes
0644
9355.421530b20c759bb75633.js
22098 bytes
0644
9355.421530b20c759bb75633.js.map
66961 bytes
0644
9384.a0d5fc49f1b15b3e311e.js
2855 bytes
0644
9384.a0d5fc49f1b15b3e311e.js.map
3717 bytes
0644
9390.fa2af7f3d3d9600c08ee.js
4201 bytes
0644
9390.fa2af7f3d3d9600c08ee.js.map
9682 bytes
0644
946.f2494c0c39a9590349b9.js
9194 bytes
0644
946.f2494c0c39a9590349b9.js.map
22193 bytes
0644
9510.4cfa85a51931dc20573a.js
2949 bytes
0644
9510.4cfa85a51931dc20573a.js.map
6939 bytes
0644
9521.de2a74ca5eb365810ca5.js
46306 bytes
0644
9521.de2a74ca5eb365810ca5.js.map
51040 bytes
0644
9538.996ade7a03ccdb01942d.js
64493 bytes
0644
9538.996ade7a03ccdb01942d.js.map
49212 bytes
0644
9569.a8d60b39654a160cb917.js
27965 bytes
0644
9569.a8d60b39654a160cb917.js.map
99160 bytes
0644
9643.b408884004ca73c102bc.js
627 bytes
0644
9643.b408884004ca73c102bc.js.map
2195 bytes
0644
968.22e079d28acb4131d34c.js
4001 bytes
0644
968.22e079d28acb4131d34c.js.map
9740 bytes
0644
970.a61e37b9b897c8098261.js
5239 bytes
0644
970.a61e37b9b897c8098261.js.map
13858 bytes
0644
9711.d6e977bd60f0e5ba673d.js
13555 bytes
0644
9711.d6e977bd60f0e5ba673d.js.map
43973 bytes
0644
9737.3340c89ea96d33307cc7.js
1001 bytes
0644
9737.3340c89ea96d33307cc7.js.map
3504 bytes
0644
9739.5a801055fcf72bf4d06f.js
1147 bytes
0644
9739.5a801055fcf72bf4d06f.js.map
4390 bytes
0644
9772.49e918c9331237552c0b.js
141 bytes
0644
9772.49e918c9331237552c0b.js.map
416 bytes
0644
9838.b8f01dc360f0c2151291.js
4003 bytes
0644
9838.b8f01dc360f0c2151291.js.map
8118 bytes
0644
AdminAuthentication.b7044adf53b669e61a87.js
22504 bytes
0644
AdminAuthentication.b7044adf53b669e61a87.js.map
67352 bytes
0644
AdminEditOrgPage.96fb6c37346641f44246.js
6369 bytes
0644
AdminEditOrgPage.96fb6c37346641f44246.js.map
20602 bytes
0644
AdminFeatureTogglesPage.22157fe31f358f1c4f09.js
4939 bytes
0644
AdminFeatureTogglesPage.22157fe31f358f1c4f09.js.map
16531 bytes
0644
AdminListOrgsPage.f01c8496fd635e20124b.js
2702 bytes
0644
AdminListOrgsPage.f01c8496fd635e20124b.js.map
7735 bytes
0644
AdminSettings.845c6def917892a0c1f9.js
1903 bytes
0644
AdminSettings.845c6def917892a0c1f9.js.map
5580 bytes
0644
AlertAmRoutes.10a0d9a23a082caf12c8.js
54554 bytes
0644
AlertAmRoutes.10a0d9a23a082caf12c8.js.map
208792 bytes
0644
AlertGroups.efd523dc41621f9f7935.js
10088 bytes
0644
AlertGroups.efd523dc41621f9f7935.js.map
39108 bytes
0644
AlertRuleListIndex.f0b17a6119cc5ea575ed.js
44623 bytes
0644
AlertRuleListIndex.f0b17a6119cc5ea575ed.js.map
156842 bytes
0644
AlertRuleListLegacy.8e675db4469232c87308.js
6270 bytes
0644
AlertRuleListLegacy.8e675db4469232c87308.js.map
18086 bytes
0644
AlertSilences.4ff252ad4c0057124d5d.js
24687 bytes
0644
AlertSilences.4ff252ad4c0057124d5d.js.map
83377 bytes
0644
AlertTabCtrl.d3377d127a336a69beb5.js
9844 bytes
0644
AlertTabCtrl.d3377d127a336a69beb5.js.map
27934 bytes
0644
AlertingAdmin.e62f9c73a69abe6a1ac0.js
10523 bytes
0644
AlertingAdmin.e62f9c73a69abe6a1ac0.js.map
37393 bytes
0644
AlertingFeatureTogglePage.f971bb7b2ad4ceb0acbd.js
672 bytes
0644
AlertingFeatureTogglePage.f971bb7b2ad4ceb0acbd.js.map
1220 bytes
0644
AlertingHome.0d6be993ef4a3df37345.js
33492 bytes
0644
AlertingHome.0d6be993ef4a3df37345.js.map
106868 bytes
0644
AlertingRedirectToRule.37a0040f89e20b99b751.js
3648 bytes
0644
AlertingRedirectToRule.37a0040f89e20b99b751.js.map
10875 bytes
0644
AlertingRuleForm.66bb5b2724b31ae6a5a4.js
79931 bytes
0644
AlertingRuleForm.66bb5b2724b31ae6a5a4.js.map
292923 bytes
0644
AlertingUpgrade.c757b99e306db50cdb16.js
31333 bytes
0644
AlertingUpgrade.c757b99e306db50cdb16.js.map
98330 bytes
0644
AngularApp.7e72879caebef22a5217.js
72809 bytes
0644
AngularApp.7e72879caebef22a5217.js.map
102853 bytes
0644
ApiKeysPage.12b0cd511f7b1e9c50dc.js
8422 bytes
0644
ApiKeysPage.12b0cd511f7b1e9c50dc.js.map
23375 bytes
0644
BenchmarksPage.3a183df3d44714f9a96a.js
2941 bytes
0644
BenchmarksPage.3a183df3d44714f9a96a.js.map
9749 bytes
0644
ChangePasswordPage.5e0562f6a9674bd95cfe.js
470 bytes
0644
ChangePasswordPage.5e0562f6a9674bd95cfe.js.map
1195 bytes
0644
Connections.b53c715b9b9a782d8647.js
32448 bytes
0644
Connections.b53c715b9b9a782d8647.js.map
112998 bytes
0644
CorrelationsFeatureToggle.71addced22f59948b708.js
674 bytes
0644
CorrelationsFeatureToggle.71addced22f59948b708.js.map
1149 bytes
0644
CorrelationsPage.4e02feddf752bdf7cfe6.js
22725 bytes
0644
CorrelationsPage.4e02feddf752bdf7cfe6.js.map
69262 bytes
0644
CreateTeam.dbde5b87278cf087cc5e.js
3046 bytes
0644
CreateTeam.dbde5b87278cf087cc5e.js.map
9594 bytes
0644
DashboardImport.06e6c4c03113061aae6c.js
18153 bytes
0644
DashboardImport.06e6c4c03113061aae6c.js.map
58242 bytes
0644
DashboardListPage.dac1fe75fbaa4f9b1c23.js
30967 bytes
0644
DashboardListPage.dac1fe75fbaa4f9b1c23.js.map
108517 bytes
0644
DashboardPage.5e50193556ad6b828f5d.js
2786 bytes
0644
DashboardPage.5e50193556ad6b828f5d.js.map
8754 bytes
0644
DashboardPageProxy.9a6d60e5cac89c11c71c.js
65136 bytes
0644
DashboardPageProxy.9a6d60e5cac89c11c71c.js.map
226791 bytes
0644
DataTrailsPage.aa19ca6750eb3f91ac5d.js
331 bytes
0644
DataTrailsPage.aa19ca6750eb3f91ac5d.js.map
582 bytes
0644
EditNotificationChannelLegacy.75122e6dbfb215d89d81.js
10507 bytes
0644
EditNotificationChannelLegacy.75122e6dbfb215d89d81.js.map
37444 bytes
0644
EmbeddedDashboard.3856404d3d608c739864.js
1768 bytes
0644
EmbeddedDashboard.3856404d3d608c739864.js.map
5917 bytes
0644
FolderAlerting.a0fe69e3574320c8a74a.js
9633 bytes
0644
FolderAlerting.a0fe69e3574320c8a74a.js.map
29985 bytes
0644
FolderLibraryPanelsPage.95dd7bf6735e202a79d2.js
8599 bytes
0644
FolderLibraryPanelsPage.95dd7bf6735e202a79d2.js.map
25919 bytes
0644
LibraryPanelsPage.4a952d4aa9c21984995a.js
2704 bytes
0644
LibraryPanelsPage.4a952d4aa9c21984995a.js.map
7623 bytes
0644
ListPublicDashboardPage.469a693c4011a5193fcd.js
4713 bytes
0644
ListPublicDashboardPage.469a693c4011a5193fcd.js.map
14309 bytes
0644
MuteTimings.cb66b37f52c9ee3ce1da.js
20855 bytes
0644
MuteTimings.cb66b37f52c9ee3ce1da.js.map
58932 bytes
0644
NewNotificationChannelLegacy.1d57814bc534bb1a3681.js
9785 bytes
0644
NewNotificationChannelLegacy.1d57814bc534bb1a3681.js.map
32951 bytes
0644
NewOrgPage.2bb0e1cab09f0cbd0310.js
1325 bytes
0644
NewOrgPage.2bb0e1cab09f0cbd0310.js.map
3158 bytes
0644
NotificationsListLegacyPage.33212668898a6db361a8.js
2547 bytes
0644
NotificationsListLegacyPage.33212668898a6db361a8.js.map
6671 bytes
0644
NotificationsListPage.1eb9cb05bf88eee08291.js
1620 bytes
0644
NotificationsListPage.1eb9cb05bf88eee08291.js.map
3378 bytes
0644
NotificationsPage.d26b90d7348139106351.js
4646 bytes
0644
NotificationsPage.d26b90d7348139106351.js.map
25381 bytes
0644
OrgDetailsPage.2d5c98f188683c2e1d3b.js
6742 bytes
0644
OrgDetailsPage.2d5c98f188683c2e1d3b.js.map
17850 bytes
0644
PlaylistEditPage.d14b3673a1bb03ca0dbb.js
6892 bytes
0644
PlaylistEditPage.d14b3673a1bb03ca0dbb.js.map
19989 bytes
0644
PlaylistNewPage.13696f39b95b8416ede2.js
6583 bytes
0644
PlaylistNewPage.13696f39b95b8416ede2.js.map
19084 bytes
0644
PlaylistPage.8f45dcc09add615f90e8.js
7895 bytes
0644
PlaylistPage.8f45dcc09add615f90e8.js.map
25502 bytes
0644
PlaylistStartPage.8be462b13a24cddee188.js
275 bytes
0644
PlaylistStartPage.8be462b13a24cddee188.js.map
698 bytes
0644
PluginListPage.815b65d32380d0a800f7.js
12167 bytes
0644
PluginListPage.815b65d32380d0a800f7.js.map
43537 bytes
0644
PluginPage.c790de5e17a0b728dd3a.js
314 bytes
0644
PluginPage.c790de5e17a0b728dd3a.js.map
668 bytes
0644
ProfileFeatureTogglePage.a14257ebc5da1e8c85e0.js
552 bytes
0644
ProfileFeatureTogglePage.a14257ebc5da1e8c85e0.js.map
1012 bytes
0644
PublicDashboardPage.51c7c24941781e091898.js
4295 bytes
0644
PublicDashboardPage.51c7c24941781e091898.js.map
14393 bytes
0644
SelectOrgPage.695c19a5101a3a03ee28.js
1124 bytes
0644
SelectOrgPage.695c19a5101a3a03ee28.js.map
2993 bytes
0644
SendResetMailPage.f16b7172a87070f57227.js
1736 bytes
0644
SendResetMailPage.f16b7172a87070f57227.js.map
4350 bytes
0644
ServerStats.3fbd2493deb8f4598755.js
3863 bytes
0644
ServerStats.3fbd2493deb8f4598755.js.map
11534 bytes
0644
ServiceAccountCreatePage.4f989fb6cd2a41193ff0.js
2440 bytes
0644
ServiceAccountCreatePage.4f989fb6cd2a41193ff0.js.map
7939 bytes
0644
ServiceAccountPage.bc7c35b63b03ccc89628.js
14806 bytes
0644
ServiceAccountPage.bc7c35b63b03ccc89628.js.map
51593 bytes
0644
ServiceAccountsPage.baaa08c045390c05e276.js
14565 bytes
0644
ServiceAccountsPage.baaa08c045390c05e276.js.map
46399 bytes
0644
SignupInvited.81ad56aceb8dd1839e15.js
2360 bytes
0644
SignupInvited.81ad56aceb8dd1839e15.js.map
6096 bytes
0644
SnapshotListPage.519c760ed66124a771ff.js
3061 bytes
0644
SnapshotListPage.519c760ed66124a771ff.js.map
9043 bytes
0644
SoloPanelPage.c729750a88c3fa90d1cc.js
3229 bytes
0644
SoloPanelPage.c729750a88c3fa90d1cc.js.map
12316 bytes
0644
SoloPanelPageOld.6518c21ccaf29701fa97.js
1727 bytes
0644
SoloPanelPageOld.6518c21ccaf29701fa97.js.map
5509 bytes
0644
StoragePage.9b93a99e75f7f2842c11.js
14081 bytes
0644
StoragePage.9b93a99e75f7f2842c11.js.map
48740 bytes
0644
SupportBundles.567d512b3f919b8112e4.js
3058 bytes
0644
SupportBundles.567d512b3f919b8112e4.js.map
8751 bytes
0644
SupportBundlesCreate.fc6b6e4cf6366f751081.js
2779 bytes
0644
SupportBundlesCreate.fc6b6e4cf6366f751081.js.map
8882 bytes
0644
TeamList.2e23d37c91734f608f09.js
9019 bytes
0644
TeamList.2e23d37c91734f608f09.js.map
30348 bytes
0644
TeamPages.4f6177b4c6ec769c72d8.js
22839 bytes
0644
TeamPages.4f6177b4c6ec769c72d8.js.map
66001 bytes
0644
TestStuffPage.8ddabdd17d265b771b17.js
2654 bytes
0644
TestStuffPage.8ddabdd17d265b771b17.js.map
8058 bytes
0644
UserCreatePage.72e86cf2c9a3ce50cff3.js
1470 bytes
0644
UserCreatePage.72e86cf2c9a3ce50cff3.js.map
3788 bytes
0644
UserInvitePage.c8243c9cee4b06e10222.js
2576 bytes
0644
UserInvitePage.c8243c9cee4b06e10222.js.map
6594 bytes
0644
UserListPage.acbb5778a782ca90c7ba.js
25463 bytes
0644
UserListPage.acbb5778a782ca90c7ba.js.map
79671 bytes
0644
UserProfileEditPage.7cc4c218d9e4664250e3.js
14593 bytes
0644
UserProfileEditPage.7cc4c218d9e4664250e3.js.map
42901 bytes
0644
UsersListPage.1b61c82d62ca416b6f2f.js
8800 bytes
0644
UsersListPage.1b61c82d62ca416b6f2f.js.map
30059 bytes
0644
alert-rules-drawer-content.1fd9de3b496d077a5f3a.js
957 bytes
0644
alert-rules-drawer-content.1fd9de3b496d077a5f3a.js.map
3199 bytes
0644
alert-rules-toolbar-button.6f275f0d03748b6c297d.js
1429 bytes
0644
alert-rules-toolbar-button.6f275f0d03748b6c297d.js.map
4041 bytes
0644
alertmanagerPlugin.d13ca72afb3f996bb284.js
3810 bytes
0644
alertmanagerPlugin.d13ca72afb3f996bb284.js.map
10753 bytes
0644
app.b11fde05d43f9632a473.js
920821 bytes
0644
app.b11fde05d43f9632a473.js.map
69088 bytes
0644
assets-manifest.json
280835 bytes
0644
azureMonitorPlugin.0bc37a9d4e3bd8421cc0.js
232 bytes
0644
azureMonitorPlugin.0bc37a9d4e3bd8421cc0.js.map
600 bytes
0644
brace.fcd4b1c7e8b9264ab02c.js
371235 bytes
0644
brace.fcd4b1c7e8b9264ab02c.js.map
1132097 bytes
0644
canvasPanel.a46aa5e57d26b1fcc380.js
485254 bytes
0644
canvasPanel.a46aa5e57d26b1fcc380.js.map
2136916 bytes
0644
cloudMonitoringPlugin.c6ea431eae8e9ad2c7b1.js
198 bytes
0644
cloudMonitoringPlugin.c6ea431eae8e9ad2c7b1.js.map
555 bytes
0644
cloudwatchPlugin.06ef34f60000c4f7ea37.js
192 bytes
0644
cloudwatchPlugin.06ef34f60000c4f7ea37.js.map
544 bytes
0644
dark.7fa24d1908c1c96e6fcc.js
134 bytes
0644
elasticsearchPlugin.3f2edb012f5162b48903.js
214 bytes
0644
elasticsearchPlugin.3f2edb012f5162b48903.js.map
583 bytes
0644
explore-feature-toggle-page.897d9f08c342ad4c0702.js
612 bytes
0644
explore-feature-toggle-page.897d9f08c342ad4c0702.js.map
1280 bytes
0644
explore.476912733278e2a99729.js
165810 bytes
0644
explore.476912733278e2a99729.js.map
579148 bytes
0644
geomapPanel.14b9605971a38c51d262.js
417078 bytes
0644
geomapPanel.14b9605971a38c51d262.js.map
540371 bytes
0644
grafana.dark.8c716fbcf630eae84ced.css
209089 bytes
0644
grafana.light.b8b3904788f25480f4a1.css
209047 bytes
0644
grafanaPlugin.1cb208185a89de28dc3a.js
8654 bytes
0644
grafanaPlugin.1cb208185a89de28dc3a.js.map
28174 bytes
0644
graphPlugin.f47f722cdfc0ceb85136.js
70277 bytes
0644
graphPlugin.f47f722cdfc0ceb85136.js.map
243430 bytes
0644
graphitePlugin.d59175976346917781fe.js
75305 bytes
0644
graphitePlugin.d59175976346917781fe.js.map
272016 bytes
0644
heatmapPanel.f6f29a53ed0f682b4404.js
37545 bytes
0644
heatmapPanel.f6f29a53ed0f682b4404.js.map
158066 bytes
0644
influxdbPlugin.140a7777089f9559c11c.js
68843 bytes
0644
influxdbPlugin.140a7777089f9559c11c.js.map
265085 bytes
0644
jaegerPlugin.d254fd4a19ef0cb5b4f5.js
19727 bytes
0644
jaegerPlugin.d254fd4a19ef0cb5b4f5.js.map
65603 bytes
0644
light.af65e5ce03b9ed0aa2b1.js
134 bytes
0644
loki-query-field.a588d587d9d762b18f22.js
191 bytes
0644
loki-query-field.a588d587d9d762b18f22.js.map
548 bytes
0644
lokiPlugin.77364509de280321b6f8.js
185 bytes
0644
lokiPlugin.77364509de280321b6f8.js.map
536 bytes
0644
mixedPlugin.f36bd557a883d9a67538.js
180 bytes
0644
mssqlPlugin.88775f59ced74c2283c5.js
20457 bytes
0644
mssqlPlugin.88775f59ced74c2283c5.js.map
61420 bytes
0644
mysqlPlugin.72fb44411afd8165d201.js
17323 bytes
0644
mysqlPlugin.72fb44411afd8165d201.js.map
45415 bytes
0644
nodeGraphPanel.9a7cdd8efdae281cbe28.js
2107 bytes
0644
nodeGraphPanel.9a7cdd8efdae281cbe28.js.map
7132 bytes
0644
opentsdbPlugin.418b8c8ea0d97ed99edb.js
22866 bytes
0644
opentsdbPlugin.418b8c8ea0d97ed99edb.js.map
82180 bytes
0644
parcaPlugin.7f2e6dde7161b08ceed2.js
11184 bytes
0644
parcaPlugin.7f2e6dde7161b08ceed2.js.map
42340 bytes
0644
postgresPlugin.f88c598bae2653ae177b.js
18902 bytes
0644
postgresPlugin.f88c598bae2653ae177b.js.map
54304 bytes
0644
prom-query-field.ff217c474ea457bdd65e.js
14104 bytes
0644
prom-query-field.ff217c474ea457bdd65e.js.map
76811 bytes
0644
prometheusPlugin.2ba02c28d3f7293e903e.js
224 bytes
0644
prometheusPlugin.2ba02c28d3f7293e903e.js.map
699 bytes
0644
pyroscopePlugin.eb14b78419d619d90dca.js
22269 bytes
0644
pyroscopePlugin.eb14b78419d619d90dca.js.map
86896 bytes
0644
react-monaco-editor.988b1aa5e90b11f9941a.js
15759 bytes
0644
react-monaco-editor.988b1aa5e90b11f9941a.js.map
51544 bytes
0644
runtime.4b7e1b5735d2ed64b824.js
13640 bytes
0644
runtime.4b7e1b5735d2ed64b824.js.map
35122 bytes
0644
tableOldPlugin.8c72b8399d197aeebe16.js
25242 bytes
0644
tableOldPlugin.8c72b8399d197aeebe16.js.map
80497 bytes
0644
tempoPlugin.efa8c2a55984263b4b61.js
182 bytes
0644
tempoPlugin.efa8c2a55984263b4b61.js.map
529 bytes
0644
testDataDSPlugin.9717509b124d754e4f35.js
120550 bytes
0644
testDataDSPlugin.9717509b124d754e4f35.js.map
303302 bytes
0644
visjs-network.d93b3aa71ac24c8cde84.js
459653 bytes
0644
visjs-network.d93b3aa71ac24c8cde84.js.map
1951742 bytes
0644
zipkinPlugin.70f0f24b6d0b6e673ccb.js
13172 bytes
0644
zipkinPlugin.70f0f24b6d0b6e673ccb.js.map
46861 bytes
0644
N4ST4R_ID | Naxtarrr