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AAS,QAAQ,8FCX5pLC,EAAOpB,QAAU,EAAjB","sources":["webpack://grafana/./public/app/plugins/datasource/cloud-monitoring/components/MQLQueryEditor.tsx","webpack://grafana/./public/app/plugins/datasource/cloud-monitoring/components/GraphPeriod.tsx","webpack://grafana/./public/app/plugins/datasource/cloud-monitoring/components/MetricQueryEditor.tsx","webpack://grafana/./public/app/plugins/datasource/cloud-monitoring/components/QueryEditor.tsx","webpack://grafana/./public/app/plugins/datasource/cloud-monitoring/components/SLO/Service.tsx","webpack://grafana/./public/app/plugins/datasource/cloud-monitoring/components/SLO/SLO.tsx","webpack://grafana/./public/app/plugins/datasource/cloud-monitoring/components/SLO/Selector.tsx","webpack://grafana/./public/app/plugins/datasource/cloud-monitoring/components/SLO/SLOQueryEditor.tsx","webpack://grafana/./public/app/plugins/datasource/cloud-monitoring/components/Project.tsx","webpack://grafana/./public/app/plugins/datasource/cloud-monitoring/components/Metrics.tsx","webpack://grafana/./public/app/plugins/datasource/cloud-monitoring/components/GroupBy.tsx","webpack://grafana/./public/app/plugins/datasource/cloud-monitoring/components/Alignment.tsx","webpack://grafana/./public/app/plugins/datasource/cloud-monitoring/components/LabelFilter.tsx","webpack://grafana/./public/app/plugins/datasource/cloud-monitoring/components/AnnotationsHelp.tsx","webpack://grafana/./public/app/plugins/datasource/cloud-monitoring/components/AlignmentFunction.tsx","webpack://grafana/./public/app/plugins/datasource/cloud-monitoring/components/AlignmentPeriodLabel.tsx","webpack://grafana/./public/app/plugins/datasource/cloud-monitoring/components/AliasBy.tsx","webpack://grafana/./public/app/plugins/datasource/cloud-monitoring/components/Aggregation.tsx","webpack://grafana/./public/app/plugins/datasource/cloud-monitoring/components/Fields.tsx","webpack://grafana/./public/app/plugins/datasource/cloud-monitoring/components/VisualMetricQueryEditor.tsx","webpack://grafana/./public/app/plugins/datasource/cloud-monitoring/components/PeriodSelect.tsx","webpack://grafana/./public/app/plugins/datasource/cloud-monitoring/components/Preprocessor.tsx","webpack://grafana/./public/app/plugins/datasource/cloud-monitoring/constants.ts","webpack://grafana/./public/app/plugins/datasource/cloud-monitoring/functions.ts","webpack://grafana/./public/app/plugins/datasource/cloud-monitoring/types.ts","webpack://grafana/../../opt/drone/yarncache/@grafana-google-sdk-npm-0.0.3-c91663433f-9eb5e043e0.zip/node_modules/@grafana/google-sdk/dist/index.production.js","webpack://grafana/../../opt/drone/yarncache/@grafana-google-sdk-npm-0.0.3-c91663433f-9eb5e043e0.zip/node_modules/@grafana/google-sdk/index.js"],"sourcesContent":["import React from 'react';\n\nimport { TextArea } from '@grafana/ui';\n\nexport interface Props {\n onChange: (query: string) => void;\n onRunQuery: () => void;\n query: string;\n}\n\nexport function MQLQueryEditor({ query, onChange, onRunQuery }: React.PropsWithChildren) {\n const onKeyDown = (event: any) => {\n if (event.key === 'Enter' && (event.shiftKey || event.ctrlKey)) {\n event.preventDefault();\n onRunQuery();\n }\n };\n\n return (\n <>\n onChange(e.currentTarget.value)}\n onKeyDown={onKeyDown}\n />\n \n );\n}\n","import React, { FunctionComponent } from 'react';\n\nimport { SelectableValue } from '@grafana/data';\nimport { Switch } from '@grafana/ui';\n\nimport { GRAPH_PERIODS, SELECT_WIDTH } from '../constants';\n\nimport { PeriodSelect, QueryEditorRow } from '.';\n\nexport interface Props {\n refId: string;\n onChange: (period: string) => void;\n variableOptionGroup: SelectableValue;\n graphPeriod?: string;\n}\n\nexport const GraphPeriod: FunctionComponent = ({ refId, onChange, graphPeriod, variableOptionGroup }) => {\n return (\n <>\n \n Set graph_period which forces a preferred period between points. Automatically set to the\n current interval if left blank.\n \n }\n >\n onChange(e.currentTarget.checked ? '' : 'disabled')}\n />\n \n \n \n );\n};\n","import React, { useCallback, useEffect, useState } from 'react';\n\nimport { SelectableValue } from '@grafana/data';\n\nimport CloudMonitoringDatasource from '../datasource';\nimport { getAlignmentPickerData } from '../functions';\nimport {\n AlignmentTypes,\n CustomMetaData,\n EditorMode,\n MetricDescriptor,\n MetricKind,\n MetricQuery,\n PreprocessorType,\n SLOQuery,\n ValueTypes,\n} from '../types';\n\nimport { GraphPeriod } from './GraphPeriod';\nimport { MQLQueryEditor } from './MQLQueryEditor';\n\nimport { AliasBy, Project, VisualMetricQueryEditor } from '.';\n\nexport interface Props {\n refId: string;\n customMetaData: CustomMetaData;\n variableOptionGroup: SelectableValue;\n onChange: (query: MetricQuery) => void;\n onRunQuery: () => void;\n query: MetricQuery;\n datasource: CloudMonitoringDatasource;\n}\n\ninterface State {\n labels: any;\n [key: string]: any;\n}\n\nexport const defaultState: State = {\n labels: {},\n};\n\nexport const defaultQuery: (dataSource: CloudMonitoringDatasource) => MetricQuery = (dataSource) => ({\n editorMode: EditorMode.Visual,\n projectName: dataSource.getDefaultProject(),\n metricType: '',\n metricKind: MetricKind.GAUGE,\n valueType: '',\n crossSeriesReducer: 'REDUCE_MEAN',\n alignmentPeriod: 'cloud-monitoring-auto',\n perSeriesAligner: AlignmentTypes.ALIGN_MEAN,\n groupBys: [],\n filters: [],\n aliasBy: '',\n query: '',\n preprocessor: PreprocessorType.None,\n});\n\nfunction Editor({\n refId,\n query,\n datasource,\n onChange: onQueryChange,\n onRunQuery,\n customMetaData,\n variableOptionGroup,\n}: React.PropsWithChildren) {\n const [state, setState] = useState(defaultState);\n const { projectName, metricType, groupBys, editorMode, crossSeriesReducer } = query;\n\n useEffect(() => {\n if (projectName && metricType) {\n datasource\n .getLabels(metricType, refId, projectName)\n .then((labels) => setState((prevState) => ({ ...prevState, labels })));\n }\n }, [datasource, groupBys, metricType, projectName, refId, crossSeriesReducer]);\n\n const onChange = useCallback(\n (metricQuery: MetricQuery | SLOQuery) => {\n onQueryChange({ ...query, ...metricQuery });\n onRunQuery();\n },\n [onQueryChange, onRunQuery, query]\n );\n\n const onMetricTypeChange = useCallback(\n ({ valueType, metricKind, type }: MetricDescriptor) => {\n const preprocessor =\n metricKind === MetricKind.GAUGE || valueType === ValueTypes.DISTRIBUTION\n ? PreprocessorType.None\n : PreprocessorType.Rate;\n const { perSeriesAligner } = getAlignmentPickerData(valueType, metricKind, state.perSeriesAligner, preprocessor);\n onChange({\n ...query,\n perSeriesAligner,\n metricType: type,\n valueType,\n metricKind,\n preprocessor,\n });\n },\n [onChange, query, state]\n );\n\n return (\n <>\n {\n onChange({ ...query, projectName });\n }}\n />\n\n {editorMode === EditorMode.Visual && (\n \n )}\n\n {editorMode === EditorMode.MQL && (\n <>\n onQueryChange({ ...query, query: q })}\n onRunQuery={onRunQuery}\n query={query.query}\n >\n onQueryChange({ ...query, graphPeriod })}\n graphPeriod={query.graphPeriod}\n refId={refId}\n variableOptionGroup={variableOptionGroup}\n />\n \n )}\n\n {\n onChange({ ...query, aliasBy });\n }}\n />\n \n );\n}\n\nexport const MetricQueryEditor = React.memo(Editor);\n","import { css } from '@emotion/css';\nimport React, { PureComponent } from 'react';\n\nimport { QueryEditorProps, toOption } from '@grafana/data';\nimport { Button, Select } from '@grafana/ui';\n\nimport { QUERY_TYPES, SELECT_WIDTH } from '../constants';\nimport CloudMonitoringDatasource from '../datasource';\nimport { CloudMonitoringQuery, EditorMode, MetricQuery, QueryType, SLOQuery, CloudMonitoringOptions } from '../types';\n\nimport { defaultQuery } from './MetricQueryEditor';\nimport { defaultQuery as defaultSLOQuery } from './SLO/SLOQueryEditor';\n\nimport { MetricQueryEditor, QueryEditorRow, SLOQueryEditor } from './';\n\nexport type Props = QueryEditorProps;\n\nexport class QueryEditor extends PureComponent {\n async UNSAFE_componentWillMount() {\n const { datasource, query } = this.props;\n\n // Unfortunately, migrations like this need to go UNSAFE_componentWillMount. As soon as there's\n // migration hook for this module.ts, we can do the migrations there instead.\n if (!this.props.query.hasOwnProperty('metricQuery')) {\n const { hide, refId, datasource, key, queryType, maxLines, metric, ...metricQuery } = this.props.query as any;\n this.props.query.metricQuery = metricQuery;\n }\n\n if (!this.props.query.hasOwnProperty('queryType')) {\n this.props.query.queryType = QueryType.METRICS;\n }\n\n await datasource.ensureGCEDefaultProject();\n if (!query.metricQuery.projectName) {\n this.props.query.metricQuery.projectName = datasource.getDefaultProject();\n }\n }\n\n onQueryChange(prop: string, value: MetricQuery | SLOQuery) {\n this.props.onChange({ ...this.props.query, [prop]: value });\n this.props.onRunQuery();\n }\n\n render() {\n const { datasource, query, onRunQuery, onChange } = this.props;\n const metricQuery = { ...defaultQuery(datasource), ...query.metricQuery };\n const sloQuery = { ...defaultSLOQuery(datasource), ...query.sloQuery };\n const queryType = query.queryType || QueryType.METRICS;\n const meta = this.props.data?.series.length ? this.props.data?.series[0].meta : {};\n const customMetaData = meta?.custom ?? {};\n const variableOptionGroup = {\n label: 'Template Variables',\n expanded: false,\n options: datasource.getVariables().map(toOption),\n };\n\n return (\n <>\n \n this.onQueryChange('metricQuery', {\n ...metricQuery,\n editorMode: metricQuery.editorMode === EditorMode.MQL ? EditorMode.Visual : EditorMode.MQL,\n })\n }\n >\n {metricQuery.editorMode === EditorMode.MQL ? 'Switch to builder' : 'Edit MQL'}\n \n )\n }\n htmlFor={`${query.refId}-query-type`}\n >\n {\n onChange({ ...query, sloQuery, queryType: value! });\n onRunQuery();\n }}\n inputId={`${query.refId}-query-type`}\n />\n \n\n {queryType === QueryType.METRICS && (\n {\n this.props.onChange({ ...this.props.query, metricQuery });\n }}\n onRunQuery={onRunQuery}\n datasource={datasource}\n query={metricQuery}\n >\n )}\n\n {queryType === QueryType.SLO && (\n this.onQueryChange('sloQuery', query)}\n onRunQuery={onRunQuery}\n datasource={datasource}\n query={sloQuery}\n >\n )}\n \n );\n }\n}\n","import React, { useEffect, useState } from 'react';\n\nimport { SelectableValue } from '@grafana/data';\nimport { Select } from '@grafana/ui';\n\nimport { QueryEditorRow } from '..';\nimport { SELECT_WIDTH } from '../../constants';\nimport CloudMonitoringDatasource from '../../datasource';\nimport { SLOQuery } from '../../types';\n\nexport interface Props {\n refId: string;\n onChange: (query: SLOQuery) => void;\n query: SLOQuery;\n templateVariableOptions: Array>;\n datasource: CloudMonitoringDatasource;\n}\n\nexport const Service: React.FC = ({ refId, query, templateVariableOptions, onChange, datasource }) => {\n const [services, setServices] = useState>>([]);\n const { projectName } = query;\n\n useEffect(() => {\n if (!projectName) {\n return;\n }\n\n datasource.getSLOServices(projectName).then((services: Array>) => {\n setServices([\n {\n label: 'Template Variables',\n options: templateVariableOptions,\n },\n ...services,\n ]);\n });\n }, [datasource, projectName, templateVariableOptions]);\n\n return (\n \n \n onChange({ ...query, serviceId, serviceName, sloId: '' })\n }\n />\n \n );\n};\n","import React, { useEffect, useState } from 'react';\n\nimport { SelectableValue } from '@grafana/data';\nimport { Select } from '@grafana/ui';\n\nimport { QueryEditorRow } from '..';\nimport { SELECT_WIDTH } from '../../constants';\nimport CloudMonitoringDatasource from '../../datasource';\nimport { SLOQuery } from '../../types';\n\nexport interface Props {\n refId: string;\n onChange: (query: SLOQuery) => void;\n query: SLOQuery;\n templateVariableOptions: Array>;\n datasource: CloudMonitoringDatasource;\n}\n\nexport const SLO: React.FC = ({ refId, query, templateVariableOptions, onChange, datasource }) => {\n const [slos, setSLOs] = useState>>([]);\n const { projectName, serviceId } = query;\n\n useEffect(() => {\n if (!projectName || !serviceId) {\n return;\n }\n\n datasource.getServiceLevelObjectives(projectName, serviceId).then((sloIds: Array>) => {\n setSLOs([\n {\n label: 'Template Variables',\n options: templateVariableOptions,\n },\n ...sloIds,\n ]);\n });\n }, [datasource, projectName, serviceId, templateVariableOptions]);\n\n return (\n \n {\n const slos = await datasource.getServiceLevelObjectives(projectName, serviceId);\n const slo = slos.find(({ value }) => value === datasource.templateSrv.replace(sloId));\n onChange({ ...query, sloId, sloName, goal: slo?.goal });\n }}\n />\n \n );\n};\n","import React from 'react';\n\nimport { SelectableValue } from '@grafana/data';\nimport { Select } from '@grafana/ui';\n\nimport { QueryEditorRow } from '..';\nimport { SELECT_WIDTH, SELECTORS } from '../../constants';\nimport CloudMonitoringDatasource from '../../datasource';\nimport { SLOQuery } from '../../types';\n\nexport interface Props {\n refId: string;\n onChange: (query: SLOQuery) => void;\n query: SLOQuery;\n templateVariableOptions: Array>;\n datasource: CloudMonitoringDatasource;\n}\n\nexport const Selector: React.FC = ({ refId, query, templateVariableOptions, onChange, datasource }) => {\n return (\n \n s.value === query?.selectorName ?? '')}\n options={[\n {\n label: 'Template Variables',\n options: templateVariableOptions,\n },\n ...SELECTORS,\n ]}\n onChange={({ value: selectorName }) => onChange({ ...query, selectorName: selectorName ?? '' })}\n />\n \n );\n};\n","import React from 'react';\n\nimport { SelectableValue } from '@grafana/data';\n\nimport { AliasBy, PeriodSelect, AlignmentPeriodLabel, Project, QueryEditorRow } from '..';\nimport { ALIGNMENT_PERIODS, SELECT_WIDTH } from '../../constants';\nimport CloudMonitoringDatasource from '../../datasource';\nimport { AlignmentTypes, CustomMetaData, SLOQuery } from '../../types';\n\nimport { Selector, Service, SLO } from '.';\n\nexport interface Props {\n refId: string;\n customMetaData: CustomMetaData;\n variableOptionGroup: SelectableValue;\n onChange: (query: SLOQuery) => void;\n onRunQuery: () => void;\n query: SLOQuery;\n datasource: CloudMonitoringDatasource;\n}\n\nexport const defaultQuery: (dataSource: CloudMonitoringDatasource) => SLOQuery = (dataSource) => ({\n projectName: dataSource.getDefaultProject(),\n alignmentPeriod: 'cloud-monitoring-auto',\n perSeriesAligner: AlignmentTypes.ALIGN_MEAN,\n aliasBy: '',\n selectorName: 'select_slo_health',\n serviceId: '',\n serviceName: '',\n sloId: '',\n sloName: '',\n});\n\nexport function SLOQueryEditor({\n refId,\n query,\n datasource,\n onChange,\n variableOptionGroup,\n customMetaData,\n}: React.PropsWithChildren) {\n return (\n <>\n onChange({ ...query, projectName })}\n />\n \n \n \n\n \n onChange({ ...query, alignmentPeriod: period })}\n aligmentPeriods={ALIGNMENT_PERIODS}\n />\n \n \n\n onChange({ ...query, aliasBy })} />\n \n );\n}\n","import React, { useEffect, useMemo, useState } from 'react';\n\nimport { SelectableValue } from '@grafana/data';\nimport { Select } from '@grafana/ui';\n\nimport { SELECT_WIDTH } from '../constants';\nimport CloudMonitoringDatasource from '../datasource';\n\nimport { QueryEditorRow } from '.';\n\nexport interface Props {\n refId: string;\n datasource: CloudMonitoringDatasource;\n onChange: (projectName: string) => void;\n templateVariableOptions: Array>;\n projectName: string;\n}\n\nexport function Project({ refId, projectName, datasource, onChange, templateVariableOptions }: Props) {\n const [projects, setProjects] = useState>>([]);\n useEffect(() => {\n datasource.getProjects().then((projects) => setProjects(projects));\n }, [datasource]);\n\n const projectsWithTemplateVariables = useMemo(\n () => [\n projects,\n {\n label: 'Template Variables',\n options: templateVariableOptions,\n },\n ...projects,\n ],\n [projects, templateVariableOptions]\n );\n\n return (\n \n `Use project: ${v}`}\n onChange={({ value }) => onChange(value!)}\n options={projectsWithTemplateVariables}\n value={{ value: projectName, label: projectName }}\n placeholder=\"Select Project\"\n inputId={`${refId}-project`}\n />\n \n );\n}\n","import { css } from '@emotion/css';\nimport { startCase, uniqBy } from 'lodash';\nimport React, { useCallback, useEffect, useState } from 'react';\n\nimport { GrafanaTheme2, SelectableValue } from '@grafana/data';\nimport { TemplateSrv } from '@grafana/runtime';\nimport { getSelectStyles, Select, useStyles2, useTheme2 } from '@grafana/ui';\n\nimport { INNER_LABEL_WIDTH, LABEL_WIDTH, SELECT_WIDTH } from '../constants';\nimport CloudMonitoringDatasource from '../datasource';\nimport { MetricDescriptor } from '../types';\n\nimport { QueryEditorField, QueryEditorRow } from '.';\n\nexport interface Props {\n refId: string;\n onChange: (metricDescriptor: MetricDescriptor) => void;\n templateSrv: TemplateSrv;\n templateVariableOptions: Array>;\n datasource: CloudMonitoringDatasource;\n projectName: string;\n metricType: string;\n children: (metricDescriptor?: MetricDescriptor) => JSX.Element;\n}\n\ninterface State {\n metricDescriptors: MetricDescriptor[];\n metrics: any[];\n services: any[];\n service: string;\n metric: string;\n metricDescriptor?: MetricDescriptor;\n projectName: string | null;\n}\n\nexport function Metrics(props: Props) {\n const [state, setState] = useState({\n metricDescriptors: [],\n metrics: [],\n services: [],\n service: '',\n metric: '',\n projectName: null,\n });\n\n const theme = useTheme2();\n const selectStyles = getSelectStyles(theme);\n\n const customStyle = useStyles2(getStyles);\n\n const { services, service, metrics, metricDescriptors } = state;\n const { metricType, templateVariableOptions, projectName, templateSrv, datasource, onChange, children } = props;\n\n const getSelectedMetricDescriptor = useCallback(\n (metricDescriptors: MetricDescriptor[], metricType: string) => {\n return metricDescriptors.find((md) => md.type === templateSrv.replace(metricType))!;\n },\n [templateSrv]\n );\n\n useEffect(() => {\n const getMetricsList = (metricDescriptors: MetricDescriptor[]) => {\n const selectedMetricDescriptor = getSelectedMetricDescriptor(metricDescriptors, metricType);\n if (!selectedMetricDescriptor) {\n return [];\n }\n\n const metricsByService = metricDescriptors\n .filter((m) => m.service === selectedMetricDescriptor.service)\n .map((m) => ({\n service: m.service,\n value: m.type,\n label: m.displayName,\n component: function optionComponent() {\n return (\n
\n
{m.type}
\n
{m.description}
\n
\n );\n },\n }));\n return metricsByService;\n };\n\n const loadMetricDescriptors = async () => {\n if (projectName) {\n const metricDescriptors = await datasource.getMetricTypes(projectName);\n const services = getServicesList(metricDescriptors);\n const metrics = getMetricsList(metricDescriptors);\n const service = metrics.length > 0 ? metrics[0].service : '';\n const metricDescriptor = getSelectedMetricDescriptor(metricDescriptors, metricType);\n setState((prevState) => ({\n ...prevState,\n metricDescriptors,\n services,\n metrics,\n service: service,\n metricDescriptor,\n }));\n }\n };\n loadMetricDescriptors();\n }, [datasource, getSelectedMetricDescriptor, metricType, projectName, customStyle, selectStyles.optionDescription]);\n\n const onServiceChange = ({ value: service }: any) => {\n const metrics = metricDescriptors\n .filter((m: MetricDescriptor) => m.service === templateSrv.replace(service))\n .map((m: MetricDescriptor) => ({\n service: m.service,\n value: m.type,\n label: m.displayName,\n description: m.description,\n }));\n\n if (metrics.length > 0 && !metrics.some((m) => m.value === templateSrv.replace(metricType))) {\n onMetricTypeChange(metrics[0], { service, metrics });\n } else {\n setState({ ...state, service, metrics });\n }\n };\n\n const onMetricTypeChange = ({ value }: SelectableValue, extra: any = {}) => {\n const metricDescriptor = getSelectedMetricDescriptor(state.metricDescriptors, value!);\n setState({ ...state, metricDescriptor, ...extra });\n onChange({ ...metricDescriptor, type: value! });\n };\n\n const getServicesList = (metricDescriptors: MetricDescriptor[]) => {\n const services = metricDescriptors.map((m) => ({\n value: m.service,\n label: startCase(m.serviceShortName),\n }));\n\n return services.length > 0 ? uniqBy(services, (s) => s.value) : [];\n };\n\n return (\n <>\n \n \n s.value === service)}\n options={[\n {\n label: 'Template Variables',\n options: templateVariableOptions,\n },\n ...services,\n ]}\n placeholder=\"Select Services\"\n inputId={`${props.refId}-service`}\n >\n \n \n s.value === metricType)}\n options={[\n {\n label: 'Template Variables',\n options: templateVariableOptions,\n },\n ...metrics,\n ]}\n placeholder=\"Select Metric\"\n inputId={`${props.refId}-select-metric`}\n >\n \n \n\n {children(state.metricDescriptor)}\n \n );\n}\n\nconst getStyles = (theme: GrafanaTheme2) => css`\n label: grafana-select-option-description;\n font-weight: normal;\n font-style: italic;\n color: ${theme.colors.text.secondary};\n`;\n","import React, { FunctionComponent, useMemo } from 'react';\n\nimport { SelectableValue } from '@grafana/data';\nimport { MultiSelect } from '@grafana/ui';\n\nimport { INPUT_WIDTH, SYSTEM_LABELS } from '../constants';\nimport { labelsToGroupedOptions } from '../functions';\nimport { MetricDescriptor, MetricQuery } from '../types';\n\nimport { Aggregation, QueryEditorRow } from '.';\n\nexport interface Props {\n refId: string;\n variableOptionGroup: SelectableValue;\n labels: string[];\n metricDescriptor?: MetricDescriptor;\n onChange: (query: MetricQuery) => void;\n query: MetricQuery;\n}\n\nexport const GroupBy: FunctionComponent = ({\n refId,\n labels: groupBys = [],\n query,\n onChange,\n variableOptionGroup,\n metricDescriptor,\n}) => {\n const options = useMemo(\n () => [variableOptionGroup, ...labelsToGroupedOptions([...groupBys, ...SYSTEM_LABELS])],\n [groupBys, variableOptionGroup]\n );\n\n return (\n \n {\n onChange({ ...query, groupBys: options.map((o) => o.value!) });\n }}\n >\n onChange({ ...query, crossSeriesReducer })}\n refId={refId}\n >\n \n );\n};\n","import React, { FC } from 'react';\n\nimport { SelectableValue } from '@grafana/data';\n\nimport { ALIGNMENT_PERIODS, SELECT_WIDTH } from '../constants';\nimport CloudMonitoringDatasource from '../datasource';\nimport { CustomMetaData, MetricQuery, SLOQuery } from '../types';\n\nimport { AlignmentFunction, PeriodSelect, AlignmentPeriodLabel, QueryEditorField, QueryEditorRow } from '.';\n\nexport interface Props {\n refId: string;\n onChange: (query: MetricQuery | SLOQuery) => void;\n query: MetricQuery;\n templateVariableOptions: Array>;\n customMetaData: CustomMetaData;\n datasource: CloudMonitoringDatasource;\n}\n\nexport const Alignment: FC = ({\n refId,\n templateVariableOptions,\n onChange,\n query,\n customMetaData,\n datasource,\n}) => {\n return (\n }\n htmlFor={`${refId}-alignment-function`}\n >\n \n \n onChange({ ...query, alignmentPeriod: period })}\n aligmentPeriods={ALIGNMENT_PERIODS}\n />\n \n \n );\n};\n","import { flatten } from 'lodash';\nimport React, { FunctionComponent, useCallback, useMemo } from 'react';\n\nimport { SelectableValue, toOption } from '@grafana/data';\nimport { Button, HorizontalGroup, Select, VerticalGroup } from '@grafana/ui';\nimport { CustomControlProps } from '@grafana/ui/src/components/Select/types';\n\nimport { SELECT_WIDTH } from '../constants';\nimport { labelsToGroupedOptions, stringArrayToFilters } from '../functions';\nimport { Filter } from '../types';\n\nimport { QueryEditorRow } from '.';\n\nexport interface Props {\n labels: { [key: string]: string[] };\n filters: string[];\n onChange: (filters: string[]) => void;\n variableOptionGroup: SelectableValue;\n}\n\nconst operators = ['=', '!=', '=~', '!=~'];\n\nconst FilterButton = React.forwardRef>(\n ({ value, isOpen, invalid, ...rest }, ref) => {\n return ;\n }\n);\nFilterButton.displayName = 'FilterButton';\n\nconst OperatorButton = React.forwardRef>(({ value, ...rest }, ref) => {\n return (\n \n );\n});\nOperatorButton.displayName = 'OperatorButton';\n\nexport const LabelFilter: FunctionComponent = ({\n labels = {},\n filters: filterArray,\n onChange,\n variableOptionGroup,\n}) => {\n const filters = useMemo(() => stringArrayToFilters(filterArray), [filterArray]);\n const options = useMemo(\n () => [variableOptionGroup, ...labelsToGroupedOptions(Object.keys(labels))],\n [labels, variableOptionGroup]\n );\n\n const filtersToStringArray = useCallback((filters: Filter[]) => {\n const strArr = flatten(filters.map(({ key, operator, value, condition }) => [key, operator, value, condition!]));\n return strArr.slice(0, strArr.length - 1);\n }, []);\n\n const AddFilter = () => {\n return (\n \n onChange(filtersToStringArray([...filters, { key, operator: '=', condition: 'AND', value: '' }]))\n }\n menuPlacement=\"bottom\"\n renderControl={FilterButton}\n />\n );\n };\n\n return (\n 1}\n >\n \n {filters.map(({ key, operator, value, condition }, index) => {\n // Add the current key and value as options if they are manually entered\n const keyPresent = options.some((op) => {\n if (op.options) {\n return options.some((opp) => opp.label === key);\n }\n return op.label === key;\n });\n if (!keyPresent) {\n options.push({ label: key, value: key });\n }\n\n const valueOptions = labels.hasOwnProperty(key)\n ? [variableOptionGroup, ...labels[key].map(toOption)]\n : [variableOptionGroup];\n const valuePresent = valueOptions.some((op) => {\n return op.label === value;\n });\n if (!valuePresent) {\n valueOptions.push({ label: value, value });\n }\n\n return (\n \n `Use label key: ${v}`}\n value={key}\n options={options}\n onChange={({ value: key = '' }) => {\n onChange(\n filtersToStringArray(\n filters.map((f, i) => (i === index ? { key, operator, condition, value: '' } : f))\n )\n );\n }}\n />\n \n onChange(filtersToStringArray(filters.map((f, i) => (i === index ? { ...f, operator } : f))))\n }\n menuPlacement=\"bottom\"\n renderControl={OperatorButton}\n />\n `Use label value: ${v}`}\n allowCustomValue\n value={value}\n placeholder=\"add filter value\"\n options={valueOptions}\n onChange={({ value = '' }) =>\n onChange(filtersToStringArray(filters.map((f, i) => (i === index ? { ...f, value } : f))))\n }\n />\n onChange(filtersToStringArray(filters.filter((_, i) => i !== index)))}\n >\n {index + 1 === filters.length && Object.values(filters).every(({ value }) => value) && }\n \n );\n })}\n {!filters.length && }\n \n \n );\n};\n","import React, { FC } from 'react';\n\nexport const AnnotationsHelp: FC = () => {\n return (\n
\n
\n
Annotation Query Format
\n

