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K6K,OAAO8M,kBAAoBQ,EAAItP,KACpC7I,KAAK6K,OAAO+M,qBAAuBO,EAAIH,QACvChY,KAAKwX,YAGPY,qBACEpY,KAAK0X,eAAgB,EAIvBrB,iBACE,MAAMgC,EAAY,GAElB,GAAIrY,KAAK6K,OAAOyN,iBACd,IACMtY,KAAK6K,OAAOiK,mBACdyD,EAAAA,UAAAA,iBAA2BvY,KAAK6K,OAAOiK,oBAEvCuD,EAAKvD,mBAAqB,6DAE5B,MAAOrO,GACP4R,EAAKvD,mBAAqBrO,EAAII,QAQlC,OAJI7G,KAAK6K,OAAO0D,OAAQ2F,EAAAA,EAAAA,KAAIlU,KAAK6K,OAAO0D,KAAMvO,KAAK6K,OAAOsM,iBACxDkB,EAAK9J,KAAO,sBAAwBvO,KAAK6K,OAAOsM,cAAgB,MAG3DkB,G,mCAtNElC,EAAAA,cACU,8BCDvB,MAAMqC,G,EACiB,oC,EADjBA,iB,EAAAA,G,sFAIC,MAAMlQ,EAAS,IAAImQ,EAAAA,iBAAiB7L,GACxC8L,aAAavC,GACbwC,iBCH0BnN,IAC3B,MAAM,QAAEQ,EAAF,gBAAW4M,GAAoBpN,EAErC,OACE,iCACE,SAAC,EAAAqN,uBAAD,CACEC,WAAW,wBACXC,iBAAkB/M,EAClBP,SAAUmN,KAEZ,SAACrN,EAAD,CAAiBF,MAAOW,EAASP,SAAUmN,UDN9CI,uBAAuBR,I,oLEP1B,MAAMxV,GAAYiW,EAAAA,EAAAA,wBAAuBC,EAAAA,GACnCnW,GAAmBkW,EAAAA,EAAAA,wBAAuBE,EAAAA,GAC1CzO,GAAYuO,EAAAA,EAAAA,wBAAuBG,EAAAA","sources":["webpack://grafana/./public/app/angular/AngularLocationWrapper.ts","webpack://grafana/./public/app/angular/panel/metrics_panel_ctrl.ts","webpack://grafana/./public/app/angular/panel/panel_ctrl.ts","webpack://grafana/./public/app/angular/panel/query_ctrl.ts","webpack://grafana/./public/app/plugins/datasource/opentsdb/components/OpenTsdbDetails.tsx","webpack://grafana/./public/app/plugins/datasource/opentsdb/datasource.ts","webpack://grafana/./public/app/plugins/datasource/opentsdb/query_ctrl.ts","webpack://grafana/./public/app/plugins/datasource/opentsdb/module.ts","webpack://grafana/./public/app/plugins/datasource/opentsdb/components/ConfigEditor.tsx","webpack://grafana/./public/app/plugins/sdk.ts"],"sourcesContent":["import { deprecationWarning, urlUtil } from '@grafana/data';\nimport { locationSearchToObject, locationService, navigationLogger } from '@grafana/runtime';\n\n// Ref: https://github.com/angular/angular.js/blob/ae8e903edf88a83fedd116ae02c0628bf72b150c/src/ng/location.js#L5\nconst DEFAULT_PORTS: Record = { http: 80, https: 443, ftp: 21 };\n\nexport class AngularLocationWrapper {\n constructor() {\n this.absUrl = this.wrapInDeprecationWarning(this.absUrl);\n this.hash = this.wrapInDeprecationWarning(this.hash);\n this.host = this.wrapInDeprecationWarning(this.host);\n this.path = this.wrapInDeprecationWarning(this.path);\n this.port = this.wrapInDeprecationWarning(this.port, 'window.location');\n this.protocol = this.wrapInDeprecationWarning(this.protocol, 'window.location');\n this.replace = this.wrapInDeprecationWarning(this.replace);\n this.search = this.wrapInDeprecationWarning(this.search);\n this.state = this.wrapInDeprecationWarning(this.state);\n this.url = this.wrapInDeprecationWarning(this.url);\n }\n\n wrapInDeprecationWarning(fn: Function, replacement?: string) {\n let self = this;\n\n return function wrapper() {\n deprecationWarning('$location', fn.name, replacement || 'locationService');\n return fn.apply(self, arguments);\n };\n }\n\n absUrl(): string {\n return `${window.location.origin}${this.url()}`;\n }\n\n hash(newHash?: string | null) {\n navigationLogger('AngularLocationWrapper', false, 'Angular compat layer: hash');\n\n if (!newHash) {\n return locationService.getLocation().hash.slice(1);\n } else {\n throw new Error('AngularLocationWrapper method not implemented.');\n }\n }\n\n host(): string {\n return new URL(window.location.href).hostname;\n }\n\n path(pathname?: any) {\n navigationLogger('AngularLocationWrapper', false, 'Angular compat layer: path');\n\n const location = locationService.getLocation();\n\n if (pathname !== undefined && pathname !== null) {\n let parsedPath = String(pathname);\n parsedPath = parsedPath.startsWith('/') ? parsedPath : `/${parsedPath}`;\n const url = new URL(`${window.location.origin}${parsedPath}`);\n\n locationService.push({\n pathname: url.pathname,\n search: url.search.length > 0 ? url.search : location.search,\n hash: url.hash.length > 0 ? url.hash : location.hash,\n });\n return this;\n }\n\n if (pathname === null) {\n locationService.push('/');\n return this;\n }\n\n return location.pathname;\n }\n\n port(): number | null {\n const url = new URL(window.location.href);\n return parseInt(url.port, 10) || DEFAULT_PORTS[url.protocol] || null;\n }\n\n protocol(): string {\n return new URL(window.location.href).protocol.slice(0, -1);\n }\n\n replace() {\n throw new Error('AngularLocationWrapper method not implemented.');\n }\n\n search(search?: any, paramValue?: any) {\n navigationLogger('AngularLocationWrapper', false, 'Angular compat layer: search');\n if (!search) {\n return locationService.getSearchObject();\n }\n\n if (search && arguments.length > 1) {\n locationService.partial({\n [search]: paramValue,\n });\n\n return this;\n }\n\n if (search) {\n let newQuery;\n\n if (typeof search === 'object') {\n newQuery = { ...search };\n } else {\n newQuery = locationSearchToObject(search);\n }\n\n for (const key of Object.keys(newQuery)) {\n // removing params with null | undefined\n if (newQuery[key] === null || newQuery[key] === undefined) {\n delete newQuery[key];\n }\n }\n\n const updatedUrl = urlUtil.renderUrl(locationService.getLocation().pathname, newQuery);\n locationService.push(updatedUrl);\n }\n\n return this;\n }\n\n state(state?: any) {\n navigationLogger('AngularLocationWrapper', false, 'Angular compat layer: state');\n throw new Error('AngularLocationWrapper method not implemented.');\n }\n\n url(newUrl?: any) {\n navigationLogger('AngularLocationWrapper', false, 'Angular compat layer: url');\n\n if (newUrl !== undefined) {\n if (newUrl.startsWith('#')) {\n locationService.push({ ...locationService.getLocation(), hash: newUrl });\n } else if (newUrl.startsWith('?')) {\n locationService.push({ ...locationService.getLocation(), search: newUrl });\n } else if (newUrl.trim().length === 0) {\n locationService.push('/');\n } else {\n locationService.push(newUrl);\n }\n\n return locationService;\n }\n\n const location = locationService.getLocation();\n return `${location.pathname}${location.search}${location.hash}`;\n }\n}\n","import { isArray } from 'lodash';\nimport { Unsubscribable } from 'rxjs';\n\nimport {\n DataFrame,\n DataQueryResponse,\n DataSourceApi,\n LegacyResponseData,\n LoadingState,\n PanelData,\n PanelEvents,\n TimeRange,\n toDataFrameDTO,\n toLegacyResponseData,\n} from '@grafana/data';\nimport { PanelCtrl } from 'app/angular/panel/panel_ctrl';\nimport { ContextSrv } from 'app/core/services/context_srv';\nimport { PanelModel } from 'app/features/dashboard/state';\nimport { applyPanelTimeOverrides } from 'app/features/dashboard/utils/panel';\n\nimport { PanelQueryRunner } from '../../features/query/state/PanelQueryRunner';\n\nclass MetricsPanelCtrl extends PanelCtrl {\n declare datasource: DataSourceApi;\n declare range: TimeRange;\n\n contextSrv: ContextSrv;\n datasourceSrv: any;\n timeSrv: any;\n templateSrv: any;\n interval: any;\n intervalMs: any;\n resolution: any;\n timeInfo?: string;\n skipDataOnInit = false;\n dataList: LegacyResponseData[] = [];\n querySubscription?: Unsubscribable | null;\n useDataFrames = false;\n panelData?: PanelData;\n\n constructor($scope: any, $injector: any) {\n super($scope, $injector);\n\n this.contextSrv = $injector.get('contextSrv');\n this.datasourceSrv = $injector.get('datasourceSrv');\n this.timeSrv = $injector.get('timeSrv');\n this.templateSrv = $injector.get('templateSrv');\n this.panel.datasource = this.panel.datasource || null;\n\n this.events.on(PanelEvents.refresh, this.onMetricsPanelRefresh.bind(this));\n this.events.on(PanelEvents.panelTeardown, this.onPanelTearDown.bind(this));\n this.events.on(PanelEvents.componentDidMount, this.onMetricsPanelMounted.bind(this));\n }\n\n private onMetricsPanelMounted() {\n const queryRunner = this.panel.getQueryRunner() as PanelQueryRunner;\n this.querySubscription = queryRunner\n .getData({ withTransforms: true, withFieldConfig: true })\n .subscribe(this.panelDataObserver);\n }\n\n private onPanelTearDown() {\n if (this.querySubscription) {\n this.querySubscription.unsubscribe();\n this.querySubscription = null;\n }\n }\n\n private onMetricsPanelRefresh() {\n // ignore fetching data if another panel is in fullscreen\n if (this.otherPanelInFullscreenMode()) {\n return;\n }\n\n // if we have snapshot data use that\n if (this.panel.snapshotData) {\n this.updateTimeRange();\n let data = this.panel.snapshotData;\n // backward compatibility\n if (!isArray(data)) {\n data = data.data;\n }\n\n this.panelData = {\n state: LoadingState.Done,\n series: data,\n timeRange: this.range,\n };\n\n // Defer panel rendering till the next digest cycle.\n // For some reason snapshot panels don't init at this time, so this helps to avoid rendering issues.\n return this.$timeout(() => {\n this.events.emit(PanelEvents.dataSnapshotLoad, data);\n });\n }\n\n // clear loading/error state\n delete this.error;\n this.loading = true;\n\n // load datasource service\n return this.datasourceSrv\n .get(this.panel.datasource, this.panel.scopedVars)\n .then(this.issueQueries.bind(this))\n .catch((err: any) => {\n this.processDataError(err);\n });\n }\n\n processDataError(err: any) {\n // if canceled keep loading set to true\n if (err.cancelled) {\n console.log('Panel request cancelled', err);\n return;\n }\n\n this.error = err.message || 'Request Error';\n\n if (err.data) {\n if (err.data.message) {\n this.error = err.data.message;\n } else if (err.data.error) {\n this.error = err.data.error;\n }\n }\n\n this.angularDirtyCheck();\n }\n\n angularDirtyCheck() {\n if (!this.$scope.$root.$$phase) {\n this.$scope.$digest();\n }\n }\n\n // Updates the response with information from the stream\n panelDataObserver = {\n next: (data: PanelData) => {\n this.panelData = data;\n\n if (data.state === LoadingState.Error) {\n this.loading = false;\n this.processDataError(data.error);\n }\n\n // Ignore data in loading state\n if (data.state === LoadingState.Loading) {\n this.loading = true;\n this.angularDirtyCheck();\n return;\n }\n\n if (data.request) {\n const { timeInfo } = data.request;\n if (timeInfo) {\n this.timeInfo = timeInfo;\n }\n }\n\n if (data.timeRange) {\n this.range = data.timeRange;\n }\n\n if (this.useDataFrames) {\n this.handleDataFrames(data.series);\n } else {\n // Make the results look as if they came directly from a <6.2 datasource request\n const legacy = data.series.map((v) => toLegacyResponseData(v));\n this.handleQueryResult({ data: legacy });\n }\n\n this.angularDirtyCheck();\n },\n };\n\n updateTimeRange(datasource?: DataSourceApi) {\n this.datasource = datasource || this.datasource;\n this.range = this.timeSrv.timeRange();\n\n const newTimeData = applyPanelTimeOverrides(this.panel, this.range);\n this.timeInfo = newTimeData.timeInfo;\n this.range = newTimeData.timeRange;\n }\n\n issueQueries(datasource: DataSourceApi) {\n this.updateTimeRange(datasource);\n\n this.datasource = datasource;\n\n const panel = this.panel as PanelModel;\n const queryRunner = panel.getQueryRunner();\n\n return queryRunner.run({\n datasource: panel.datasource,\n queries: panel.targets,\n panelId: panel.id,\n dashboardId: this.dashboard.id,\n timezone: this.dashboard.getTimezone(),\n timeInfo: this.timeInfo,\n timeRange: this.range,\n maxDataPoints: panel.maxDataPoints || this.width,\n minInterval: panel.interval,\n scopedVars: panel.scopedVars,\n cacheTimeout: panel.cacheTimeout,\n transformations: panel.transformations,\n });\n }\n\n handleDataFrames(data: DataFrame[]) {\n this.loading = false;\n\n if (this.dashboard && this.dashboard.snapshot) {\n this.panel.snapshotData = data.map((frame) => toDataFrameDTO(frame));\n }\n\n try {\n this.events.emit(PanelEvents.dataFramesReceived, data);\n } catch (err) {\n this.processDataError(err);\n }\n }\n\n handleQueryResult(result: DataQueryResponse) {\n this.loading = false;\n\n if (this.dashboard.snapshot) {\n this.panel.snapshotData = result.data;\n }\n\n if (!result || !result.data) {\n console.log('Data source query result invalid, missing data field:', result);\n result = { data: [] };\n }\n\n try {\n this.events.emit(PanelEvents.dataReceived, result.data);\n } catch (err) {\n this.processDataError(err);\n }\n }\n}\n\nexport { MetricsPanelCtrl };\n","import { auto } from 'angular';\nimport { isString } from 'lodash';\n\nimport {\n AppEvent,\n PanelEvents,\n PanelPluginMeta,\n AngularPanelMenuItem,\n EventBusExtended,\n EventBusSrv,\n} from '@grafana/data';\nimport { AngularLocationWrapper } from 'app/angular/AngularLocationWrapper';\nimport config from 'app/core/config';\nimport { profiler } from 'app/core/core';\n\nimport { DashboardModel } from '../../features/dashboard/state';\n\nexport class PanelCtrl {\n panel: any;\n error: any;\n declare dashboard: DashboardModel;\n pluginName = '';\n pluginId = '';\n editorTabs: any;\n $scope: any;\n $injector: auto.IInjectorService;\n $timeout: any;\n editModeInitiated = false;\n declare height: number;\n declare width: number;\n containerHeight: any;\n events: EventBusExtended;\n loading = false;\n timing: any;\n $location: AngularLocationWrapper;\n\n constructor($scope: any, $injector: auto.IInjectorService) {\n this.panel = this.panel ?? $scope.$parent.panel;\n this.dashboard = this.dashboard ?? $scope.$parent.dashboard;\n this.$injector = $injector;\n this.$scope = $scope;\n this.$timeout = $injector.get('$timeout');\n this.editorTabs = [];\n this.$location = new AngularLocationWrapper();\n this.events = new EventBusSrv();\n this.timing = {}; // not used but here to not break plugins\n\n const plugin = config.panels[this.panel.type];\n if (plugin) {\n this.pluginId = plugin.id;\n this.pluginName = plugin.name;\n }\n\n $scope.$on(PanelEvents.componentDidMount.name, () => this.panelDidMount());\n }\n\n panelDidMount() {\n this.events.emit(PanelEvents.componentDidMount);\n this.events.emit(PanelEvents.initialized);\n this.dashboard.panelInitialized(this.panel);\n }\n\n renderingCompleted() {\n profiler.renderingCompleted();\n }\n\n refresh() {\n this.panel.refresh();\n }\n\n publishAppEvent(event: AppEvent, payload?: T) {\n this.$scope.$root.appEvent(event, payload);\n }\n\n initEditMode() {\n if (!this.editModeInitiated) {\n this.editModeInitiated = true;\n this.events.emit(PanelEvents.editModeInitialized);\n }\n }\n\n addEditorTab(title: string, directiveFn: any, index?: number, icon?: any) {\n const editorTab = { title, directiveFn, icon };\n\n if (isString(directiveFn)) {\n editorTab.directiveFn = () => {\n return { templateUrl: directiveFn };\n };\n }\n\n if (index) {\n this.editorTabs.splice(index, 0, editorTab);\n } else {\n this.editorTabs.push(editorTab);\n }\n }\n\n getExtendedMenu() {\n const menu: AngularPanelMenuItem[] = [];\n this.events.emit(PanelEvents.initPanelActions, menu);\n return menu;\n }\n\n // Override in sub-class to add items before extended menu\n async getAdditionalMenuItems(): Promise {\n return [];\n }\n\n otherPanelInFullscreenMode() {\n return this.dashboard.otherPanelInFullscreen(this.panel);\n }\n\n render(payload?: any) {\n this.events.emit(PanelEvents.render, payload);\n }\n\n // overriden from react\n onPluginTypeChange = (plugin: PanelPluginMeta) => {};\n}\n","import { auto } from 'angular';\nimport { indexOf } from 'lodash';\n\nexport class QueryCtrl {\n target!: T;\n datasource!: any;\n panelCtrl!: any;\n panel: any;\n hasRawMode!: boolean;\n error?: string | null;\n isLastQuery: boolean;\n\n constructor(public $scope: any, public $injector: auto.IInjectorService) {\n this.panelCtrl = this.panelCtrl ?? $scope.ctrl.panelCtrl;\n this.target = this.target ?? $scope.ctrl.target;\n this.datasource = this.datasource ?? $scope.ctrl.datasource;\n this.panel = this.panelCtrl?.panel ?? $scope.ctrl.panelCtrl.panel;\n this.isLastQuery = indexOf(this.panel.targets, this.target) === this.panel.targets.length - 1;\n }\n\n refresh() {\n this.panelCtrl.refresh();\n }\n}\n","import React, { SyntheticEvent } from 'react';\n\nimport { DataSourceSettings, SelectableValue } from '@grafana/data';\nimport { InlineFormLabel, LegacyForms } from '@grafana/ui';\n\nimport { useUniqueId } from '../../influxdb/components/useUniqueId';\nimport { OpenTsdbOptions } from '../types';\n\nconst { Select, Input } = LegacyForms;\n\nconst tsdbVersions = [\n { label: '<=2.1', value: 1 },\n { label: '==2.2', value: 2 },\n { label: '==2.3', value: 3 },\n];\n\nconst tsdbResolutions = [\n { label: 'second', value: 1 },\n { label: 'millisecond', value: 2 },\n];\n\ninterface Props {\n value: DataSourceSettings;\n onChange: (value: DataSourceSettings) => void;\n}\n\nexport const OpenTsdbDetails = (props: Props) => {\n const { onChange, value } = props;\n\n const idSuffix = useUniqueId();\n\n return (\n <>\n
OpenTSDB settings
\n
\n \n Version\n \n version.value === value.jsonData.tsdbVersion) ?? tsdbVersions[0]}\n onChange={onSelectChangeHandler('tsdbVersion', value, onChange)}\n />\n
\n
\n \n Resolution\n \n resolution.value === value.jsonData.tsdbResolution) ??\n tsdbResolutions[0]\n }\n onChange={onSelectChangeHandler('tsdbResolution', value, onChange)}\n />\n
\n
\n \n Lookup limit\n \n \n
\n \n );\n};\n\nconst onSelectChangeHandler =\n (key: keyof OpenTsdbOptions, value: Props['value'], onChange: Props['onChange']) => (newValue: SelectableValue) => {\n onChange({\n ...value,\n jsonData: {\n ...value.jsonData,\n [key]: newValue.value,\n },\n });\n };\n\nconst onInputChangeHandler =\n (key: keyof OpenTsdbOptions, value: Props['value'], onChange: Props['onChange']) =>\n (event: SyntheticEvent) => {\n onChange({\n ...value,\n jsonData: {\n ...value.jsonData,\n [key]: event.currentTarget.value,\n },\n });\n };\n","import angular from 'angular';\nimport {\n clone,\n compact,\n each,\n every,\n filter,\n findIndex,\n has,\n includes,\n isArray,\n isEmpty,\n map as _map,\n toPairs,\n} from 'lodash';\nimport { lastValueFrom, Observable, of } from 'rxjs';\nimport { catchError, map } from 'rxjs/operators';\n\nimport {\n AnnotationEvent,\n DataQueryRequest,\n DataQueryResponse,\n DataSourceApi,\n dateMath,\n ScopedVars,\n} from '@grafana/data';\nimport { FetchResponse, getBackendSrv } from '@grafana/runtime';\nimport { getTemplateSrv, TemplateSrv } from 'app/features/templating/template_srv';\n\nimport { OpenTsdbOptions, OpenTsdbQuery } from './types';\n\nexport default class OpenTsDatasource extends DataSourceApi {\n type: any;\n url: any;\n name: any;\n withCredentials: any;\n basicAuth: any;\n tsdbVersion: any;\n tsdbResolution: any;\n lookupLimit: any;\n tagKeys: any;\n\n aggregatorsPromise: any;\n filterTypesPromise: any;\n\n constructor(instanceSettings: any, private readonly templateSrv: TemplateSrv = getTemplateSrv()) {\n super(instanceSettings);\n this.type = 'opentsdb';\n this.url = instanceSettings.url;\n this.name = instanceSettings.name;\n this.withCredentials = instanceSettings.withCredentials;\n this.basicAuth = instanceSettings.basicAuth;\n instanceSettings.jsonData = instanceSettings.jsonData || {};\n this.tsdbVersion = instanceSettings.jsonData.tsdbVersion || 1;\n this.tsdbResolution = instanceSettings.jsonData.tsdbResolution || 1;\n this.lookupLimit = instanceSettings.jsonData.lookupLimit || 1000;\n this.tagKeys = {};\n\n this.aggregatorsPromise = null;\n this.filterTypesPromise = null;\n }\n\n // Called once per panel (graph)\n query(options: DataQueryRequest): Observable {\n const start = this.convertToTSDBTime(options.range.raw.from, false, options.timezone);\n const end = this.convertToTSDBTime(options.range.raw.to, true, options.timezone);\n const qs: any[] = [];\n\n each(options.targets, (target) => {\n if (!target.metric) {\n return;\n }\n qs.push(this.convertTargetToQuery(target, options, this.tsdbVersion));\n });\n\n const queries = compact(qs);\n\n // No valid targets, return the empty result to save a round trip.\n if (isEmpty(queries)) {\n return of({ data: [] });\n }\n\n const groupByTags: any = {};\n each(queries, (query) => {\n if (query.filters && query.filters.length > 0) {\n each(query.filters, (val) => {\n groupByTags[val.tagk] = true;\n });\n } else {\n each(query.tags, (val, key) => {\n groupByTags[key] = true;\n });\n }\n });\n\n options.targets = filter(options.targets, (query) => {\n return query.hide !== true;\n });\n\n return this.performTimeSeriesQuery(queries, start, end).pipe(\n catchError((err) => {\n // Throw the error message here instead of the whole object to workaround the error parsing error.\n throw err?.data?.error?.message || 'Error performing time series query.';\n }),\n map((response) => {\n const metricToTargetMapping = this.mapMetricsToTargets(response.data, options, this.tsdbVersion);\n const result = _map(response.data, (metricData: any, index: number) => {\n index = metricToTargetMapping[index];\n if (index === -1) {\n index = 0;\n }\n this._saveTagKeys(metricData);\n\n return this.transformMetricData(\n metricData,\n groupByTags,\n options.targets[index],\n options,\n this.tsdbResolution\n );\n });\n return { data: result };\n })\n );\n }\n\n annotationQuery(options: any): Promise {\n const start = this.convertToTSDBTime(options.rangeRaw.from, false, options.timezone);\n const end = this.convertToTSDBTime(options.rangeRaw.to, true, options.timezone);\n const qs = [];\n const eventList: any[] = [];\n\n qs.push({ aggregator: 'sum', metric: options.annotation.target });\n\n const queries = compact(qs);\n\n return lastValueFrom(\n this.performTimeSeriesQuery(queries, start, end).pipe(\n map((results) => {\n if (results.data[0]) {\n let annotationObject = results.data[0].annotations;\n if (options.annotation.isGlobal) {\n annotationObject = results.data[0].globalAnnotations;\n }\n if (annotationObject) {\n each(annotationObject, (annotation) => {\n const event = {\n text: annotation.description,\n time: Math.floor(annotation.startTime) * 1000,\n annotation: options.annotation,\n };\n\n eventList.push(event);\n });\n }\n }\n return eventList;\n })\n )\n );\n }\n\n targetContainsTemplate(target: any) {\n if (target.filters && target.filters.length > 0) {\n for (let i = 0; i < target.filters.length; i++) {\n if (this.templateSrv.containsTemplate(target.filters[i].filter)) {\n return true;\n }\n }\n }\n\n if (target.tags && Object.keys(target.tags).length > 0) {\n for (const tagKey in target.tags) {\n if (this.templateSrv.containsTemplate(target.tags[tagKey])) {\n return true;\n }\n }\n }\n\n return false;\n }\n\n performTimeSeriesQuery(queries: any[], start: any, end: any): Observable {\n let msResolution = false;\n if (this.tsdbResolution === 2) {\n msResolution = true;\n }\n const reqBody: any = {\n start: start,\n queries: queries,\n msResolution: msResolution,\n globalAnnotations: true,\n };\n if (this.tsdbVersion === 3) {\n reqBody.showQuery = true;\n }\n\n // Relative queries (e.g. last hour) don't include an end time\n if (end) {\n reqBody.end = end;\n }\n\n const options = {\n method: 'POST',\n url: this.url + '/api/query',\n data: reqBody,\n };\n\n this._addCredentialOptions(options);\n return getBackendSrv().fetch(options);\n }\n\n suggestTagKeys(metric: string | number) {\n return Promise.resolve(this.tagKeys[metric] || []);\n }\n\n _saveTagKeys(metricData: { tags: {}; aggregateTags: any; metric: string | number }) {\n const tagKeys = Object.keys(metricData.tags);\n each(metricData.aggregateTags, (tag) => {\n tagKeys.push(tag);\n });\n\n this.tagKeys[metricData.metric] = tagKeys;\n }\n\n _performSuggestQuery(query: string, type: string): Observable {\n return this._get('/api/suggest', { type, q: query, max: this.lookupLimit }).pipe(\n map((result: any) => {\n return result.data;\n })\n );\n }\n\n _performMetricKeyValueLookup(metric: string, keys: any): Observable {\n if (!metric || !keys) {\n return of([]);\n }\n\n const keysArray = keys.split(',').map((key: any) => {\n return key.trim();\n });\n const key = keysArray[0];\n let keysQuery = key + '=*';\n\n if (keysArray.length > 1) {\n keysQuery += ',' + keysArray.splice(1).join(',');\n }\n\n const m = metric + '{' + keysQuery + '}';\n\n return this._get('/api/search/lookup', { m: m, limit: this.lookupLimit }).pipe(\n map((result: any) => {\n result = result.data.results;\n const tagvs: any[] = [];\n each(result, (r) => {\n if (tagvs.indexOf(r.tags[key]) === -1) {\n tagvs.push(r.tags[key]);\n }\n });\n return tagvs;\n })\n );\n }\n\n _performMetricKeyLookup(metric: any): Observable {\n if (!metric) {\n return of([]);\n }\n\n return this._get('/api/search/lookup', { m: metric, limit: 1000 }).pipe(\n map((result: any) => {\n result = result.data.results;\n const tagks: any[] = [];\n each(result, (r) => {\n each(r.tags, (tagv, tagk) => {\n if (tagks.indexOf(tagk) === -1) {\n tagks.push(tagk);\n }\n });\n });\n return tagks;\n })\n );\n }\n\n _get(\n relativeUrl: string,\n params?: { type?: string; q?: string; max?: number; m?: any; limit?: number }\n ): Observable {\n const options = {\n method: 'GET',\n url: this.url + relativeUrl,\n params: params,\n };\n\n this._addCredentialOptions(options);\n\n return getBackendSrv().fetch(options);\n }\n\n _addCredentialOptions(options: any) {\n if (this.basicAuth || this.withCredentials) {\n options.withCredentials = true;\n }\n if (this.basicAuth) {\n options.headers = { Authorization: this.basicAuth };\n }\n }\n\n metricFindQuery(query: string) {\n if (!query) {\n return Promise.resolve([]);\n }\n\n let interpolated;\n try {\n interpolated = this.templateSrv.replace(query, {}, 'distributed');\n } catch (err) {\n return Promise.reject(err);\n }\n\n const responseTransform = (result: any) => {\n return _map(result, (value) => {\n return { text: value };\n });\n };\n\n const metricsRegex = /metrics\\((.*)\\)/;\n const tagNamesRegex = /tag_names\\((.*)\\)/;\n const tagValuesRegex = /tag_values\\((.*?),\\s?(.*)\\)/;\n const tagNamesSuggestRegex = /suggest_tagk\\((.*)\\)/;\n const tagValuesSuggestRegex = /suggest_tagv\\((.*)\\)/;\n\n const metricsQuery = interpolated.match(metricsRegex);\n if (metricsQuery) {\n return lastValueFrom(this._performSuggestQuery(metricsQuery[1], 'metrics').pipe(map(responseTransform)));\n }\n\n const tagNamesQuery = interpolated.match(tagNamesRegex);\n if (tagNamesQuery) {\n return lastValueFrom(this._performMetricKeyLookup(tagNamesQuery[1]).pipe(map(responseTransform)));\n }\n\n const tagValuesQuery = interpolated.match(tagValuesRegex);\n if (tagValuesQuery) {\n return lastValueFrom(\n this._performMetricKeyValueLookup(tagValuesQuery[1], tagValuesQuery[2]).pipe(map(responseTransform))\n );\n }\n\n const tagNamesSuggestQuery = interpolated.match(tagNamesSuggestRegex);\n if (tagNamesSuggestQuery) {\n return lastValueFrom(this._performSuggestQuery(tagNamesSuggestQuery[1], 'tagk').pipe(map(responseTransform)));\n }\n\n const tagValuesSuggestQuery = interpolated.match(tagValuesSuggestRegex);\n if (tagValuesSuggestQuery) {\n return lastValueFrom(this._performSuggestQuery(tagValuesSuggestQuery[1], 'tagv').pipe(map(responseTransform)));\n }\n\n return Promise.resolve([]);\n }\n\n testDatasource() {\n return lastValueFrom(\n this._performSuggestQuery('cpu', 'metrics').pipe(\n map(() => {\n return { status: 'success', message: 'Data source is working' };\n })\n )\n );\n }\n\n getAggregators() {\n if (this.aggregatorsPromise) {\n return this.aggregatorsPromise;\n }\n\n this.aggregatorsPromise = lastValueFrom(\n this._get('/api/aggregators').pipe(\n map((result: any) => {\n if (result.data && isArray(result.data)) {\n return result.data.sort();\n }\n return [];\n })\n )\n );\n return this.aggregatorsPromise;\n }\n\n getFilterTypes() {\n if (this.filterTypesPromise) {\n return this.filterTypesPromise;\n }\n\n this.filterTypesPromise = lastValueFrom(\n this._get('/api/config/filters').pipe(\n map((result: any) => {\n if (result.data) {\n return Object.keys(result.data).sort();\n }\n return [];\n })\n )\n );\n return this.filterTypesPromise;\n }\n\n transformMetricData(md: { dps: any }, groupByTags: any, target: any, options: any, tsdbResolution: number) {\n const metricLabel = this.createMetricLabel(md, target, groupByTags, options);\n const dps: any[] = [];\n\n // TSDB returns datapoints has a hash of ts => value.\n // Can't use pairs(invert()) because it stringifies keys/values\n each(md.dps, (v: any, k: number) => {\n if (tsdbResolution === 2) {\n dps.push([v, k * 1]);\n } else {\n dps.push([v, k * 1000]);\n }\n });\n\n return { target: metricLabel, datapoints: dps };\n }\n\n createMetricLabel(\n md: { dps?: any; tags?: any; metric?: any },\n target: { alias: string },\n groupByTags: any,\n options: { scopedVars: any }\n ) {\n if (target.alias) {\n const scopedVars = clone(options.scopedVars || {});\n each(md.tags, (value, key) => {\n scopedVars['tag_' + key] = { value: value };\n });\n return this.templateSrv.replace(target.alias, scopedVars);\n }\n\n let label = md.metric;\n const tagData: any[] = [];\n\n if (!isEmpty(md.tags)) {\n each(toPairs(md.tags), (tag) => {\n if (has(groupByTags, tag[0])) {\n tagData.push(tag[0] + '=' + tag[1]);\n }\n });\n }\n\n if (!isEmpty(tagData)) {\n label += '{' + tagData.join(', ') + '}';\n }\n\n return label;\n }\n\n convertTargetToQuery(target: any, options: any, tsdbVersion: number) {\n if (!target.metric || target.hide) {\n return null;\n }\n\n const query: any = {\n metric: this.templateSrv.replace(target.metric, options.scopedVars, 'pipe'),\n aggregator: 'avg',\n };\n\n if (target.aggregator) {\n query.aggregator = this.templateSrv.replace(target.aggregator);\n }\n\n if (target.shouldComputeRate) {\n query.rate = true;\n query.rateOptions = {\n counter: !!target.isCounter,\n };\n\n if (target.counterMax && target.counterMax.length) {\n query.rateOptions.counterMax = parseInt(target.counterMax, 10);\n }\n\n if (target.counterResetValue && target.counterResetValue.length) {\n query.rateOptions.resetValue = parseInt(target.counterResetValue, 10);\n }\n\n if (tsdbVersion >= 2) {\n query.rateOptions.dropResets =\n !query.rateOptions.counterMax && (!query.rateOptions.ResetValue || query.rateOptions.ResetValue === 0);\n }\n }\n\n if (!target.disableDownsampling) {\n let interval = this.templateSrv.replace(target.downsampleInterval || options.interval);\n\n if (interval.match(/\\.[0-9]+s/)) {\n interval = parseFloat(interval) * 1000 + 'ms';\n }\n\n query.downsample = interval + '-' + target.downsampleAggregator;\n\n if (target.downsampleFillPolicy && target.downsampleFillPolicy !== 'none') {\n query.downsample += '-' + target.downsampleFillPolicy;\n }\n }\n\n if (target.filters && target.filters.length > 0) {\n query.filters = angular.copy(target.filters);\n if (query.filters) {\n for (const filterKey in query.filters) {\n query.filters[filterKey].filter = this.templateSrv.replace(\n query.filters[filterKey].filter,\n options.scopedVars,\n 'pipe'\n );\n }\n }\n } else {\n query.tags = angular.copy(target.tags);\n if (query.tags) {\n for (const tagKey in query.tags) {\n query.tags[tagKey] = this.templateSrv.replace(query.tags[tagKey], options.scopedVars, 'pipe');\n }\n }\n }\n\n if (target.explicitTags) {\n query.explicitTags = true;\n }\n\n return query;\n }\n\n mapMetricsToTargets(metrics: any, options: any, tsdbVersion: number) {\n let interpolatedTagValue, arrTagV;\n return _map(metrics, (metricData) => {\n if (tsdbVersion === 3) {\n return metricData.query.index;\n } else {\n return findIndex(options.targets as any[], (target) => {\n if (target.filters && target.filters.length > 0) {\n return target.metric === metricData.metric;\n } else {\n return (\n target.metric === metricData.metric &&\n every(target.tags, (tagV, tagK) => {\n interpolatedTagValue = this.templateSrv.replace(tagV, options.scopedVars, 'pipe');\n arrTagV = interpolatedTagValue.split('|');\n return includes(arrTagV, metricData.tags[tagK]) || interpolatedTagValue === '*';\n })\n );\n }\n });\n }\n });\n }\n\n interpolateVariablesInQueries(queries: OpenTsdbQuery[], scopedVars: ScopedVars): OpenTsdbQuery[] {\n if (!queries.length) {\n return queries;\n }\n\n return queries.map((query) => ({\n ...query,\n metric: this.templateSrv.replace(query.metric, scopedVars),\n }));\n }\n\n convertToTSDBTime(date: any, roundUp: any, timezone: any) {\n if (date === 'now') {\n return null;\n }\n\n date = dateMath.parse(date, roundUp, timezone);\n return date.valueOf();\n }\n}\n","import { auto } from 'angular';\nimport { map, size, has } from 'lodash';\n\nimport { textUtil, rangeUtil } from '@grafana/data';\nimport { QueryCtrl } from 'app/plugins/sdk';\n\nexport class OpenTsQueryCtrl extends QueryCtrl {\n static templateUrl = 'partials/query.editor.html';\n aggregators: any;\n fillPolicies: any;\n filterTypes: any;\n tsdbVersion: any;\n aggregator: any;\n downsampleInterval: any;\n downsampleAggregator: any;\n downsampleFillPolicy: any;\n errors: any;\n suggestMetrics: any;\n suggestTagKeys: any;\n suggestTagValues: any;\n addTagMode = false;\n addFilterMode = false;\n\n /** @ngInject */\n constructor($scope: any, $injector: auto.IInjectorService) {\n super($scope, $injector);\n\n this.errors = this.validateTarget();\n this.aggregators = ['avg', 'sum', 'min', 'max', 'dev', 'zimsum', 'mimmin', 'mimmax'];\n this.fillPolicies = ['none', 'nan', 'null', 'zero'];\n this.filterTypes = [\n 'wildcard',\n 'iliteral_or',\n 'not_iliteral_or',\n 'not_literal_or',\n 'iwildcard',\n 'literal_or',\n 'regexp',\n ];\n\n this.tsdbVersion = this.datasource.tsdbVersion;\n\n if (!this.target.aggregator) {\n this.target.aggregator = 'sum';\n }\n\n if (!this.target.downsampleAggregator) {\n this.target.downsampleAggregator = 'avg';\n }\n\n if (!this.target.downsampleFillPolicy) {\n this.target.downsampleFillPolicy = 'none';\n }\n\n this.datasource.getAggregators().then((aggs: { length: number }) => {\n if (aggs.length !== 0) {\n this.aggregators = aggs;\n }\n });\n\n this.datasource.getFilterTypes().then((filterTypes: { length: number }) => {\n if (filterTypes.length !== 0) {\n this.filterTypes = filterTypes;\n }\n });\n\n // needs to be defined here as it is called from typeahead\n this.suggestMetrics = (query: string, callback: any) => {\n this.datasource\n .metricFindQuery('metrics(' + query + ')')\n .then(this.getTextValues)\n .then(callback);\n };\n\n this.suggestTagKeys = (query: any, callback: any) => {\n this.datasource.suggestTagKeys(this.target.metric).then(callback);\n };\n\n this.suggestTagValues = (query: string, callback: any) => {\n this.datasource\n .metricFindQuery('suggest_tagv(' + query + ')')\n .then(this.getTextValues)\n .then(callback);\n };\n }\n\n targetBlur() {\n this.errors = this.validateTarget();\n this.refresh();\n }\n\n getTextValues(metricFindResult: any) {\n return map(metricFindResult, (value) => {\n return textUtil.escapeHtml(value.text);\n });\n }\n\n addTag() {\n if (this.target.filters && this.target.filters.length > 0) {\n this.errors.tags = 'Please remove filters to use tags, tags and filters are mutually exclusive.';\n }\n\n if (!this.addTagMode) {\n this.addTagMode = true;\n return;\n }\n\n if (!this.target.tags) {\n this.target.tags = {};\n }\n\n this.errors = this.validateTarget();\n\n if (!this.errors.tags) {\n this.target.tags[this.target.currentTagKey] = this.target.currentTagValue;\n this.target.currentTagKey = '';\n this.target.currentTagValue = '';\n this.targetBlur();\n }\n\n this.addTagMode = false;\n }\n\n removeTag(key: string | number) {\n delete this.target.tags[key];\n this.targetBlur();\n }\n\n editTag(key: string | number, value: any) {\n this.removeTag(key);\n this.target.currentTagKey = key;\n this.target.currentTagValue = value;\n this.addTag();\n }\n\n closeAddTagMode() {\n this.addTagMode = false;\n return;\n }\n\n addFilter() {\n if (this.target.tags && size(this.target.tags) > 0) {\n this.errors.filters = 'Please remove tags to use filters, tags and filters are mutually exclusive.';\n }\n\n if (!this.addFilterMode) {\n this.addFilterMode = true;\n return;\n }\n\n if (!this.target.filters) {\n this.target.filters = [];\n }\n\n if (!this.target.currentFilterType) {\n this.target.currentFilterType = 'iliteral_or';\n }\n\n if (!this.target.currentFilterGroupBy) {\n this.target.currentFilterGroupBy = false;\n }\n\n this.errors = this.validateTarget();\n\n if (!this.errors.filters) {\n const currentFilter = {\n type: this.target.currentFilterType,\n tagk: this.target.currentFilterKey,\n filter: this.target.currentFilterValue,\n groupBy: this.target.currentFilterGroupBy,\n };\n this.target.filters.push(currentFilter);\n this.target.currentFilterType = 'literal_or';\n this.target.currentFilterKey = '';\n this.target.currentFilterValue = '';\n this.target.currentFilterGroupBy = false;\n this.targetBlur();\n }\n\n this.addFilterMode = false;\n }\n\n removeFilter(index: number) {\n this.target.filters.splice(index, 1);\n this.targetBlur();\n }\n\n editFilter(fil: { tagk: any; filter: any; type: any; groupBy: any }, index: number) {\n this.removeFilter(index);\n this.target.currentFilterKey = fil.tagk;\n this.target.currentFilterValue = fil.filter;\n this.target.currentFilterType = fil.type;\n this.target.currentFilterGroupBy = fil.groupBy;\n this.addFilter();\n }\n\n closeAddFilterMode() {\n this.addFilterMode = false;\n return;\n }\n\n validateTarget() {\n const errs: any = {};\n\n if (this.target.shouldDownsample) {\n try {\n if (this.target.downsampleInterval) {\n rangeUtil.describeInterval(this.target.downsampleInterval);\n } else {\n errs.downsampleInterval = \"You must supply a downsample interval (e.g. '1m' or '1h').\";\n }\n } catch (err) {\n errs.downsampleInterval = err.message;\n }\n }\n\n if (this.target.tags && has(this.target.tags, this.target.currentTagKey)) {\n errs.tags = \"Duplicate tag key '\" + this.target.currentTagKey + \"'.\";\n }\n\n return errs;\n }\n}\n","import { DataSourcePlugin } from '@grafana/data';\n\nimport { ConfigEditor } from './components/ConfigEditor';\nimport OpenTsDatasource from './datasource';\nimport { OpenTsQueryCtrl } from './query_ctrl';\n\nclass AnnotationsQueryCtrl {\n static templateUrl = 'partials/annotations.editor.html';\n}\n\nexport const plugin = new DataSourcePlugin(OpenTsDatasource)\n .setQueryCtrl(OpenTsQueryCtrl)\n .setConfigEditor(ConfigEditor)\n .setAnnotationQueryCtrl(AnnotationsQueryCtrl);\n","import React from 'react';\n\nimport { DataSourcePluginOptionsEditorProps } from '@grafana/data';\nimport { DataSourceHttpSettings } from '@grafana/ui';\n\nimport { OpenTsdbOptions } from '../types';\n\nimport { OpenTsdbDetails } from './OpenTsdbDetails';\n\nexport const ConfigEditor = (props: DataSourcePluginOptionsEditorProps) => {\n const { options, onOptionsChange } = props;\n\n return (\n <>\n \n \n \n );\n};\n","import { makeClassES5Compatible } from '@grafana/data';\nimport { loadPluginCss } from '@grafana/runtime';\nimport { MetricsPanelCtrl as MetricsPanelCtrlES6 } from 'app/angular/panel/metrics_panel_ctrl';\nimport { PanelCtrl as PanelCtrlES6 } from 'app/angular/panel/panel_ctrl';\nimport { QueryCtrl as QueryCtrlES6 } from 'app/angular/panel/query_ctrl';\n\nconst PanelCtrl = makeClassES5Compatible(PanelCtrlES6);\nconst MetricsPanelCtrl = makeClassES5Compatible(MetricsPanelCtrlES6);\nconst QueryCtrl = makeClassES5Compatible(QueryCtrlES6);\n\nexport { PanelCtrl, MetricsPanelCtrl, QueryCtrl, loadPluginCss };\n"],"names":["DEFAULT_PORTS","http","https","ftp","AngularLocationWrapper","constructor","this","absUrl","wrapInDeprecationWarning","hash","host","path","port","protocol","replace","search","state","url","fn","replacement","self","deprecationWarning","name","apply","arguments","window","location","origin","newHash","navigationLogger","Error","locationService","slice","URL","href","hostname","pathname","parsedPath","String","startsWith","length","parseInt","paramValue","newQuery","locationSearchToObject","key","Object","keys","undefined","updatedUrl","urlUtil","newUrl","trim","MetricsPanelCtrl","PanelCtrl","$scope","$injector","super","next","data","panelData","LoadingState","loading","processDataError","error","angularDirtyCheck","request","timeInfo","timeRange","range","useDataFrames","handleDataFrames","series","legacy","map","v","toLegacyResponseData","handleQueryResult","contextSrv","get","datasourceSrv","timeSrv","templateSrv","panel","datasource","events","on","PanelEvents","onMetricsPanelRefresh","bind","onPanelTearDown","onMetricsPanelMounted","queryRunner","getQueryRunner","querySubscription","getData","withTransforms","withFieldConfig","subscribe","panelDataObserver","unsubscribe","otherPanelInFullscreenMode","snapshotData","updateTimeRange","isArray","$timeout","emit","scopedVars","then","issueQueries","catch","err","cancelled","console","log","message","$root","$$phase","$digest","newTimeData","applyPanelTimeOverrides","run","queries","targets","panelId","id","dashboardId","dashboard","timezone","getTimezone","maxDataPoints","width","minInterval","interval","cacheTimeout","transformations","snapshot","frame","toDataFrameDTO","result","plugin","$parent","editorTabs","$location","EventBusSrv","timing","config","type","pluginId","pluginName","$on","panelDidMount","panelInitialized","renderingCompleted","profiler","refresh","publishAppEvent","event","payload","appEvent","initEditMode","editModeInitiated","addEditorTab","title","directiveFn","index","icon","editorTab","isString","templateUrl","splice","push","getExtendedMenu","menu","otherPanelInFullscreen","render","QueryCtrl","panelCtrl","ctrl","target","isLastQuery","indexOf","Select","Input","LegacyForms","tsdbVersions","label","value","tsdbResolutions","OpenTsdbDetails","props","onChange","idSuffix","useUniqueId","className","InlineFormLabel","htmlFor","inputId","options","find","version","jsonData","tsdbVersion","onSelectChangeHandler","resolution","tsdbResolution","lookupLimit","onInputChangeHandler","newValue","currentTarget","OpenTsDatasource","DataSourceApi","instanceSettings","getTemplateSrv","withCredentials","basicAuth","tagKeys","aggregatorsPromise","filterTypesPromise","query","start","convertToTSDBTime","raw","from","end","to","qs","each","metric","convertTargetToQuery","compact","isEmpty","of","groupByTags","filters","val","tagk","tags","filter","hide","performTimeSeriesQuery","pipe","catchError","response","metricToTargetMapping","mapMetricsToTargets","_map","metricData","_saveTagKeys","transformMetricData","annotationQuery","rangeRaw","eventList","aggregator","annotation","lastValueFrom","results","annotationObject","annotations","isGlobal","globalAnnotations","text","description","time","Math","floor","startTime","targetContainsTemplate","i","containsTemplate","tagKey","msResolution","reqBody","showQuery","method","_addCredentialOptions","getBackendSrv","fetch","suggestTagKeys","Promise","resolve","aggregateTags","tag","_performSuggestQuery","_get","q","max","_performMetricKeyValueLookup","keysArray","split","keysQuery","join","m","limit","tagvs","r","_performMetricKeyLookup","tagks","tagv","relativeUrl","params","headers","Authorization","metricFindQuery","interpolated","reject","responseTransform","metricsQuery","match","tagNamesQuery","tagValuesQuery","tagNamesSuggestQuery","tagValuesSuggestQuery","testDatasource","status","getAggregators","sort","getFilterTypes","md","metricLabel","createMetricLabel","dps","k","datapoints","alias","clone","tagData","toPairs","has","shouldComputeRate","rate","rateOptions","counter","isCounter","counterMax","counterResetValue","resetValue","dropResets","ResetValue","disableDownsampling","downsampleInterval","parseFloat","downsample","downsampleAggregator","downsampleFillPolicy","angular","filterKey","explicitTags","metrics","interpolatedTagValue","arrTagV","findIndex","every","tagV","tagK","includes","interpolateVariablesInQueries","date","roundUp","dateMath","valueOf","OpenTsQueryCtrl","errors","validateTarget","aggregators","fillPolicies","filterTypes","aggs","suggestMetrics","callback","getTextValues","suggestTagValues","targetBlur","metricFindResult","textUtil","addTag","addTagMode","currentTagKey","currentTagValue","removeTag","editTag","closeAddTagMode","addFilter","size","addFilterMode","currentFilterType","currentFilterGroupBy","currentFilter","currentFilterKey","currentFilterValue","groupBy","removeFilter","editFilter","fil","closeAddFilterMode","errs","shouldDownsample","rangeUtil","AnnotationsQueryCtrl","DataSourcePlugin","setQueryCtrl","setConfigEditor","onOptionsChange","DataSourceHttpSettings","defaultUrl","dataSourceConfig","setAnnotationQueryCtrl","makeClassES5Compatible","PanelCtrlES6","MetricsPanelCtrlES6","QueryCtrlES6"],"sourceRoot":""}