\n An annotation is an event that is overlaid on top of graphs. Annotation rendering is expensive so it is\n important to limit the number of rows returned.{' '}\n

\n

\n The Title and Text fields support templating and can use data returned from the query. For example, the Title\n field could have the following text:\n

\n \n {`${'{{metric.type}}'}`} has value: {`${'{{metric.value}}'}`}\n \n

\n Example Result: monitoring.googleapis.com/uptime_check/http_status has this value: 502\n

\n \n

\n {`${'{{metric.value}}'}`} = value of the metric/point\n

\n

\n {`${'{{metric.type}}'}`} = metric type e.g. compute.googleapis.com/instance/cpu/usage_time\n

\n

\n {`${'{{metric.name}}'}`} = name part of metric e.g. instance/cpu/usage_time\n

\n

\n {`${'{{metric.service}}'}`} = service part of metric e.g. compute\n

\n

\n {`${'{{metric.label.label_name}}'}`} = Metric label metadata e.g. metric.label.instance_name\n

\n

\n {`${'{{resource.label.label_name}}'}`} = Resource label metadata e.g. resource.label.zone\n

\n
\n
\n );\n};\n","import React, { FC, useMemo } from 'react';\n\nimport { SelectableValue } from '@grafana/data';\nimport { Select } from '@grafana/ui';\n\nimport { SELECT_WIDTH } from '../constants';\nimport { getAlignmentPickerData } from '../functions';\nimport { MetricQuery } from '../types';\n\nexport interface Props {\n inputId: string;\n onChange: (query: MetricQuery) => void;\n query: MetricQuery;\n templateVariableOptions: Array>;\n}\n\nexport const AlignmentFunction: FC = ({ inputId, query, templateVariableOptions, onChange }) => {\n const { valueType, metricKind, perSeriesAligner: psa, preprocessor } = query;\n const { perSeriesAligner, alignOptions } = useMemo(\n () => getAlignmentPickerData(valueType, metricKind, psa, preprocessor),\n [valueType, metricKind, psa, preprocessor]\n );\n\n return (\n onChange({ ...query, perSeriesAligner: value! })}\n value={[...alignOptions, ...templateVariableOptions].find((s) => s.value === perSeriesAligner)}\n options={[\n {\n label: 'Template Variables',\n options: templateVariableOptions,\n },\n {\n label: 'Alignment options',\n expanded: true,\n options: alignOptions,\n },\n ]}\n placeholder=\"Select Alignment\"\n inputId={inputId}\n >\n );\n};\n","import React, { FC, useMemo } from 'react';\n\nimport { rangeUtil } from '@grafana/data';\n\nimport { ALIGNMENTS } from '../constants';\nimport CloudMonitoringDatasource from '../datasource';\nimport { CustomMetaData } from '../types';\n\nexport interface Props {\n customMetaData: CustomMetaData;\n datasource: CloudMonitoringDatasource;\n}\n\nexport const AlignmentPeriodLabel: FC = ({ customMetaData, datasource }) => {\n const { perSeriesAligner, alignmentPeriod } = customMetaData;\n const formatAlignmentText = useMemo(() => {\n if (!alignmentPeriod || !perSeriesAligner) {\n return '';\n }\n\n const alignment = ALIGNMENTS.find((ap) => ap.value === datasource.templateSrv.replace(perSeriesAligner));\n const seconds = parseInt(alignmentPeriod ?? ''.replace(/[^0-9]/g, ''), 10);\n const hms = rangeUtil.secondsToHms(seconds);\n return `${hms} interval (${alignment?.text ?? ''})`;\n }, [datasource, perSeriesAligner, alignmentPeriod]);\n\n return ;\n};\n","import { debounce } from 'lodash';\nimport React, { FunctionComponent, useState } from 'react';\n\nimport { Input } from '@grafana/ui';\n\nimport { INPUT_WIDTH } from '../constants';\n\nimport { QueryEditorRow } from '.';\n\nexport interface Props {\n refId: string;\n onChange: (alias: any) => void;\n value?: string;\n}\n\nexport const AliasBy: FunctionComponent = ({ refId, value = '', onChange }) => {\n const [alias, setAlias] = useState(value ?? '');\n\n const propagateOnChange = debounce(onChange, 1000);\n\n onChange = (e: any) => {\n setAlias(e.target.value);\n propagateOnChange(e.target.value);\n };\n\n return (\n \n \n \n );\n};\n","import React, { FC, useMemo } from 'react';\n\nimport { SelectableValue } from '@grafana/data';\nimport { Select } from '@grafana/ui';\n\nimport { getAggregationOptionsByMetric } from '../functions';\nimport { MetricDescriptor, MetricKind, ValueTypes } from '../types';\n\nimport { QueryEditorField } from '.';\n\nexport interface Props {\n refId: string;\n onChange: (metricDescriptor: string) => void;\n metricDescriptor?: MetricDescriptor;\n crossSeriesReducer: string;\n groupBys: string[];\n templateVariableOptions: Array>;\n}\n\nexport const Aggregation: FC = (props) => {\n const aggOptions = useAggregationOptionsByMetric(props);\n const selected = useSelectedFromOptions(aggOptions, props);\n\n return (\n \n props.onChange(value!)}\n value={selected}\n options={[\n {\n label: 'Template Variables',\n options: props.templateVariableOptions,\n },\n {\n label: 'Aggregations',\n expanded: true,\n options: aggOptions,\n },\n ]}\n placeholder=\"Select Reducer\"\n inputId={`${props.refId}-group-by-function`}\n />\n \n );\n};\n\nconst useAggregationOptionsByMetric = ({ metricDescriptor }: Props): Array> => {\n const valueType = metricDescriptor?.valueType;\n const metricKind = metricDescriptor?.metricKind;\n\n return useMemo(() => {\n if (!valueType || !metricKind) {\n return [];\n }\n\n return getAggregationOptionsByMetric(valueType as ValueTypes, metricKind as MetricKind).map((a) => ({\n ...a,\n label: a.text,\n }));\n }, [valueType, metricKind]);\n};\n\nconst useSelectedFromOptions = (aggOptions: Array>, props: Props) => {\n return useMemo(() => {\n const allOptions = [...aggOptions, ...props.templateVariableOptions];\n return allOptions.find((s) => s.value === props.crossSeriesReducer);\n }, [aggOptions, props.crossSeriesReducer, props.templateVariableOptions]);\n};\n","import { css } from '@emotion/css';\nimport React, { FC } from 'react';\n\nimport { SelectableValue } from '@grafana/data';\nimport { HorizontalGroup, InlineField, InlineLabel, PopoverContent, Select } from '@grafana/ui';\n\nimport { INNER_LABEL_WIDTH, LABEL_WIDTH } from '../constants';\n\ninterface VariableQueryFieldProps {\n onChange: (value: string) => void;\n options: SelectableValue[];\n value: string;\n label: string;\n allowCustomValue?: boolean;\n}\n\nexport const VariableQueryField: FC = ({\n label,\n onChange,\n value,\n options,\n allowCustomValue = false,\n}) => {\n return (\n \n onChange(value!)}\n options={options}\n />\n \n );\n};\n\nexport interface Props {\n children: React.ReactNode;\n tooltip?: PopoverContent;\n label?: React.ReactNode;\n className?: string;\n noFillEnd?: boolean;\n labelWidth?: number;\n fillComponent?: React.ReactNode;\n htmlFor?: string;\n}\n\nexport const QueryEditorRow: FC = ({\n children,\n label,\n tooltip,\n fillComponent,\n noFillEnd = false,\n labelWidth = LABEL_WIDTH,\n htmlFor,\n ...rest\n}) => {\n return (\n
\n {label && (\n \n {label}\n \n )}\n \n \n {children}\n \n
\n
\n {noFillEnd ||
{fillComponent}
}\n
\n \n );\n};\n\nexport const QueryEditorField: FC = ({ children, label, tooltip, labelWidth = INNER_LABEL_WIDTH, ...rest }) => {\n return (\n <>\n {label && (\n \n {label}\n \n )}\n {children}\n \n );\n};\n","import React from 'react';\n\nimport { SelectableValue } from '@grafana/data';\n\nimport CloudMonitoringDatasource from '../datasource';\nimport { CustomMetaData, MetricDescriptor, MetricQuery, SLOQuery } from '../types';\n\nimport { Alignment, GroupBy, LabelFilter, Metrics, Preprocessor } from '.';\n\nexport interface Props {\n refId: string;\n customMetaData: CustomMetaData;\n variableOptionGroup: SelectableValue;\n onMetricTypeChange: (query: MetricDescriptor) => void;\n onChange: (query: MetricQuery | SLOQuery) => void;\n query: MetricQuery;\n datasource: CloudMonitoringDatasource;\n labels: any;\n}\n\nfunction Editor({\n refId,\n query,\n labels,\n datasource,\n onChange,\n onMetricTypeChange,\n customMetaData,\n variableOptionGroup,\n}: React.PropsWithChildren) {\n return (\n \n {(metric) => (\n <>\n onChange({ ...query, filters })}\n variableOptionGroup={variableOptionGroup}\n />\n \n \n \n \n )}\n \n );\n}\n\nexport const VisualMetricQueryEditor = React.memo(Editor);\n","import React, { useMemo } from 'react';\n\nimport { SelectableValue } from '@grafana/data';\nimport { Select } from '@grafana/ui';\n\nimport { periodOption } from '../constants';\n\nexport interface Props {\n inputId: string;\n onChange: (period: string) => void;\n templateVariableOptions: Array>;\n aligmentPeriods: periodOption[];\n selectWidth?: number;\n category?: string;\n disabled?: boolean;\n current?: string;\n}\n\nexport function PeriodSelect({\n inputId,\n templateVariableOptions,\n onChange,\n current,\n selectWidth,\n disabled,\n aligmentPeriods,\n}: Props) {\n const options = useMemo(\n () =>\n aligmentPeriods.map((ap) => ({\n ...ap,\n label: ap.text,\n })),\n [aligmentPeriods]\n );\n const visibleOptions = useMemo(() => options.filter((ap) => !ap.hidden), [options]);\n\n return (\n onChange(value!)}\n value={[...options, ...templateVariableOptions].find((s) => s.value === current)}\n options={[\n {\n label: 'Template Variables',\n options: templateVariableOptions,\n },\n {\n label: 'Aggregations',\n expanded: true,\n options: visibleOptions,\n },\n ]}\n placeholder=\"Select Period\"\n inputId={inputId}\n disabled={disabled}\n allowCustomValue\n >\n );\n}\n","import React, { FunctionComponent, useMemo } from 'react';\n\nimport { SelectableValue } from '@grafana/data';\nimport { RadioButtonGroup } from '@grafana/ui';\n\nimport { getAlignmentPickerData } from '../functions';\nimport { MetricDescriptor, MetricKind, MetricQuery, PreprocessorType, ValueTypes } from '../types';\n\nimport { QueryEditorRow } from '.';\n\nconst NONE_OPTION = { label: 'None', value: PreprocessorType.None };\n\nexport interface Props {\n metricDescriptor?: MetricDescriptor;\n onChange: (query: MetricQuery) => void;\n query: MetricQuery;\n}\n\nexport const Preprocessor: FunctionComponent = ({ query, metricDescriptor, onChange }) => {\n const options = useOptions(metricDescriptor);\n return (\n \n {\n const { valueType, metricKind, perSeriesAligner: psa } = query;\n const { perSeriesAligner } = getAlignmentPickerData(valueType, metricKind, psa, value);\n onChange({ ...query, preprocessor: value, perSeriesAligner });\n }}\n value={query.preprocessor ?? PreprocessorType.None}\n options={options}\n >\n \n );\n};\n\nconst useOptions = (metricDescriptor?: MetricDescriptor): Array> => {\n const metricKind = metricDescriptor?.metricKind;\n const valueType = metricDescriptor?.valueType;\n\n return useMemo(() => {\n if (!metricKind || metricKind === MetricKind.GAUGE || valueType === ValueTypes.DISTRIBUTION) {\n return [NONE_OPTION];\n }\n\n const options = [\n NONE_OPTION,\n {\n label: 'Rate',\n value: PreprocessorType.Rate,\n description: 'Data points are aligned and converted to a rate per time series',\n },\n ];\n\n return metricKind === MetricKind.CUMULATIVE\n ? [\n ...options,\n {\n label: 'Delta',\n value: PreprocessorType.Delta,\n description: 'Data points are aligned by their delta (difference) per time series',\n },\n ]\n : options;\n }, [metricKind, valueType]);\n};\n","import { GoogleAuthType } from '@grafana/google-sdk';\n\nimport { MetricKind, QueryType, ValueTypes } from './types';\n\n// not super excited about using uneven numbers, but this makes it align perfectly with rows that has two fields\nexport const INPUT_WIDTH = 71;\nexport const LABEL_WIDTH = 19;\nexport const INNER_LABEL_WIDTH = 14;\nexport const SELECT_WIDTH = 28;\nexport const AUTH_TYPES = [\n { value: 'Google JWT File', key: GoogleAuthType.JWT },\n { value: 'GCE Default Service Account', key: GoogleAuthType.GCE },\n];\n\nexport const ALIGNMENTS = [\n {\n text: 'none',\n value: 'ALIGN_NONE',\n valueTypes: [\n ValueTypes.INT64,\n ValueTypes.DOUBLE,\n ValueTypes.MONEY,\n ValueTypes.DISTRIBUTION,\n ValueTypes.STRING,\n ValueTypes.VALUE_TYPE_UNSPECIFIED,\n ValueTypes.BOOL,\n ],\n metricKinds: [MetricKind.GAUGE],\n },\n {\n text: 'delta',\n value: 'ALIGN_DELTA',\n valueTypes: [ValueTypes.INT64, ValueTypes.DOUBLE, ValueTypes.MONEY, ValueTypes.DISTRIBUTION],\n metricKinds: [MetricKind.CUMULATIVE, MetricKind.DELTA],\n },\n {\n text: 'rate',\n value: 'ALIGN_RATE',\n valueTypes: [ValueTypes.INT64, ValueTypes.DOUBLE, ValueTypes.MONEY],\n metricKinds: [MetricKind.CUMULATIVE, MetricKind.DELTA],\n },\n {\n text: 'interpolate',\n value: 'ALIGN_INTERPOLATE',\n valueTypes: [ValueTypes.INT64, ValueTypes.DOUBLE, ValueTypes.MONEY],\n metricKinds: [MetricKind.GAUGE],\n },\n {\n text: 'next older',\n value: 'ALIGN_NEXT_OLDER',\n valueTypes: [\n ValueTypes.INT64,\n ValueTypes.DOUBLE,\n ValueTypes.MONEY,\n ValueTypes.DISTRIBUTION,\n ValueTypes.STRING,\n ValueTypes.VALUE_TYPE_UNSPECIFIED,\n ValueTypes.BOOL,\n ],\n metricKinds: [MetricKind.GAUGE],\n },\n {\n text: 'min',\n value: 'ALIGN_MIN',\n valueTypes: [ValueTypes.INT64, ValueTypes.DOUBLE, ValueTypes.MONEY],\n metricKinds: [MetricKind.GAUGE, MetricKind.DELTA],\n },\n {\n text: 'max',\n value: 'ALIGN_MAX',\n valueTypes: [ValueTypes.INT64, ValueTypes.DOUBLE, ValueTypes.MONEY],\n metricKinds: [MetricKind.GAUGE, MetricKind.DELTA],\n },\n {\n text: 'mean',\n value: 'ALIGN_MEAN',\n valueTypes: [ValueTypes.INT64, ValueTypes.DOUBLE, ValueTypes.MONEY],\n metricKinds: [MetricKind.GAUGE, MetricKind.DELTA],\n },\n {\n text: 'count',\n value: 'ALIGN_COUNT',\n valueTypes: [ValueTypes.INT64, ValueTypes.DOUBLE, ValueTypes.MONEY, ValueTypes.BOOL],\n metricKinds: [MetricKind.GAUGE, MetricKind.DELTA],\n },\n {\n text: 'sum',\n value: 'ALIGN_SUM',\n valueTypes: [ValueTypes.INT64, ValueTypes.DOUBLE, ValueTypes.MONEY, ValueTypes.DISTRIBUTION],\n metricKinds: [MetricKind.GAUGE, MetricKind.DELTA],\n },\n {\n text: 'stddev',\n value: 'ALIGN_STDDEV',\n valueTypes: [ValueTypes.INT64, ValueTypes.DOUBLE, ValueTypes.MONEY],\n metricKinds: [MetricKind.GAUGE, MetricKind.DELTA],\n },\n {\n text: 'count true',\n value: 'ALIGN_COUNT_TRUE',\n valueTypes: [ValueTypes.BOOL],\n metricKinds: [MetricKind.GAUGE],\n },\n {\n text: 'count false',\n value: 'ALIGN_COUNT_FALSE',\n valueTypes: [ValueTypes.BOOL],\n metricKinds: [MetricKind.GAUGE],\n },\n {\n text: 'fraction true',\n value: 'ALIGN_FRACTION_TRUE',\n valueTypes: [ValueTypes.BOOL],\n metricKinds: [MetricKind.GAUGE],\n },\n {\n text: 'percentile 99',\n value: 'ALIGN_PERCENTILE_99',\n valueTypes: [ValueTypes.DISTRIBUTION],\n metricKinds: [MetricKind.GAUGE, MetricKind.DELTA],\n },\n {\n text: 'percentile 95',\n value: 'ALIGN_PERCENTILE_95',\n valueTypes: [ValueTypes.DISTRIBUTION],\n metricKinds: [MetricKind.GAUGE, MetricKind.DELTA],\n },\n {\n text: 'percentile 50',\n value: 'ALIGN_PERCENTILE_50',\n valueTypes: [ValueTypes.DISTRIBUTION],\n metricKinds: [MetricKind.GAUGE, MetricKind.DELTA],\n },\n {\n text: 'percentile 05',\n value: 'ALIGN_PERCENTILE_05',\n valueTypes: [ValueTypes.DISTRIBUTION],\n metricKinds: [MetricKind.GAUGE, MetricKind.DELTA],\n },\n {\n text: 'percent change',\n value: 'ALIGN_PERCENT_CHANGE',\n valueTypes: [ValueTypes.INT64, ValueTypes.DOUBLE, ValueTypes.MONEY],\n metricKinds: [MetricKind.GAUGE, MetricKind.DELTA],\n },\n];\n\nexport const AGGREGATIONS = [\n {\n text: 'none',\n value: 'REDUCE_NONE',\n valueTypes: [\n ValueTypes.INT64,\n ValueTypes.DOUBLE,\n ValueTypes.MONEY,\n ValueTypes.DISTRIBUTION,\n ValueTypes.BOOL,\n ValueTypes.STRING,\n ],\n metricKinds: [MetricKind.GAUGE, MetricKind.DELTA, MetricKind.CUMULATIVE, MetricKind.METRIC_KIND_UNSPECIFIED],\n },\n {\n text: 'mean',\n value: 'REDUCE_MEAN',\n valueTypes: [ValueTypes.INT64, ValueTypes.DOUBLE, ValueTypes.MONEY, ValueTypes.DISTRIBUTION],\n metricKinds: [MetricKind.GAUGE, MetricKind.DELTA, MetricKind.CUMULATIVE],\n },\n {\n text: 'min',\n value: 'REDUCE_MIN',\n valueTypes: [ValueTypes.INT64, ValueTypes.DOUBLE, ValueTypes.MONEY],\n metricKinds: [MetricKind.GAUGE, MetricKind.DELTA, MetricKind.CUMULATIVE, MetricKind.METRIC_KIND_UNSPECIFIED],\n },\n {\n text: 'max',\n value: 'REDUCE_MAX',\n valueTypes: [ValueTypes.INT64, ValueTypes.DOUBLE, ValueTypes.MONEY],\n metricKinds: [MetricKind.GAUGE, MetricKind.DELTA, MetricKind.CUMULATIVE, MetricKind.METRIC_KIND_UNSPECIFIED],\n },\n {\n text: 'sum',\n value: 'REDUCE_SUM',\n valueTypes: [ValueTypes.INT64, ValueTypes.DOUBLE, ValueTypes.MONEY, ValueTypes.DISTRIBUTION],\n metricKinds: [MetricKind.GAUGE, MetricKind.DELTA, MetricKind.CUMULATIVE, MetricKind.METRIC_KIND_UNSPECIFIED],\n },\n {\n text: 'std. dev.',\n value: 'REDUCE_STDDEV',\n valueTypes: [ValueTypes.INT64, ValueTypes.DOUBLE, ValueTypes.MONEY, ValueTypes.DISTRIBUTION],\n metricKinds: [MetricKind.GAUGE, MetricKind.DELTA, MetricKind.CUMULATIVE, MetricKind.METRIC_KIND_UNSPECIFIED],\n },\n {\n text: 'count',\n value: 'REDUCE_COUNT',\n valueTypes: [\n ValueTypes.INT64,\n ValueTypes.DOUBLE,\n ValueTypes.MONEY,\n ValueTypes.DISTRIBUTION,\n ValueTypes.BOOL,\n ValueTypes.STRING,\n ],\n metricKinds: [MetricKind.GAUGE, MetricKind.DELTA, MetricKind.CUMULATIVE],\n },\n {\n text: 'count true',\n value: 'REDUCE_COUNT_TRUE',\n valueTypes: [ValueTypes.BOOL],\n metricKinds: [MetricKind.GAUGE, MetricKind.DELTA],\n },\n {\n text: 'count false',\n value: 'REDUCE_COUNT_FALSE',\n valueTypes: [ValueTypes.BOOL],\n metricKinds: [MetricKind.GAUGE, MetricKind.DELTA],\n },\n {\n text: '99th percentile',\n value: 'REDUCE_PERCENTILE_99',\n valueTypes: [ValueTypes.INT64, ValueTypes.DOUBLE, ValueTypes.MONEY, ValueTypes.DISTRIBUTION],\n metricKinds: [MetricKind.GAUGE, MetricKind.DELTA, MetricKind.CUMULATIVE],\n },\n {\n text: '95th percentile',\n value: 'REDUCE_PERCENTILE_95',\n valueTypes: [ValueTypes.INT64, ValueTypes.DOUBLE, ValueTypes.MONEY, ValueTypes.DISTRIBUTION],\n metricKinds: [MetricKind.GAUGE, MetricKind.DELTA, MetricKind.CUMULATIVE],\n },\n {\n text: '50th percentile',\n value: 'REDUCE_PERCENTILE_50',\n valueTypes: [ValueTypes.INT64, ValueTypes.DOUBLE, ValueTypes.MONEY, ValueTypes.DISTRIBUTION],\n metricKinds: [MetricKind.GAUGE, MetricKind.DELTA, MetricKind.CUMULATIVE],\n },\n {\n text: '5th percentile',\n value: 'REDUCE_PERCENTILE_05',\n valueTypes: [ValueTypes.INT64, ValueTypes.DOUBLE, ValueTypes.MONEY, ValueTypes.DISTRIBUTION],\n metricKinds: [MetricKind.GAUGE, MetricKind.DELTA, MetricKind.CUMULATIVE],\n },\n];\n\nexport type periodOption = {\n text: string;\n value: string;\n hidden?: boolean;\n};\n\nexport const ALIGNMENT_PERIODS: periodOption[] = [\n { text: 'grafana auto', value: 'grafana-auto' },\n { text: 'stackdriver auto', value: 'stackdriver-auto', hidden: true },\n { text: 'cloud monitoring auto', value: 'cloud-monitoring-auto' },\n { text: '1m', value: '+60s' },\n { text: '2m', value: '+120s' },\n { text: '5m', value: '+300s' },\n { text: '10m', value: '+600s' },\n { text: '30m', value: '+1800s' },\n { text: '1h', value: '+3600s' },\n { text: '3h', value: '+7200s' },\n { text: '6h', value: '+21600s' },\n { text: '1d', value: '+86400s' },\n { text: '3d', value: '+259200s' },\n { text: '1w', value: '+604800s' },\n];\n\nexport const GRAPH_PERIODS: periodOption[] = [\n { text: 'auto', value: 'auto' },\n { text: '1m', value: '1m' },\n { text: '2m', value: '2m' },\n { text: '5m', value: '5m' },\n { text: '10m', value: '10m' },\n { text: '30m', value: '30m' },\n { text: '1h', value: '1h' },\n { text: '3h', value: '3h' },\n { text: '6h', value: '6h' },\n { text: '1d', value: '1d' },\n { text: '3d', value: '3d' },\n { text: '1w', value: '1w' },\n];\n\nexport const SYSTEM_LABELS = [\n 'metadata.system_labels.cloud_account',\n 'metadata.system_labels.name',\n 'metadata.system_labels.region',\n 'metadata.system_labels.state',\n 'metadata.system_labels.instance_group',\n 'metadata.system_labels.node_name',\n 'metadata.system_labels.service_name',\n 'metadata.system_labels.top_level_controller_type',\n 'metadata.system_labels.top_level_controller_name',\n 'metadata.system_labels.container_image',\n];\n\nexport const SELECTORS = [\n { label: 'SLI Value', value: 'select_slo_health' },\n { label: 'SLO Compliance', value: 'select_slo_compliance' },\n { label: 'SLO Error Budget Remaining', value: 'select_slo_budget_fraction' },\n];\n\nexport const QUERY_TYPES = [\n { label: 'Metrics', value: QueryType.METRICS },\n { label: 'Service Level Objectives (SLO)', value: QueryType.SLO },\n];\n","import { chunk, initial, startCase, uniqBy } from 'lodash';\n\nimport { getTemplateSrv, TemplateSrv } from '@grafana/runtime';\n\nimport { AGGREGATIONS, ALIGNMENTS, SYSTEM_LABELS } from './constants';\nimport CloudMonitoringDatasource from './datasource';\nimport { AlignmentTypes, MetricDescriptor, MetricKind, PreprocessorType, ValueTypes } from './types';\n\nconst templateSrv: TemplateSrv = getTemplateSrv();\n\nexport const extractServicesFromMetricDescriptors = (metricDescriptors: MetricDescriptor[]) =>\n uniqBy(metricDescriptors, 'service');\n\nexport const getMetricTypesByService = (metricDescriptors: MetricDescriptor[], service: string) =>\n metricDescriptors.filter((m: MetricDescriptor) => m.service === service);\n\nexport const getMetricTypes = (\n metricDescriptors: MetricDescriptor[],\n metricType: string,\n interpolatedMetricType: string,\n selectedService: string\n) => {\n const metricTypes = getMetricTypesByService(metricDescriptors, selectedService).map((m) => ({\n value: m.type,\n name: m.displayName,\n }));\n const metricTypeExistInArray = metricTypes.some(\n (m: { value: string; name: string }) => m.value === interpolatedMetricType\n );\n const metricTypeByService = metricTypes.length ? metricTypes[0].value : '';\n const selectedMetricType = metricTypeExistInArray ? metricType : metricTypeByService;\n return {\n metricTypes,\n selectedMetricType,\n };\n};\n\nexport const getAlignmentOptionsByMetric = (\n metricValueType: string,\n metricKind: string,\n preprocessor?: PreprocessorType\n) => {\n if (preprocessor && preprocessor === PreprocessorType.Rate) {\n metricKind = MetricKind.GAUGE;\n }\n\n return !metricValueType\n ? []\n : ALIGNMENTS.filter((i) => {\n return (\n i.valueTypes.indexOf(metricValueType as ValueTypes) !== -1 &&\n i.metricKinds.indexOf(metricKind as MetricKind) !== -1\n );\n });\n};\n\nexport const getAggregationOptionsByMetric = (valueType: ValueTypes, metricKind: MetricKind) => {\n return !metricKind\n ? []\n : AGGREGATIONS.filter((i) => {\n return i.valueTypes.indexOf(valueType) !== -1 && i.metricKinds.indexOf(metricKind) !== -1;\n });\n};\n\nexport const getLabelKeys = async (\n datasource: CloudMonitoringDatasource,\n selectedMetricType: string,\n projectName: string\n) => {\n const refId = 'handleLabelKeysQuery';\n const labels = await datasource.getLabels(selectedMetricType, refId, projectName);\n return [...Object.keys(labels), ...SYSTEM_LABELS];\n};\n\nexport const getAlignmentPickerData = (\n valueType: string | undefined = ValueTypes.DOUBLE,\n metricKind: string | undefined = MetricKind.GAUGE,\n perSeriesAligner: string | undefined = AlignmentTypes.ALIGN_MEAN,\n preprocessor?: PreprocessorType\n) => {\n const alignOptions = getAlignmentOptionsByMetric(valueType!, metricKind!, preprocessor!).map((option) => ({\n ...option,\n label: option.text,\n }));\n if (!alignOptions.some((o: { value: string }) => o.value === templateSrv.replace(perSeriesAligner))) {\n perSeriesAligner = alignOptions.length > 0 ? alignOptions[0].value : AlignmentTypes.ALIGN_MEAN;\n }\n return { alignOptions, perSeriesAligner };\n};\n\nexport const labelsToGroupedOptions = (groupBys: string[]) => {\n const groups = groupBys.reduce((acc: any, curr: string) => {\n const arr = curr.split('.').map(startCase);\n const group = (arr.length === 2 ? arr : initial(arr)).join(' ');\n const option = {\n value: curr,\n label: curr,\n };\n if (acc[group]) {\n acc[group] = [...acc[group], option];\n } else {\n acc[group] = [option];\n }\n return acc;\n }, {});\n return Object.entries(groups).map(([label, options]) => ({ label, options, expanded: true }), []);\n};\n\nexport const stringArrayToFilters = (filterArray: string[]) =>\n chunk(filterArray, 4).map(([key, operator, value, condition = 'AND']) => ({\n key,\n operator,\n value,\n condition,\n }));\n","import { DataQuery, DataSourceJsonData, SelectableValue } from '@grafana/data';\nimport { GoogleAuthType } from '@grafana/google-sdk';\n\nexport const authTypes: Array> = [\n { label: 'Google JWT File', value: GoogleAuthType.JWT },\n { label: 'GCE Default Service Account', value: GoogleAuthType.GCE },\n];\n\nexport enum MetricFindQueryTypes {\n Projects = 'projects',\n Services = 'services',\n DefaultProject = 'defaultProject',\n MetricTypes = 'metricTypes',\n LabelKeys = 'labelKeys',\n LabelValues = 'labelValues',\n ResourceTypes = 'resourceTypes',\n Aggregations = 'aggregations',\n Aligners = 'aligners',\n AlignmentPeriods = 'alignmentPeriods',\n Selectors = 'selectors',\n SLOServices = 'sloServices',\n SLO = 'slo',\n}\n\nexport interface CloudMonitoringVariableQuery extends DataQuery {\n selectedQueryType: string;\n selectedService: string;\n selectedMetricType: string;\n selectedSLOService: string;\n labelKey: string;\n projects: SelectableValue[];\n sloServices: SelectableValue[];\n projectName: string;\n}\n\nexport interface VariableQueryData {\n selectedQueryType: string;\n metricDescriptors: MetricDescriptor[];\n selectedService: string;\n selectedMetricType: string;\n selectedSLOService: string;\n labels: string[];\n labelKey: string;\n metricTypes: Array<{ value: string; name: string }>;\n services: SelectableValue[];\n projects: SelectableValue[];\n sloServices: SelectableValue[];\n projectName: string;\n loading: boolean;\n}\n\nexport interface Aggregation {\n crossSeriesReducer?: string;\n groupBys?: string[];\n}\n\nexport enum QueryType {\n METRICS = 'metrics',\n SLO = 'slo',\n}\n\nexport enum EditorMode {\n Visual = 'visual',\n MQL = 'mql',\n}\n\nexport enum PreprocessorType {\n None = 'none',\n Rate = 'rate',\n Delta = 'delta',\n}\n\nexport enum MetricKind {\n METRIC_KIND_UNSPECIFIED = 'METRIC_KIND_UNSPECIFIED',\n GAUGE = 'GAUGE',\n DELTA = 'DELTA',\n CUMULATIVE = 'CUMULATIVE',\n}\n\nexport enum ValueTypes {\n VALUE_TYPE_UNSPECIFIED = 'VALUE_TYPE_UNSPECIFIED',\n BOOL = 'BOOL',\n INT64 = 'INT64',\n DOUBLE = 'DOUBLE',\n STRING = 'STRING',\n DISTRIBUTION = 'DISTRIBUTION',\n MONEY = 'MONEY',\n}\n\nexport enum AlignmentTypes {\n ALIGN_DELTA = 'ALIGN_DELTA',\n ALIGN_RATE = 'ALIGN_RATE',\n ALIGN_INTERPOLATE = 'ALIGN_INTERPOLATE',\n ALIGN_NEXT_OLDER = 'ALIGN_NEXT_OLDER',\n ALIGN_MIN = 'ALIGN_MIN',\n ALIGN_MAX = 'ALIGN_MAX',\n ALIGN_MEAN = 'ALIGN_MEAN',\n ALIGN_COUNT = 'ALIGN_COUNT',\n ALIGN_SUM = 'ALIGN_SUM',\n ALIGN_STDDEV = 'ALIGN_STDDEV',\n ALIGN_COUNT_TRUE = 'ALIGN_COUNT_TRUE',\n ALIGN_COUNT_FALSE = 'ALIGN_COUNT_FALSE',\n ALIGN_FRACTION_TRUE = 'ALIGN_FRACTION_TRUE',\n ALIGN_PERCENTILE_99 = 'ALIGN_PERCENTILE_99',\n ALIGN_PERCENTILE_95 = 'ALIGN_PERCENTILE_95',\n ALIGN_PERCENTILE_50 = 'ALIGN_PERCENTILE_50',\n ALIGN_PERCENTILE_05 = 'ALIGN_PERCENTILE_05',\n ALIGN_PERCENT_CHANGE = 'ALIGN_PERCENT_CHANGE',\n ALIGN_NONE = 'ALIGN_NONE',\n}\n\nexport interface BaseQuery {\n projectName: string;\n perSeriesAligner?: string;\n alignmentPeriod?: string;\n aliasBy?: string;\n}\n\nexport interface MetricQuery extends BaseQuery {\n editorMode: EditorMode;\n metricType: string;\n crossSeriesReducer: string;\n groupBys?: string[];\n filters?: string[];\n metricKind?: MetricKind;\n valueType?: string;\n view?: string;\n query: string;\n preprocessor?: PreprocessorType;\n // To disable the graphPeriod, it should explictly be set to 'disabled'\n graphPeriod?: 'disabled' | string;\n}\n\nexport interface AnnotationMetricQuery extends MetricQuery {\n title?: string;\n text?: string;\n}\n\nexport interface SLOQuery extends BaseQuery {\n selectorName: string;\n serviceId: string;\n serviceName: string;\n sloId: string;\n sloName: string;\n goal?: number;\n}\n\nexport interface CloudMonitoringQuery extends DataQuery {\n datasourceId?: number; // Should not be necessary anymore\n queryType: QueryType;\n metricQuery: MetricQuery | AnnotationMetricQuery;\n sloQuery?: SLOQuery;\n intervalMs: number;\n type: string;\n}\n\nexport interface CloudMonitoringOptions extends DataSourceJsonData {\n defaultProject?: string;\n gceDefaultProject?: string;\n authenticationType: GoogleAuthType;\n clientEmail?: string;\n tokenUri?: string;\n}\n\nexport interface CloudMonitoringSecureJsonData {\n privateKey?: string;\n}\n\nexport interface LegacyCloudMonitoringAnnotationQuery {\n projectName: string;\n metricType: string;\n refId: string;\n filters: string[];\n metricKind: MetricKind;\n valueType: string;\n title: string;\n text: string;\n}\n\nexport interface QueryMeta {\n alignmentPeriod: string;\n rawQuery: string;\n rawQueryString: string;\n metricLabels: { [key: string]: string[] };\n resourceLabels: { [key: string]: string[] };\n resourceTypes: string[];\n}\n\nexport interface MetricDescriptor {\n valueType: string;\n metricKind: MetricKind;\n type: string;\n unit: string;\n service: string;\n serviceShortName: string;\n displayName: string;\n description: string;\n}\n\nexport interface Segment {\n type: string;\n value: string;\n}\n\nexport interface Filter {\n key: string;\n operator: string;\n value: string;\n condition?: string;\n}\n\nexport interface CustomMetaData {\n perSeriesAligner?: string;\n alignmentPeriod?: string;\n}\n\nexport interface PostResponse {\n results: Record;\n}\n","Object.defineProperty(exports,\"__esModule\",{value:!0});var e=require(\"@grafana/data\"),t=require(\"@grafana/ui\"),a=require(\"react\"),n=require(\"lodash\");function l(e){return e&&\"object\"==typeof e&&\"default\"in e?e:{default:e}}var o=l(a),r=function(){return r=Object.assign||function(e){for(var t,a=1,n=arguments.length;a0)&&!(n=o.next()).done;)r.push(n.value)}catch(e){l={error:e}}finally{try{n&&!n.done&&(a=o.return)&&a.call(o)}finally{if(l)throw l.error}}return r}var u,c=\"Configuration help box\",d=\"Configuration drop zone\",f=\"Configuration text area\",s=\"Paste JWT button\",p=\"Reset JWT button\",m=\"JWT form\",y=\"JWT button\",h=\"GCE button\",v=[\"private_key\",\"token_uri\",\"client_email\",\"project_id\"],g=function(e){var n=e.onChange,l=i(a.useState(),2),r=l[0],u=l[1],c=i(a.useState(null),2),p=c[0],m=c[1],y=t.useTheme2(),h=a.useCallback((function(e){u(null),m(!0)}),[m]),v=a.useCallback((function(e){m(null),u(null)}),[m]),g=a.useCallback((function(e){if(\"\"!==e.trim()){var t=void 0;try{t=JSON.parse(e)}catch(e){u(\"Invalid JWT token\")}var a=E(t);a.isValid?n({privateKey:t.private_key,tokenUri:t.token_uri,clientEmail:t.client_email,projectId:t.project_id}):u(a.error)}}),[u,n]);return o.default.createElement(o.default.Fragment,null,o.default.createElement(t.Field,{label:\"JWT token\",invalid:Boolean(r),description:p?\"Paste JWT token below\":\"Upload or paste Google JWT token\",error:r},o.default.createElement(o.default.Fragment,null,!0!==p&&o.default.createElement(\"div\",{\"data-testid\":d},o.default.createElement(t.FileDropzone,{options:{multiple:!1,accept:\"application/json\"},readAs:\"readAsText\",onLoad:function(e){g(e),m(!1)}},o.default.createElement(\"p\",{style:{margin:0,fontSize:\"\"+y.typography.h4.fontSize,textAlign:\"center\"}},\"Drop the Google JWT file here\",o.default.createElement(\"br\",null),o.default.createElement(\"br\",null),o.default.createElement(t.LinkButton,{fill:\"outline\"},\"Click to browse files\")))),p&&o.default.createElement(t.TextArea,{\"data-testid\":f,autoFocus:!0,invalid:Boolean(r),placeholder:\"Paste Google JWT token here\",onBlur:function(e){return g(e.currentTarget.value)},rows:12}))),!p&&o.default.createElement(t.Field,null,o.default.createElement(t.Button,{\"data-testid\":s,type:\"button\",fill:\"outline\",style:{color:\"\"+y.colors.primary.text},onClick:h},\"Paste JWT Token\")),p&&r&&o.default.createElement(t.Field,null,o.default.createElement(t.Button,{type:\"button\",fill:\"outline\",style:{color:\"\"+y.colors.primary.text},onClick:v},\"Upload JWT Token\")))},E=function(e){if(!n.isObject(e))return{isValid:!1,error:\"Invalid JWT token\"};var t=v.filter((function(t){return!e[t]}));return t.length>0?{isValid:!1,error:\"Missing keys: \"+t.join(\", \")}:{isValid:!0}},T=function(e){var a=e.options,n=e.onReset,l=e.onChange;return o.default.createElement(\"div\",{\"data-testid\":m},o.default.createElement(t.Field,{label:\"Project ID\"},o.default.createElement(t.Input,{id:\"defaultProject\",width:60,value:a.defaultProject||\"\",onChange:l(\"defaultProject\")})),o.default.createElement(t.Field,{label:\"Client email\"},o.default.createElement(t.Input,{width:60,id:\"clientEmail\",value:a.clientEmail||\"\",onChange:l(\"clientEmail\")})),o.default.createElement(t.Field,{label:\"Token URI\"},o.default.createElement(t.Input,{width:60,id:\"tokenUri\",value:a.tokenUri||\"\",onChange:l(\"tokenUri\")})),o.default.createElement(t.Field,{label:\"Private key\",disabled:!0},o.default.createElement(t.Input,{width:60,id:\"privateKey\",readOnly:!0,placeholder:\"Private key configured\",addonAfter:o.default.createElement(t.Tooltip,{content:\"Click to clear the uploaded JWT token and upload a new one\"},o.default.createElement(t.Button,{\"data-testid\":p,icon:\"sync\",size:\"xs\",onClick:function(){return n(null)},fill:\"outline\"},\"Reset token\"))})))};exports.GoogleAuthType=void 0,(u=exports.GoogleAuthType||(exports.GoogleAuthType={})).JWT=\"jwt\",u.GCE=\"gce\";var k=[{label:\"Google JWT File\",value:exports.GoogleAuthType.JWT,ariaLabel:y},{label:\"GCE Default Service Account\",value:exports.GoogleAuthType.GCE,ariaLabel:h}];exports.ConnectionConfig=function(a){var n=a.options,l=a.onOptionsChange,i=n.jsonData,u=n.secureJsonFields,d=n.secureJsonData;i.authenticationType||(i.authenticationType=exports.GoogleAuthType.JWT);var f=i.authenticationType===exports.GoogleAuthType.JWT||void 0===i.authenticationType,s=Boolean(u&&u.privateKey&&i.clientEmail&&i.defaultProject&&i.tokenUri);return o.default.createElement(o.default.Fragment,null,o.default.createElement(t.FieldSet,{label:\"Authentication\"},o.default.createElement(t.Field,{label:\"Authentication type\"},o.default.createElement(t.RadioButtonGroup,{options:k,value:i.authenticationType||exports.GoogleAuthType.JWT,onChange:function(e){l(r(r({},n),{jsonData:r(r({},n.jsonData),{authenticationType:e})}))}}))),f&&o.default.createElement(t.FieldSet,{label:\"JWT Key Details\"},s?o.default.createElement(T,{options:n.jsonData,onReset:function(e){var t=r({},d),a=e?r(r({},n.jsonData),e):r({},n.jsonData);delete a.clientEmail,delete a.defaultProject,delete a.tokenUri,delete t.privateKey,l(r(r({},n),{secureJsonData:t,jsonData:a}))},onChange:function(t){return e.onUpdateDatasourceJsonDataOption(a,t)}}):o.default.createElement(g,{onChange:function(e){l(r(r({},n),{secureJsonFields:r(r({},u),{privateKey:!0}),secureJsonData:r(r({},d),{privateKey:e.privateKey}),jsonData:r(r({},i),{clientEmail:e.clientEmail,defaultProject:e.projectId,tokenUri:e.tokenUri})}))}}),\" \"),o.default.createElement(\"div\",{className:\"grafana-info-box\",style:{marginTop:\"16px\"},\"data-testid\":c},o.default.createElement(\"p\",null,\"Don’t know how to get a service account key file or create a service account? Read more\",\" \",o.default.createElement(\"a\",{className:\"external-link\",target:\"_blank\",rel:\"noopener noreferrer\",href:\"https://grafana.com/docs/grafana/latest/datasources/google-cloud-monitoring/google-authentication/\"},\"in the documentation.\"))),!f&&o.default.createElement(t.Alert,{title:\"\",severity:\"info\"},\"Verify GCE default service account by clicking Save & Test\"))};\n//# sourceMappingURL=index.production.js.map\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./dist/index.production.js');\n} else {\n module.exports = require('./dist/index.development.js');\n}\n"],"names":["MQLQueryEditor","query","onChange","onRunQuery","TextArea","name","className","value","rows","placeholder","onBlur","e","currentTarget","onKeyDown","event","key","shiftKey","ctrlKey","preventDefault","GraphPeriod","refId","graphPeriod","variableOptionGroup","label","htmlFor","tooltip","Switch","checked","inputId","templateVariableOptions","options","current","selectWidth","SELECT_WIDTH","disabled","aligmentPeriods","GRAPH_PERIODS","defaultState","labels","defaultQuery","dataSource","editorMode","EditorMode","projectName","getDefaultProject","metricType","metricKind","MetricKind","valueType","crossSeriesReducer","alignmentPeriod","perSeriesAligner","AlignmentTypes","groupBys","filters","aliasBy","preprocessor","PreprocessorType","Editor","datasource","onQueryChange","customMetaData","state","setState","useState","useEffect","getLabels","then","prevState","useCallback","metricQuery","onMetricTypeChange","type","ValueTypes","getAlignmentPickerData","q","MetricQueryEditor","React","QueryEditor","PureComponent","this","props","hasOwnProperty","queryType","QueryType","ensureGCEDefaultProject","prop","render","sloQuery","defaultSLOQuery","meta","data","series","length","custom","expanded","getVariables","map","toOption","fillComponent","Button","variant","css","icon","onClick","Select","width","QUERY_TYPES","Service","services","setServices","getSLOServices","allowCustomValue","serviceId","serviceName","sloId","SLO","slos","setSLOs","getServiceLevelObjectives","sloIds","sloName","async","slo","find","templateSrv","replace","goal","Selector","SELECTORS","s","selectorName","SLOQueryEditor","period","ALIGNMENT_PERIODS","Project","projects","setProjects","getProjects","projectsWithTemplateVariables","useMemo","QueryEditorRow","formatCreateLabel","v","Metrics","metricDescriptors","metrics","service","metric","theme","useTheme2","selectStyles","getSelectStyles","customStyle","useStyles2","getStyles","children","getSelectedMetricDescriptor","md","getMetricTypes","getServicesList","selectedMetricDescriptor","filter","m","displayName","component","optionDescription","description","getMetricsList","metricDescriptor","loadMetricDescriptors","extra","startCase","serviceShortName","uniqBy","QueryEditorField","labelWidth","LABEL_WIDTH","some","INNER_LABEL_WIDTH","colors","text","secondary","GroupBy","labelsToGroupedOptions","SYSTEM_LABELS","MultiSelect","INPUT_WIDTH","o","Aggregation","Alignment","AlignmentPeriodLabel","AlignmentFunction","PeriodSelect","operators","FilterButton","ref","rest","OperatorButton","LabelFilter","filterArray","stringArrayToFilters","Object","keys","filtersToStringArray","strArr","flatten","operator","condition","slice","AddFilter","menuPlacement","renderControl","noFillEnd","VerticalGroup","spacing","index","op","opp","push","valueOptions","HorizontalGroup","f","i","size","_","values","every","AnnotationsHelp","psa","alignOptions","formatAlignmentText","alignment","ALIGNMENTS","ap","seconds","parseInt","rangeUtil","AliasBy","alias","setAlias","propagateOnChange","debounce","target","Input","id","aggOptions","useAggregationOptionsByMetric","selected","useSelectedFromOptions","getAggregationOptionsByMetric","a","VariableQueryField","InlineField","InlineLabel","Preprocessor","VisualMetricQueryEditor","visibleOptions","hidden","NONE_OPTION","useOptions","RadioButtonGroup","GoogleAuthType","valueTypes","metricKinds","AGGREGATIONS","getTemplateSrv","extractServicesFromMetricDescriptors","getMetricTypesByService","interpolatedMetricType","selectedService","metricTypes","metricTypeExistInArray","metricTypeByService","selectedMetricType","getAlignmentOptionsByMetric","metricValueType","indexOf","getLabelKeys","option","groups","reduce","acc","curr","arr","split","group","initial","join","entries","chunk","MetricFindQueryTypes","t","n","default","l","r","assign","arguments","prototype","call","apply","Symbol","iterator","next","done","error","return","u","g","c","p","y","h","trim","JSON","parse","E","isValid","privateKey","private_key","tokenUri","token_uri","clientEmail","client_email","projectId","project_id","createElement","Fragment","Field","invalid","Boolean","FileDropzone","multiple","accept","readAs","onLoad","style","margin","fontSize","typography","h4","textAlign","LinkButton","fill","autoFocus","color","primary","isObject","T","onReset","defaultProject","readOnly","addonAfter","Tooltip","content","exports","JWT","GCE","k","ariaLabel","ConnectionConfig","onOptionsChange","jsonData","secureJsonFields","d","secureJsonData","authenticationType","FieldSet","onUpdateDatasourceJsonDataOption","marginTop","rel","href","Alert","title","severity","module"],"sourceRoot":""}