@perses-dev/prometheus-plugin 0.51.0 → 0.52.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/__mf/js/{622.81d47848.js → 622.a776ec11.js} +1 -1
- package/__mf/js/{Prometheus.ce1e9458.js → Prometheus.c57c8a9f.js} +3 -3
- package/__mf/js/async/{5345.2e531d76.js → 5345.1f4fc17b.js} +1 -1
- package/__mf/js/async/{5503.d391f0fc.js → 5503.daedd4dd.js} +1 -1
- package/__mf/js/async/{__federation_expose_PrometheusExplorer.3f83dfda.js → __federation_expose_PrometheusExplorer.171d04eb.js} +1 -1
- package/__mf/js/async/__federation_expose_PrometheusTimeSeriesQuery.fc3c5730.js +1 -0
- package/__mf/js/{main.02b2cf43.js → main.9866e9bf.js} +1 -1
- package/lib/cjs/components/PromQLEditor.js +1 -1
- package/lib/cjs/components/TreeNode.js +1 -2
- package/lib/cjs/explore/PrometheusMetricsFinder/filter/FinderFilters.js +1 -1
- package/lib/cjs/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.js +2 -2
- package/lib/cjs/plugins/prometheus-time-series-query/get-time-series-data.js +8 -0
- package/lib/components/PromQLEditor.js +1 -1
- package/lib/components/PromQLEditor.js.map +1 -1
- package/lib/components/TreeNode.js +1 -2
- package/lib/components/TreeNode.js.map +1 -1
- package/lib/explore/PrometheusMetricsFinder/filter/FinderFilters.js +1 -1
- package/lib/explore/PrometheusMetricsFinder/filter/FinderFilters.js.map +1 -1
- package/lib/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.js +2 -2
- package/lib/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.js.map +1 -1
- package/lib/plugins/prometheus-time-series-query/get-time-series-data.d.ts.map +1 -1
- package/lib/plugins/prometheus-time-series-query/get-time-series-data.js +8 -0
- package/lib/plugins/prometheus-time-series-query/get-time-series-data.js.map +1 -1
- package/lib/plugins/prometheus-time-series-query/query-editor-model.d.ts +1 -1
- package/lib/plugins/prometheus-time-series-query/query-editor-model.d.ts.map +1 -1
- package/lib/plugins/prometheus-time-series-query/query-editor-model.js.map +1 -1
- package/mf-manifest.json +28 -28
- package/mf-stats.json +31 -31
- package/package.json +1 -1
- package/__mf/js/async/__federation_expose_PrometheusTimeSeriesQuery.b4228802.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/explore/PrometheusMetricsFinder/filter/FinderFilters.tsx"],"sourcesContent":["// Copyright 2024 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Button, FormControl, Stack, StackProps } from '@mui/material';\nimport { DatasourceSelector } from '@perses-dev/core';\nimport {\n DatasourceSelect,\n DatasourceSelectValue,\n datasourceSelectValueToSelector,\n useListDatasourceSelectItems,\n} from '@perses-dev/plugin-system';\nimport PlusIcon from 'mdi-material-ui/Plus';\nimport { ReactElement } from 'react';\nimport { PROM_DATASOURCE_KIND } from '../../../model/prometheus-selectors';\nimport { LabelFilter } from '../types';\nimport { LabelFilterInput } from './FilterInputs';\n\nexport interface ExplorerFiltersProps extends StackProps {\n datasource: DatasourceSelector;\n filters: LabelFilter[];\n filteredFilters: LabelFilter[];\n onDatasourceChange: (next: DatasourceSelector) => void;\n onFiltersChange: (next: LabelFilter[]) => void;\n}\n\nexport function FinderFilters({\n datasource,\n filters,\n filteredFilters,\n onDatasourceChange,\n onFiltersChange,\n ...props\n}: ExplorerFiltersProps): ReactElement {\n const { data } = useListDatasourceSelectItems(PROM_DATASOURCE_KIND);\n function handleDatasourceChange(next: DatasourceSelectValue): void {\n const datasourceSelector = datasourceSelectValueToSelector(next, {}, data) ?? { kind: PROM_DATASOURCE_KIND };\n onDatasourceChange(datasourceSelector);\n }\n\n return (\n <Stack {...props} direction=\"row\" alignItems=\"center\" flexWrap=\"wrap\" gap={1} sx={{ width: '100%' }}>\n <FormControl sx={{ width:
|
|
1
|
+
{"version":3,"sources":["../../../../../src/explore/PrometheusMetricsFinder/filter/FinderFilters.tsx"],"sourcesContent":["// Copyright 2024 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Button, FormControl, Stack, StackProps } from '@mui/material';\nimport { DatasourceSelector } from '@perses-dev/core';\nimport {\n DatasourceSelect,\n DatasourceSelectValue,\n datasourceSelectValueToSelector,\n useListDatasourceSelectItems,\n} from '@perses-dev/plugin-system';\nimport PlusIcon from 'mdi-material-ui/Plus';\nimport { ReactElement } from 'react';\nimport { PROM_DATASOURCE_KIND } from '../../../model/prometheus-selectors';\nimport { LabelFilter } from '../types';\nimport { LabelFilterInput } from './FilterInputs';\n\nexport interface ExplorerFiltersProps extends StackProps {\n datasource: DatasourceSelector;\n filters: LabelFilter[];\n filteredFilters: LabelFilter[];\n onDatasourceChange: (next: DatasourceSelector) => void;\n onFiltersChange: (next: LabelFilter[]) => void;\n}\n\nexport function FinderFilters({\n datasource,\n filters,\n filteredFilters,\n onDatasourceChange,\n onFiltersChange,\n ...props\n}: ExplorerFiltersProps): ReactElement {\n const { data } = useListDatasourceSelectItems(PROM_DATASOURCE_KIND);\n function handleDatasourceChange(next: DatasourceSelectValue): void {\n const datasourceSelector = datasourceSelectValueToSelector(next, {}, data) ?? { kind: PROM_DATASOURCE_KIND };\n onDatasourceChange(datasourceSelector);\n }\n\n return (\n <Stack {...props} direction=\"row\" alignItems=\"center\" flexWrap=\"wrap\" gap={1} sx={{ width: '100%' }}>\n <FormControl sx={{ width: 500 }}>\n <DatasourceSelect\n size=\"medium\"\n datasourcePluginKind={PROM_DATASOURCE_KIND}\n value={datasource}\n onChange={handleDatasourceChange}\n label=\"Prometheus Datasource\"\n fullWidth={true}\n />\n </FormControl>\n {filters.map((filter, index) => (\n <LabelFilterInput\n key={index}\n datasource={datasource}\n filters={filteredFilters}\n value={filter}\n onChange={(next) => {\n const nextFilters = [...filters];\n nextFilters[index] = next;\n onFiltersChange(nextFilters);\n }}\n onDelete={() => {\n const nextFilters = [...filters];\n nextFilters.splice(index, 1);\n onFiltersChange(nextFilters);\n }}\n />\n ))}\n <Button\n startIcon={<PlusIcon />}\n aria-label=\"add filter\"\n onClick={() => {\n onFiltersChange([...filters, { label: '', labelValues: [''], operator: '=' }]);\n }}\n >\n Add filter\n </Button>\n </Stack>\n );\n}\n"],"names":["Button","FormControl","Stack","DatasourceSelect","datasourceSelectValueToSelector","useListDatasourceSelectItems","PlusIcon","PROM_DATASOURCE_KIND","LabelFilterInput","FinderFilters","datasource","filters","filteredFilters","onDatasourceChange","onFiltersChange","props","data","handleDatasourceChange","next","datasourceSelector","kind","direction","alignItems","flexWrap","gap","sx","width","size","datasourcePluginKind","value","onChange","label","fullWidth","map","filter","index","nextFilters","onDelete","splice","startIcon","aria-label","onClick","labelValues","operator"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,MAAM,EAAEC,WAAW,EAAEC,KAAK,QAAoB,gBAAgB;AAEvE,SACEC,gBAAgB,EAEhBC,+BAA+B,EAC/BC,4BAA4B,QACvB,4BAA4B;AACnC,OAAOC,cA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88,8 @@ import { useQueryState, useFormatState, useMinStepState } from './query-editor-m
|
|
|
88
88
|
label: "Min Step",
|
|
89
89
|
placeholder: minStepPlaceholder,
|
|
90
90
|
helperText: "Lower bound for the step. If not provided, the scrape interval of the datasource is used.",
|
|
91
|
-
value: minStep,
|
|
92
|
-
onChange: (e)=>handleMinStepChange(e.target.value),
|
|
91
|
+
value: minStep ?? '',
|
|
92
|
+
onChange: (e)=>handleMinStepChange(e.target.value ? e.target.value : undefined),
|
|
93
93
|
onBlur: handleMinStepBlur,
|
|
94
94
|
sx: {
|
|
95
95
|
width: '250px'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { produce } from 'immer';\nimport {\n DatasourceSelect,\n DatasourceSelectProps,\n useDatasource,\n useDatasourceClient,\n useDatasourceSelectValueToSelector,\n} from '@perses-dev/plugin-system';\nimport { useId } from '@perses-dev/components';\nimport { FormControl, Stack, TextField } from '@mui/material';\nimport { ReactElement } from 'react';\nimport {\n DEFAULT_PROM,\n DurationString,\n isDefaultPromSelector,\n isPrometheusDatasourceSelector,\n PROM_DATASOURCE_KIND,\n PrometheusClient,\n PrometheusDatasourceSelector,\n} from '../../model';\nimport { DEFAULT_SCRAPE_INTERVAL, PrometheusDatasourceSpec } from '../types';\nimport { PromQLEditor } from '../../components';\nimport {\n PrometheusTimeSeriesQueryEditorProps,\n useQueryState,\n useFormatState,\n useMinStepState,\n} from './query-editor-model';\n\n/**\n * The options editor component for editing a PrometheusTimeSeriesQuery's spec.\n */\nexport function PrometheusTimeSeriesQueryEditor(props: PrometheusTimeSeriesQueryEditorProps): ReactElement {\n const { onChange, value } = props;\n const { datasource } = value;\n const datasourceSelectValue = datasource ?? DEFAULT_PROM;\n\n const datasourceSelectLabelID = useId('prom-datasource-label'); // for panels with multiple queries, this component is rendered multiple times on the same page\n\n const selectedDatasource = useDatasourceSelectValueToSelector(\n datasourceSelectValue,\n PROM_DATASOURCE_KIND\n ) as PrometheusDatasourceSelector;\n\n const { data: client } = useDatasourceClient<PrometheusClient>(selectedDatasource);\n const promURL = client?.options.datasourceUrl;\n const { data: datasourceResource } = useDatasource(selectedDatasource);\n\n const { handleQueryChange, handleQueryBlur } = useQueryState(props);\n const { format, handleFormatChange, handleFormatBlur } = useFormatState(props);\n const { minStep, handleMinStepChange, handleMinStepBlur } = useMinStepState(props);\n const minStepPlaceholder =\n minStep ??\n (datasourceResource && (datasourceResource?.plugin.spec as PrometheusDatasourceSpec).scrapeInterval) ??\n DEFAULT_SCRAPE_INTERVAL;\n\n const handleDatasourceChange: DatasourceSelectProps['onChange'] = (next) => {\n if (isPrometheusDatasourceSelector(next)) {\n onChange(\n produce(value, (draft) => {\n // If they're using the default, just omit the datasource prop (i.e. set to undefined)\n const nextDatasource = isDefaultPromSelector(next) ? undefined : next;\n draft.datasource = nextDatasource;\n })\n );\n return;\n }\n\n throw new Error('Got unexpected non-Prometheus datasource selector');\n };\n\n return (\n <Stack spacing={2}>\n <FormControl margin=\"dense\" fullWidth={false}>\n <DatasourceSelect\n datasourcePluginKind={PROM_DATASOURCE_KIND}\n value={datasourceSelectValue}\n onChange={handleDatasourceChange}\n labelId={datasourceSelectLabelID}\n label=\"Prometheus Datasource\"\n notched\n />\n </FormControl>\n <PromQLEditor\n completeConfig={{ remote: { url: promURL } }}\n value={value.query} // here we are passing `value.query` and not `query` from useQueryState in order to get updates only on onBlur events\n datasource={selectedDatasource}\n onChange={handleQueryChange}\n onBlur={handleQueryBlur}\n />\n <Stack direction=\"row\" spacing={2}>\n <TextField\n fullWidth\n label=\"Legend\"\n placeholder=\"Example: '{{instance}}' will generate series names like 'webserver-123', 'webserver-456'...\"\n helperText=\"Text to be displayed in the legend and the tooltip. Use {{label_name}} to interpolate label values.\"\n value={format ?? ''}\n onChange={(e) => handleFormatChange(e.target.value)}\n onBlur={handleFormatBlur}\n />\n <TextField\n label=\"Min Step\"\n placeholder={minStepPlaceholder}\n helperText=\"Lower bound for the step. If not provided, the scrape interval of the datasource is used.\"\n value={minStep}\n onChange={(e) => handleMinStepChange(e.target.value as DurationString)}\n onBlur={handleMinStepBlur}\n sx={{ width: '250px' }}\n />\n </Stack>\n </Stack>\n );\n}\n"],"names":["produce","DatasourceSelect","useDatasource","useDatasourceClient","useDatasourceSelectValueToSelector","useId","FormControl","Stack","TextField","DEFAULT_PROM","isDefaultPromSelector","isPrometheusDatasourceSelector","PROM_DATASOURCE_KIND","DEFAULT_SCRAPE_INTERVAL","PromQLEditor","useQueryState","useFormatState","useMinStepState","PrometheusTimeSeriesQueryEditor","props","onChange","value","datasource","datasourceSelectValue","datasourceSelectLabelID","selectedDatasource","data","client","promURL","options","datasourceUrl","datasourceResource","handleQueryChange","handleQueryBlur","format","handleFormatChange","handleFormatBlur","minStep","handleMinStepChange","handleMinStepBlur","minStepPlaceholder","plugin","spec","scrapeInterval","handleDatasourceChange","next","draft","nextDatasource","undefined","Error","spacing","margin","fullWidth","datasourcePluginKind","labelId","label","notched","completeConfig","remote","url","query","onBlur","direction","placeholder","helperText","e","target","sx","width"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,OAAO,QAAQ,QAAQ;AAChC,SACEC,gBAAgB,EAEhBC,aAAa,EACbC,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mC,QAAQG,YAAYH;gBACjEC,MAAMxB,UAAU,GAAGyB;YACrB;YAEF;QACF;QAEA,MAAM,IAAIE,MAAM;IAClB;IAEA,qBACE,MAAC1C;QAAM2C,SAAS;;0BACd,KAAC5C;gBAAY6C,QAAO;gBAAQC,WAAW;0BACrC,cAAA,KAACnD;oBACCoD,sBAAsBzC;oBACtBS,OAAOE;oBACPH,UAAUwB;oBACVU,SAAS9B;oBACT+B,OAAM;oBACNC,OAAO;;;0BAGX,KAAC1C;gBACC2C,gBAAgB;oBAAEC,QAAQ;wBAAEC,KAAK/B;oBAAQ;gBAAE;gBAC3CP,OAAOA,MAAMuC,KAAK;gBAClBtC,YAAYG;gBACZL,UAAUY;gBACV6B,QAAQ5B;;0BAEV,MAAC1B;gBAAMuD,WAAU;gBAAMZ,SAAS;;kCAC9B,KAAC1C;wBACC4C,SAAS;wBACTG,OAAM;wBACNQ,aAAY;wBACZC,YAAW;wBACX3C,OAAOa,UAAU;wBACjBd,UAAU,CAAC6C,IAAM9B,mBAAmB8B,EAAEC,MAAM,CAAC7C,KAAK;wBAClDwC,QAAQzB;;kCAEV,KAAC5B;wBACC+C,OAAM;wBACNQ,aAAavB;wBACbwB,YAAW;wBACX3C,OAAOgB;
|
|
1
|
+
{"version":3,"sources":["../../../../src/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { produce } from 'immer';\nimport {\n DatasourceSelect,\n DatasourceSelectProps,\n useDatasource,\n useDatasourceClient,\n useDatasourceSelectValueToSelector,\n} from '@perses-dev/plugin-system';\nimport { useId } from '@perses-dev/components';\nimport { FormControl, Stack, TextField } from '@mui/material';\nimport { ReactElement } from 'react';\nimport {\n DEFAULT_PROM,\n DurationString,\n isDefaultPromSelector,\n isPrometheusDatasourceSelector,\n PROM_DATASOURCE_KIND,\n PrometheusClient,\n PrometheusDatasourceSelector,\n} from '../../model';\nimport { DEFAULT_SCRAPE_INTERVAL, PrometheusDatasourceSpec } from '../types';\nimport { PromQLEditor } from '../../components';\nimport {\n PrometheusTimeSeriesQueryEditorProps,\n useQueryState,\n useFormatState,\n useMinStepState,\n} from './query-editor-model';\n\n/**\n * The options editor component for editing a PrometheusTimeSeriesQuery's spec.\n */\nexport function PrometheusTimeSeriesQueryEditor(props: PrometheusTimeSeriesQueryEditorProps): ReactElement {\n const { onChange, value } = props;\n const { datasource } = value;\n const datasourceSelectValue = datasource ?? DEFAULT_PROM;\n\n const datasourceSelectLabelID = useId('prom-datasource-label'); // for panels with multiple queries, this component is rendered multiple times on the same page\n\n const selectedDatasource = useDatasourceSelectValueToSelector(\n datasourceSelectValue,\n PROM_DATASOURCE_KIND\n ) as PrometheusDatasourceSelector;\n\n const { data: client } = useDatasourceClient<PrometheusClient>(selectedDatasource);\n const promURL = client?.options.datasourceUrl;\n const { data: datasourceResource } = useDatasource(selectedDatasource);\n\n const { handleQueryChange, handleQueryBlur } = useQueryState(props);\n const { format, handleFormatChange, handleFormatBlur } = useFormatState(props);\n const { minStep, handleMinStepChange, handleMinStepBlur } = useMinStepState(props);\n const minStepPlaceholder =\n minStep ??\n (datasourceResource && (datasourceResource?.plugin.spec as PrometheusDatasourceSpec).scrapeInterval) ??\n DEFAULT_SCRAPE_INTERVAL;\n\n const handleDatasourceChange: DatasourceSelectProps['onChange'] = (next) => {\n if (isPrometheusDatasourceSelector(next)) {\n onChange(\n produce(value, (draft) => {\n // If they're using the default, just omit the datasource prop (i.e. set to undefined)\n const nextDatasource = isDefaultPromSelector(next) ? undefined : next;\n draft.datasource = nextDatasource;\n })\n );\n return;\n }\n\n throw new Error('Got unexpected non-Prometheus datasource selector');\n };\n\n return (\n <Stack spacing={2}>\n <FormControl margin=\"dense\" fullWidth={false}>\n <DatasourceSelect\n datasourcePluginKind={PROM_DATASOURCE_KIND}\n value={datasourceSelectValue}\n onChange={handleDatasourceChange}\n labelId={datasourceSelectLabelID}\n label=\"Prometheus Datasource\"\n notched\n />\n </FormControl>\n <PromQLEditor\n completeConfig={{ remote: { url: promURL } }}\n value={value.query} // here we are passing `value.query` and not `query` from useQueryState in order to get updates only on onBlur events\n datasource={selectedDatasource}\n onChange={handleQueryChange}\n onBlur={handleQueryBlur}\n />\n <Stack direction=\"row\" spacing={2}>\n <TextField\n fullWidth\n label=\"Legend\"\n placeholder=\"Example: '{{instance}}' will generate series names like 'webserver-123', 'webserver-456'...\"\n helperText=\"Text to be displayed in the legend and the tooltip. Use {{label_name}} to interpolate label values.\"\n value={format ?? ''}\n onChange={(e) => handleFormatChange(e.target.value)}\n onBlur={handleFormatBlur}\n />\n <TextField\n label=\"Min Step\"\n placeholder={minStepPlaceholder}\n helperText=\"Lower bound for the step. If not provided, the scrape interval of the datasource is used.\"\n value={minStep ?? ''}\n onChange={(e) => handleMinStepChange(e.target.value ? (e.target.value as DurationString) : undefined)}\n onBlur={handleMinStepBlur}\n sx={{ width: '250px' }}\n />\n </Stack>\n </Stack>\n );\n}\n"],"names":["produce","DatasourceSelect","useDatasource","useDatasourceClient","useDatasourceSelectValueToSelector","useId","FormControl","Stack","TextField","DEFAULT_PROM","isDefaultPromSelector","isPrometheusDatasourceSelector","PROM_DATASOURCE_KIND","DEFAULT_SCRAPE_INTERVAL","PromQLEditor","useQueryState","useFormatState","useMinStepState","PrometheusTimeSeriesQueryEditor","props","onChange","value","datasource","datasourceSelectValue","datasourceSelectLabelID","selectedDatasource","data","client","promURL","options","datasourceUrl","datasourceResource","handleQueryChange","handleQueryBlur","format","handleFormatChange","handleFormatBlur","minStep","handleMinStepChange","handleMinStepBlur","minStepPlaceholder","plugin","spec","scrapeInterval","handleDatasourceChange","next","draft","nextDatasource","undefined","Error","spacing","margin","fullWidth","datasourcePluginKind","labelId","label","notched","completeConfig","remote","url","query","onBlur","direction","placeholder","helperText","e","target","sx","width"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,OAAO,QAAQ,QAAQ;AAChC,SACEC,gBAAgB,EAEhBC,aAAa,EACbC,mBAAmB,EACnBC,kCAAkC,QAC7B,4BAA4B;AACnC,SAASC,KAAK,QAAQ,yBAAyB;AAC/C,SAASC,WAAW,EAAEC,KAAK,EAAEC,SAAS,QAAQ,gBAAgB;AAE9D,SACEC,YAAY,EAEZC,qBAAqB,EACrBC,8BAA8B,EAC9BC,oBAAoB,QAGf,cAAc;AACrB,SAASC,uBAAuB,QAAkC,WAAW;AAC7E,SAASC,YAAY,QAAQ,mBAAmB;AAChD,SAEEC,aAAa,EACbC,cAAc,EACdC,eAAe,QACV,uBAAuB;AAE9B;;CAEC,GACD,OAAO,SAASC,gCAAgCC,KAA2C;IACzF,MAAM,EAAEC,QAAQ,EAAEC,KAAK,EAAE,GAAGF;IAC5B,MAAM,EAAEG,UAAU,EAAE,GAAGD;IACvB,MAAME,wBAAwBD,cAAcb;IAE5C,MAAMe,0BAA0BnB,MAAM,0BAA0B,+FAA+F;IAE/J,MAAMoB,qBAAqBrB,mCACzBmB,uBACAX;IAGF,MAAM,EAAEc,MAAMC,MAAM,EAAE,GAAGxB,oBAAsCsB;IAC/D,MAAMG,UAAUD,QAAQE,QAAQC;IAChC,MAAM,EAAEJ,MAAMK,kBAAkB,EAAE,GAAG7B,cAAcuB;IAEnD,MAAM,EAAEO,iBAAiB,EAAEC,eAAe,EAAE,GAAGlB,cAAcI;IAC7D,MAAM,EAA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C,KAAK,GAAI4C,EAAEC,MAAM,CAAC7C,KAAK,GAAsB2B;wBAC3Fa,QAAQtB;wBACR4B,IAAI;4BAAEC,OAAO;wBAAQ;;;;;;AAK/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-time-series-data.d.ts","sourceRoot":"","sources":["../../../../src/plugins/prometheus-time-series-query/get-time-series-data.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,qBAAqB,EAAqD,MAAM,2BAA2B,CAAC;AAiBrH,OAAO,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAC;AAG1E,eAAO,MAAM,iBAAiB,EAAE,qBAAqB,CAAC,6BAA6B,CAAC,CAAC,mBAAmB,
|
|
1
|
+
{"version":3,"file":"get-time-series-data.d.ts","sourceRoot":"","sources":["../../../../src/plugins/prometheus-time-series-query/get-time-series-data.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,qBAAqB,EAAqD,MAAM,2BAA2B,CAAC;AAiBrH,OAAO,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAC;AAG1E,eAAO,MAAM,iBAAiB,EAAE,qBAAqB,CAAC,6BAA6B,CAAC,CAAC,mBAAmB,CAyHvG,CAAC"}
|
|
@@ -42,6 +42,14 @@ export const getTimeSeriesData = async (spec, context)=>{
|
|
|
42
42
|
const alignedStart = Math.floor((start + utcOffsetSec) / step) * step - utcOffsetSec;
|
|
43
43
|
start = alignedStart;
|
|
44
44
|
end = alignedEnd;
|
|
45
|
+
/* Ensure end is always greater than start:
|
|
46
|
+
If the step is greater than equal to the diff of end and start,
|
|
47
|
+
both start, and end will eventually be rounded to the same value,
|
|
48
|
+
Consequently, the time range will be zero, which does not return any valid value
|
|
49
|
+
*/ if (end === start) {
|
|
50
|
+
end = start + step;
|
|
51
|
+
console.warn(`Step (${step}) was larger than the time range! end of time range was set accordingly.`);
|
|
52
|
+
}
|
|
45
53
|
// Replace variable placeholders in PromQL query
|
|
46
54
|
const intervalMs = step * 1000;
|
|
47
55
|
const minStepMs = minStep * 1000;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/plugins/prometheus-time-series-query/get-time-series-data.ts"],"sourcesContent":["// Copyright 2025 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport {\n DatasourceSpec,\n DurationString,\n Notice,\n parseDurationString,\n TimeSeries,\n TimeSeriesData,\n} from '@perses-dev/core';\nimport { TimeSeriesQueryPlugin, datasourceSelectValueToSelector, replaceVariables } from '@perses-dev/plugin-system';\nimport { fromUnixTime, milliseconds } from 'date-fns';\nimport {\n parseValueTuple,\n PrometheusClient,\n getDurationStringSeconds,\n getPrometheusTimeRange,\n getRangeStep,\n DEFAULT_PROM,\n MatrixData,\n VectorData,\n ScalarData,\n InstantQueryResultType,\n PROM_DATASOURCE_KIND,\n} from '../../model';\nimport { getFormattedPrometheusSeriesName } from '../../utils';\nimport { DEFAULT_SCRAPE_INTERVAL, PrometheusDatasourceSpec } from '../types';\nimport { PrometheusTimeSeriesQuerySpec } from './time-series-query-model';\nimport { replacePromBuiltinVariables } from './replace-prom-builtin-variables';\n\nexport const getTimeSeriesData: TimeSeriesQueryPlugin<PrometheusTimeSeriesQuerySpec>['getTimeSeriesData'] = async (\n spec,\n context\n) => {\n if (spec.query === undefined || spec.query === null || spec.query === '') {\n // Do not make a request to the backend, instead return an empty TimeSeriesData\n return { series: [] };\n }\n\n const listDatasourceSelectItems = await context.datasourceStore.listDatasourceSelectItems(PROM_DATASOURCE_KIND);\n\n const selectedDatasource =\n datasourceSelectValueToSelector(\n spec.datasource ?? DEFAULT_PROM,\n context.variableState,\n listDatasourceSelectItems\n ) ?? DEFAULT_PROM;\n\n const datasource = (await context.datasourceStore.getDatasource(\n selectedDatasource\n )) as DatasourceSpec<PrometheusDatasourceSpec>;\n const datasourceScrapeInterval = Math.trunc(\n milliseconds(parseDurationString(datasource.plugin.spec.scrapeInterval ?? DEFAULT_SCRAPE_INTERVAL)) / 1000\n );\n\n // Min step is the lower bound of the interval between data points\n // If no value is provided for it, it should default to the scrape interval of the datasource\n const minStep =\n getDurationStringSeconds(\n // resolve any variable that may have been provided\n // TODO add a validation check to make sure the variable is a DurationString, to avoid the back & forth cast here\n replaceVariables(spec.minStep as string, context.variableState) as DurationString\n ) ?? datasourceScrapeInterval;\n const timeRange = getPrometheusTimeRange(context.timeRange);\n const step = getRangeStep(timeRange, minStep, undefined, context.suggestedStepMs); // TODO: resolution\n\n // Align the time range so that it's a multiple of the step\n let { start, end } = timeRange;\n const utcOffsetSec = new Date().getTimezoneOffset() * 60;\n\n const alignedEnd = Math.floor((end + utcOffsetSec) / step) * step - utcOffsetSec;\n const alignedStart = Math.floor((start + utcOffsetSec) / step) * step - utcOffsetSec;\n start = alignedStart;\n end = alignedEnd;\n\n // Replace variable placeholders in PromQL query\n const intervalMs = step * 1000;\n const minStepMs = minStep * 1000;\n let query = replacePromBuiltinVariables(spec.query, minStepMs, intervalMs);\n query = replaceVariables(query, context.variableState);\n\n let seriesNameFormat = spec.seriesNameFormat;\n // if series name format is defined, replace variable placeholders in series name format\n if (seriesNameFormat) {\n seriesNameFormat = replaceVariables(seriesNameFormat, context.variableState);\n }\n\n // Get the datasource, using the default Prom Datasource if one isn't specified in the query\n const client: PrometheusClient = await context.datasourceStore.getDatasourceClient(selectedDatasource);\n\n // Make the request to Prom\n let response;\n switch (context.mode) {\n case 'instant':\n response = await client.instantQuery({\n query,\n time: end,\n });\n break;\n case 'range':\n default:\n response = await client.rangeQuery({\n query,\n start,\n end,\n step,\n });\n break;\n }\n\n // TODO: What about error responses from Prom that have a response body?\n const result = response.data;\n\n // Custom display for response header warnings, configurable error responses display coming next\n const notices: Notice[] = [];\n if (response.status === 'success') {\n const warnings = response.warnings ?? [];\n const warningMessage = warnings[0] ?? '';\n if (warningMessage !== '') {\n notices.push({\n type: 'warning',\n message: warningMessage,\n });\n }\n }\n\n // Transform response\n const chartData: TimeSeriesData = {\n // Return the time range and step we actually used for the query\n timeRange: { start: fromUnixTime(start), end: fromUnixTime(end) },\n stepMs: step * 1000,\n\n series: buildTimeSeries(query, result, seriesNameFormat),\n metadata: {\n notices,\n executedQueryString: query,\n },\n };\n\n return chartData;\n};\n\nfunction buildVectorData(query: string, data: VectorData, seriesNameFormat: string | undefined): TimeSeries[] {\n return data.result.map((res) => {\n const { metric, value, histogram } = res;\n\n // Account for seriesNameFormat from query editor when determining name to show in legend, tooltip, etc.\n const { name, formattedName } = getFormattedPrometheusSeriesName(query, metric, seriesNameFormat);\n\n if (histogram) {\n return {\n name,\n formattedName,\n labels: metric,\n values: [parseValueTuple([histogram[0], histogram[1].sum])],\n histograms: [histogram],\n };\n }\n\n return {\n name,\n formattedName,\n labels: metric,\n values: [parseValueTuple(value)],\n };\n });\n}\n\nfunction buildMatrixData(query: string, data: MatrixData, seriesNameFormat: string | undefined): TimeSeries[] {\n return data.result.map((res) => {\n const { metric, values, histograms } = res;\n\n // Account for seriesNameFormat from query editor when determining name to show in legend, tooltip, etc.\n const { name, formattedName } = getFormattedPrometheusSeriesName(query, metric, seriesNameFormat);\n\n if (histograms) {\n return {\n name,\n formattedName,\n labels: metric,\n values: histograms.map((histogram) => parseValueTuple([histogram[0], histogram[1].sum])),\n histograms: histograms.map((histogram) => histogram),\n };\n }\n\n return {\n name,\n formattedName,\n labels: metric,\n values: values.map(parseValueTuple),\n };\n });\n}\n\nfunction buildScalarData(query: string, data: ScalarData, seriesNameFormat: string | undefined): TimeSeries[] {\n const { name, formattedName } = getFormattedPrometheusSeriesName(query, {}, seriesNameFormat);\n return [\n {\n name,\n values: [parseValueTuple(data.result)],\n formattedName,\n },\n ];\n}\n\nfunction buildTimeSeries(query: string, data?: InstantQueryResultType, seriesNameFormat?: string): TimeSeries[] {\n if (!data) {\n return [];\n }\n\n const resultType = data.resultType;\n switch (resultType) {\n case 'vector':\n return buildVectorData(query, data, seriesNameFormat);\n case 'matrix':\n return buildMatrixData(query, data, seriesNameFormat);\n case 'scalar':\n return buildScalarData(query, data, seriesNameFormat);\n default:\n console.warn('Unknown result type', resultType, data);\n return [];\n }\n}\n"],"names":["parseDurationString","datasourceSelectValueToSelector","replaceVariables","fromUnixTime","milliseconds","parseValueTuple","getDurationStringSeconds","getPrometheusTimeRange","getRangeStep","DEFAULT_PROM","PROM_DATASOURCE_KIND","getFormattedPrometheusSeriesName","DEFAULT_SCRAPE_INTERVAL","replacePromBuiltinVariables","getTimeSeriesData","spec","context","query","undefined","series","listDatasourceSelectItems","datasourceStore","selectedDatasource","datasource","variableState","getDatasource","datasourceScrapeInterval","Math","trunc","plugin","scrapeInterval","minStep","timeRange","step","suggestedStepMs","start","end","utcOffsetSec","Date","getTimezoneOffset","alignedEnd","floor","alignedStart","intervalMs","minStepMs","seriesNameFormat","client","getDatasourceClient","response","mode","instantQuery","time","rangeQuery","result","data","notices","status","warnings","warningMessage","push","type","message","chartData","stepMs","buildTimeSeries","metadata","executedQueryString","buildVectorData","map","res","metric","value","histogram","name","formattedName","labels","values","sum","histograms","buildMatrixData","buildScalarData","resultType","console","warn"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAIEA,mBAAmB,QAGd,mBAAmB;AAC1B,SAAgCC,+BAA+B,EAAEC,gBAAgB,QAAQ,4BAA4B;AACrH,SAASC,YAAY,EAAEC,YAAY,QAAQ,WAAW;AACtD,SACEC,eAAe,EAEfC,wBAAwB,EACxBC,sBA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2E,gBAAgB/D,KAAa,EAAEqC,IAAgB,EAAET,gBAAoC;IAC5F,MAAM,EAAE4B,IAAI,EAAEC,aAAa,EAAE,GAAG/D,iCAAiCM,OAAO,CAAC,GAAG4B;IAC5E,OAAO;QACL;YACE4B;YACAG,QAAQ;gBAACvE,gBAAgBiD,KAAKD,MAAM;aAAE;YACtCqB;QACF;KACD;AACH;AAEA,SAASV,gBAAgB/C,KAAa,EAAEqC,IAA6B,EAAET,gBAAyB;IAC9F,IAAI,CAACS,MAAM;QACT,OAAO,EAAE;IACX;IAEA,MAAM2B,aAAa3B,KAAK2B,UAAU;IAClC,OAAQA;QACN,KAAK;YACH,OAAOd,gBAAgBlD,OAAOqC,MAAMT;QACtC,KAAK;YACH,OAAOkC,gBAAgB9D,OAAOqC,MAAMT;QACtC,KAAK;YACH,OAAOmC,gBAAgB/D,OAAOqC,MAAMT;QACtC;YACEqC,QAAQC,IAAI,CAAC,uBAAuBF,YAAY3B;YAChD,OAAO,EAAE;IACb;AACF"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/plugins/prometheus-time-series-query/get-time-series-data.ts"],"sourcesContent":["// Copyright 2025 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport {\n DatasourceSpec,\n DurationString,\n Notice,\n parseDurationString,\n TimeSeries,\n TimeSeriesData,\n} from '@perses-dev/core';\nimport { TimeSeriesQueryPlugin, datasourceSelectValueToSelector, replaceVariables } from '@perses-dev/plugin-system';\nimport { fromUnixTime, milliseconds } from 'date-fns';\nimport {\n parseValueTuple,\n PrometheusClient,\n getDurationStringSeconds,\n getPrometheusTimeRange,\n getRangeStep,\n DEFAULT_PROM,\n MatrixData,\n VectorData,\n ScalarData,\n InstantQueryResultType,\n PROM_DATASOURCE_KIND,\n} from '../../model';\nimport { getFormattedPrometheusSeriesName } from '../../utils';\nimport { DEFAULT_SCRAPE_INTERVAL, PrometheusDatasourceSpec } from '../types';\nimport { PrometheusTimeSeriesQuerySpec } from './time-series-query-model';\nimport { replacePromBuiltinVariables } from './replace-prom-builtin-variables';\n\nexport const getTimeSeriesData: TimeSeriesQueryPlugin<PrometheusTimeSeriesQuerySpec>['getTimeSeriesData'] = async (\n spec,\n context\n) => {\n if (spec.query === undefined || spec.query === null || spec.query === '') {\n // Do not make a request to the backend, instead return an empty TimeSeriesData\n return { series: [] };\n }\n\n const listDatasourceSelectItems = await context.datasourceStore.listDatasourceSelectItems(PROM_DATASOURCE_KIND);\n\n const selectedDatasource =\n datasourceSelectValueToSelector(\n spec.datasource ?? DEFAULT_PROM,\n context.variableState,\n listDatasourceSelectItems\n ) ?? DEFAULT_PROM;\n\n const datasource = (await context.datasourceStore.getDatasource(\n selectedDatasource\n )) as DatasourceSpec<PrometheusDatasourceSpec>;\n const datasourceScrapeInterval = Math.trunc(\n milliseconds(parseDurationString(datasource.plugin.spec.scrapeInterval ?? DEFAULT_SCRAPE_INTERVAL)) / 1000\n );\n\n // Min step is the lower bound of the interval between data points\n // If no value is provided for it, it should default to the scrape interval of the datasource\n const minStep =\n getDurationStringSeconds(\n // resolve any variable that may have been provided\n // TODO add a validation check to make sure the variable is a DurationString, to avoid the back & forth cast here\n replaceVariables(spec.minStep as string, context.variableState) as DurationString\n ) ?? datasourceScrapeInterval;\n const timeRange = getPrometheusTimeRange(context.timeRange);\n const step = getRangeStep(timeRange, minStep, undefined, context.suggestedStepMs); // TODO: resolution\n\n // Align the time range so that it's a multiple of the step\n let { start, end } = timeRange;\n\n const utcOffsetSec = new Date().getTimezoneOffset() * 60;\n\n const alignedEnd = Math.floor((end + utcOffsetSec) / step) * step - utcOffsetSec;\n const alignedStart = Math.floor((start + utcOffsetSec) / step) * step - utcOffsetSec;\n start = alignedStart;\n end = alignedEnd;\n\n /* Ensure end is always greater than start:\n If the step is greater than equal to the diff of end and start,\n both start, and end will eventually be rounded to the same value,\n Consequently, the time range will be zero, which does not return any valid value\n */\n if (end === start) {\n end = start + step;\n console.warn(`Step (${step}) was larger than the time range! end of time range was set accordingly.`);\n }\n\n // Replace variable placeholders in PromQL query\n const intervalMs = step * 1000;\n const minStepMs = minStep * 1000;\n let query = replacePromBuiltinVariables(spec.query, minStepMs, intervalMs);\n query = replaceVariables(query, context.variableState);\n\n let seriesNameFormat = spec.seriesNameFormat;\n // if series name format is defined, replace variable placeholders in series name format\n if (seriesNameFormat) {\n seriesNameFormat = replaceVariables(seriesNameFormat, context.variableState);\n }\n\n // Get the datasource, using the default Prom Datasource if one isn't specified in the query\n const client: PrometheusClient = await context.datasourceStore.getDatasourceClient(selectedDatasource);\n\n // Make the request to Prom\n let response;\n switch (context.mode) {\n case 'instant':\n response = await client.instantQuery({\n query,\n time: end,\n });\n break;\n case 'range':\n default:\n response = await client.rangeQuery({\n query,\n start,\n end,\n step,\n });\n break;\n }\n\n // TODO: What about error responses from Prom that have a response body?\n const result = response.data;\n\n // Custom display for response header warnings, configurable error responses display coming next\n const notices: Notice[] = [];\n if (response.status === 'success') {\n const warnings = response.warnings ?? [];\n const warningMessage = warnings[0] ?? '';\n if (warningMessage !== '') {\n notices.push({\n type: 'warning',\n message: warningMessage,\n });\n }\n }\n\n // Transform response\n const chartData: TimeSeriesData = {\n // Return the time range and step we actually used for the query\n timeRange: { start: fromUnixTime(start), end: fromUnixTime(end) },\n stepMs: step * 1000,\n\n series: buildTimeSeries(query, result, seriesNameFormat),\n metadata: {\n notices,\n executedQueryString: query,\n },\n };\n\n return chartData;\n};\n\nfunction buildVectorData(query: string, data: VectorData, seriesNameFormat: string | undefined): TimeSeries[] {\n return data.result.map((res) => {\n const { metric, value, histogram } = res;\n\n // Account for seriesNameFormat from query editor when determining name to show in legend, tooltip, etc.\n const { name, formattedName } = getFormattedPrometheusSeriesName(query, metric, seriesNameFormat);\n\n if (histogram) {\n return {\n name,\n formattedName,\n labels: metric,\n values: [parseValueTuple([histogram[0], histogram[1].sum])],\n histograms: [histogram],\n };\n }\n\n return {\n name,\n formattedName,\n labels: metric,\n values: [parseValueTuple(value)],\n };\n });\n}\n\nfunction buildMatrixData(query: string, data: MatrixData, seriesNameFormat: string | undefined): TimeSeries[] {\n return data.result.map((res) => {\n const { metric, values, histograms } = res;\n\n // Account for seriesNameFormat from query editor when determining name to show in legend, tooltip, etc.\n const { name, formattedName } = getFormattedPrometheusSeriesName(query, metric, seriesNameFormat);\n\n if (histograms) {\n return {\n name,\n formattedName,\n labels: metric,\n values: histograms.map((histogram) => parseValueTuple([histogram[0], histogram[1].sum])),\n histograms: histograms.map((histogram) => histogram),\n };\n }\n\n return {\n name,\n formattedName,\n labels: metric,\n values: values.map(parseValueTuple),\n };\n });\n}\n\nfunction buildScalarData(query: string, data: ScalarData, seriesNameFormat: string | undefined): TimeSeries[] {\n const { name, formattedName } = getFormattedPrometheusSeriesName(query, {}, seriesNameFormat);\n return [\n {\n name,\n values: [parseValueTuple(data.result)],\n formattedName,\n },\n ];\n}\n\nfunction buildTimeSeries(query: string, data?: InstantQueryResultType, seriesNameFormat?: string): TimeSeries[] {\n if (!data) {\n return [];\n }\n\n const resultType = data.resultType;\n switch (resultType) {\n case 'vector':\n return buildVectorData(query, data, seriesNameFormat);\n case 'matrix':\n return buildMatrixData(query, data, seriesNameFormat);\n case 'scalar':\n return buildScalarData(query, data, seriesNameFormat);\n default:\n console.warn('Unknown result type', resultType, data);\n return [];\n }\n}\n"],"names":["parseDurationString","datasourceSelectValueToSelector","replaceVariables","fromUnixTime","milliseconds","parseValueTuple","getDurationStringSeconds","getPrometheusTimeRange","getRangeStep","DEFAULT_PROM","PROM_DATASOURCE_KIND","getFormattedPrometheusSeriesName","DEFAULT_SCRAPE_INTERVAL","replacePromBuiltinVariables","getTimeSeriesData","spec","context","query","undefined","series","listDatasourceSelectItems","datasourceStore","selectedDatasource","datasource","variableState","getDatasource","datasourceScrapeInterval","Math","trunc","plugin","scrapeInterval","minStep","timeRange","step","suggestedStepMs","start","end","utcOffsetSec","Date","getTimezoneOffset","alignedEnd","floor","alignedStart","console","warn","intervalMs","minStepMs","seriesNameFormat","client","getDatasourceClient","response","mode","instantQuery","time","rangeQuery","result","data","notices","status","warnings","warningMessage","push","type","message","chartData","stepMs","buildTimeSeries","metadata","executedQueryString","buildVectorData","map","res","metric","value","histogram","name","formattedName","labels","values","sum","histograms","buildMatrixData","buildScalarData","resultType"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAIEA,mBAAmB,QAGd,mBAAmB;AAC1B,SAAgCC,+BAA+B,EAAEC,gBAAgB,QAAQ,4BAA4B;AACrH,SAASC,YAAY,EAAEC,YAAY,QAAQ,WAAW;AACtD,SACEC,eAAe,EAEfC,wBAAwB,EACxBC,sBAAsB,EACtBC,YAAY,EACZC,YAAY,EAKZC,oBAAoB,QACf,cAAc;AACrB,SAASC,gCAAgC,QAAQ,cAAc;AAC/D,SAASC,uBAAuB,QAAkC,WAAW;AAE7E,SAASC,2BAA2B,QAAQ,mCAAmC;AAE/E,OAAO,MAAMC,oBAA+F,OAC1GC,MACAC;IAEA,IAAID,KAAKE,KAAK,KAAKC,aAAaH,KAAKE,KAAK,KAAK,QAAQF,KAAKE,KAAK,KAAK,IAAI;QACxE,+EAA+E;QAC/E,OAAO;YAAEE,QAAQ,EAAE;QAAC;IACtB;IAEA,MAAMC,4BAA4B,MAAMJ,QAAQK,eAAe,CAACD,yBAAyB,CAACV;IAE1F,MAAMY,qBACJrB,gCACEc,KAAKQ,UAAU,IAAId,cACnBO,QAAQQ,aA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B,aAAa3B,KAAK2B,UAAU;IAClC,OAAQA;QACN,KAAK;YACH,OAAOd,gBAAgBpD,OAAOuC,MAAMT;QACtC,KAAK;YACH,OAAOkC,gBAAgBhE,OAAOuC,MAAMT;QACtC,KAAK;YACH,OAAOmC,gBAAgBjE,OAAOuC,MAAMT;QACtC;YACEJ,QAAQC,IAAI,CAAC,uBAAuBuC,YAAY3B;YAChD,OAAO,EAAE;IACb;AACF"}
|
|
@@ -26,7 +26,7 @@ export declare function useFormatState(props: PrometheusTimeSeriesQueryEditorPro
|
|
|
26
26
|
*/
|
|
27
27
|
export declare function useMinStepState(props: PrometheusTimeSeriesQueryEditorProps): {
|
|
28
28
|
minStep: string | undefined;
|
|
29
|
-
handleMinStepChange: (e: DurationString) => void;
|
|
29
|
+
handleMinStepChange: (e: DurationString | undefined) => void;
|
|
30
30
|
handleMinStepBlur: () => void;
|
|
31
31
|
};
|
|
32
32
|
//# sourceMappingURL=query-editor-model.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-editor-model.d.ts","sourceRoot":"","sources":["../../../../src/plugins/prometheus-time-series-query/query-editor-model.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAC;AAE1E,MAAM,MAAM,oCAAoC,GAAG,kBAAkB,CAAC,6BAA6B,CAAC,CAAC;AAErG;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,oCAAoC,GAAG;IAC1E,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,eAAe,EAAE,MAAM,IAAI,CAAC;CAC7B,CA+BA;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,oCAAoC,GAAG;IAC3E,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,kBAAkB,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,gBAAgB,EAAE,MAAM,IAAI,CAAC;CAC9B,CA2BA;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,oCAAoC,GAAG;IAC5E,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,mBAAmB,EAAE,CAAC,CAAC,EAAE,cAAc,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"query-editor-model.d.ts","sourceRoot":"","sources":["../../../../src/plugins/prometheus-time-series-query/query-editor-model.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAC;AAE1E,MAAM,MAAM,oCAAoC,GAAG,kBAAkB,CAAC,6BAA6B,CAAC,CAAC;AAErG;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,oCAAoC,GAAG;IAC1E,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,eAAe,EAAE,MAAM,IAAI,CAAC;CAC7B,CA+BA;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,oCAAoC,GAAG;IAC3E,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,kBAAkB,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,gBAAgB,EAAE,MAAM,IAAI,CAAC;CAC9B,CA2BA;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,oCAAoC,GAAG;IAC5E,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,mBAAmB,EAAE,CAAC,CAAC,EAAE,cAAc,GAAG,SAAS,KAAK,IAAI,CAAC;IAC7D,iBAAiB,EAAE,MAAM,IAAI,CAAC;CAC/B,CA2BA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/plugins/prometheus-time-series-query/query-editor-model.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { useState } from 'react';\nimport { produce } from 'immer';\nimport { OptionsEditorProps } from '@perses-dev/plugin-system';\nimport { DurationString } from '@perses-dev/core';\nimport { PrometheusTimeSeriesQuerySpec } from './time-series-query-model';\n\nexport type PrometheusTimeSeriesQueryEditorProps = OptionsEditorProps<PrometheusTimeSeriesQuerySpec>;\n\n/**\n * A hook for managing the `query` state in PrometheusTimeSeriesQuerySpec. Returns the `query` value, along with\n * `onChange` and `onBlur` event handlers to the input. Keeps a local copy of the user's input and only syncs those\n * changes with the overall spec value once the input is blurred to prevent re-running queries in the panel's preview\n * every time the user types.\n */\nexport function useQueryState(props: PrometheusTimeSeriesQueryEditorProps): {\n query: string;\n handleQueryChange: (e: string) => void;\n handleQueryBlur: () => void;\n} {\n const { onChange, value } = props;\n\n // Local copy of the query's value\n const [query, setQuery] = useState(value.query);\n\n // This is basically \"getDerivedStateFromProps\" to make sure if spec's value changes external to this component,\n // we render with the latest value\n const [lastSyncedQuery, setLastSyncedQuery] = useState(value.query);\n if (value.query !== lastSyncedQuery) {\n setQuery(value.query);\n setLastSyncedQuery(value.query);\n }\n\n // Update our local state's copy as the user types\n const handleQueryChange = (e: string): void => {\n setQuery(e);\n };\n\n // Propagate changes to the query's value when the input is blurred to avoid constantly re-running queries in the\n // PanelPreview\n const handleQueryBlur = (): void => {\n setLastSyncedQuery(query);\n onChange(\n produce(value, (draft) => {\n draft.query = query;\n })\n );\n };\n\n return { query, handleQueryChange, handleQueryBlur };\n}\n\n/**\n * Hook to manage `seriesNameFormat` state to ensure panel preview does not rerender until text input is blurred\n */\nexport function useFormatState(props: PrometheusTimeSeriesQueryEditorProps): {\n format: string | undefined;\n handleFormatChange: (e: string) => void;\n handleFormatBlur: () => void;\n} {\n const { onChange, value } = props;\n\n // TODO: reusable hook or helper util instead of duplicating from useQueryState\n const [format, setFormat] = useState(value.seriesNameFormat);\n const [lastSyncedFormat, setLastSyncedFormat] = useState(value.seriesNameFormat);\n if (value.seriesNameFormat !== lastSyncedFormat) {\n setFormat(value.seriesNameFormat);\n setLastSyncedFormat(value.seriesNameFormat);\n }\n\n // Update our local state as the user types\n const handleFormatChange = (e: string): void => {\n setFormat(e);\n };\n\n // Propagate changes to the panel preview component when seriesNameFormat TextField is blurred\n const handleFormatBlur = (): void => {\n setLastSyncedFormat(format);\n onChange(\n produce(value, (draft) => {\n draft.seriesNameFormat = format;\n })\n );\n };\n\n return { format, handleFormatChange, handleFormatBlur };\n}\n\n/**\n * Hook to manage `minStep` state to ensure panel preview does not rerender until text input is blurred\n */\nexport function useMinStepState(props: PrometheusTimeSeriesQueryEditorProps): {\n minStep: string | undefined;\n handleMinStepChange: (e: DurationString) => void;\n handleMinStepBlur: () => void;\n} {\n const { onChange, value } = props;\n\n // TODO: reusable hook or helper util instead of duplicating from useQueryState\n const [minStep, setMinStep] = useState(value.minStep);\n const [lastSyncedMinStep, setLastSyncedMinStep] = useState(value.minStep);\n if (value.minStep !== lastSyncedMinStep) {\n setMinStep(value.minStep);\n setLastSyncedMinStep(value.minStep);\n }\n\n // Update our local state as the user types\n const handleMinStepChange = (e: DurationString): void => {\n setMinStep(e);\n };\n\n // Propagate changes to the panel preview component when minStep TextField is blurred\n const handleMinStepBlur = (): void => {\n setLastSyncedMinStep(minStep);\n onChange(\n produce(value, (draft) => {\n draft.minStep = minStep;\n })\n );\n };\n\n return { minStep, handleMinStepChange, handleMinStepBlur };\n}\n"],"names":["useState","produce","useQueryState","props","onChange","value","query","setQuery","lastSyncedQuery","setLastSyncedQuery","handleQueryChange","e","handleQueryBlur","draft","useFormatState","format","setFormat","seriesNameFormat","lastSyncedFormat","setLastSyncedFormat","handleFormatChange","handleFormatBlur","useMinStepState","minStep","setMinStep","lastSyncedMinStep","setLastSyncedMinStep","handleMinStepChange","handleMinStepBlur"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,QAAQ,QAAQ,QAAQ;AACjC,SAASC,OAAO,QAAQ,QAAQ;AAOhC;;;;;CAKC,GACD,OAAO,SAASC,cAAcC,KAA2C;IAKvE,MAAM,EAAEC,QAAQ,EAAEC,KAAK,EAAE,GAAGF;IAE5B,kCAAkC;IAClC,MAAM,CAACG,OAAOC,SAAS,GAAGP,SAASK,MAAMC,KAAK;IAE9C,gHAAgH;IAChH,kCAAkC;IAClC,MAAM,CAACE,iBAAiBC,mBAAmB,GAAGT,SAASK,MAAMC,KAAK;IAClE,IAAID,MAAMC,KAAK,KAAKE,iBAAiB;QACnCD,SAASF,MAAMC,KAAK;QACpBG,mBAAmBJ,MAAMC,KAAK;IAChC;IAEA,kDAAkD;IAClD,MAAMI,oBAAoB,CAACC;QACzBJ,SAASI;IACX;IAEA,iHAAiH;IACjH,eAAe;IACf,MAAMC,kBAAkB;QACtBH,mBAAmBH;QACnBF,SACEH,QAAQI,OAAO,CAACQ;YACdA,MAAMP,KAAK,GAAGA;QAChB;IAEJ;IAEA,OAAO;QAAEA;QAAOI;QAAmBE;IAAgB;AACrD;AAEA;;CAEC,GACD,OAA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time-series-query/query-editor-model.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { useState } from 'react';\nimport { produce } from 'immer';\nimport { OptionsEditorProps } from '@perses-dev/plugin-system';\nimport { DurationString } from '@perses-dev/core';\nimport { PrometheusTimeSeriesQuerySpec } from './time-series-query-model';\n\nexport type PrometheusTimeSeriesQueryEditorProps = OptionsEditorProps<PrometheusTimeSeriesQuerySpec>;\n\n/**\n * A hook for managing the `query` state in PrometheusTimeSeriesQuerySpec. Returns the `query` value, along with\n * `onChange` and `onBlur` event handlers to the input. Keeps a local copy of the user's input and only syncs those\n * changes with the overall spec value once the input is blurred to prevent re-running queries in the panel's preview\n * every time the user types.\n */\nexport function useQueryState(props: PrometheusTimeSeriesQueryEditorProps): {\n query: string;\n handleQueryChange: (e: string) => void;\n handleQueryBlur: () => void;\n} {\n const { onChange, value } = props;\n\n // Local copy of the query's value\n const [query, setQuery] = useState(value.query);\n\n // This is basically \"getDerivedStateFromProps\" to make sure if spec's value changes external to this component,\n // we render with the latest value\n const [lastSyncedQuery, setLastSyncedQuery] = useState(value.query);\n if (value.query !== lastSyncedQuery) {\n setQuery(value.query);\n setLastSyncedQuery(value.query);\n }\n\n // Update our local state's copy as the user types\n const handleQueryChange = (e: string): void => {\n setQuery(e);\n };\n\n // Propagate changes to the query's value when the input is blurred to avoid constantly re-running queries in the\n // PanelPreview\n const handleQueryBlur = (): void => {\n setLastSyncedQuery(query);\n onChange(\n produce(value, (draft) => {\n draft.query = query;\n })\n );\n };\n\n return { query, handleQueryChange, handleQueryBlur };\n}\n\n/**\n * Hook to manage `seriesNameFormat` state to ensure panel preview does not rerender until text input is blurred\n */\nexport function useFormatState(props: PrometheusTimeSeriesQueryEditorProps): {\n format: string | undefined;\n handleFormatChange: (e: string) => void;\n handleFormatBlur: () => void;\n} {\n const { onChange, value } = props;\n\n // TODO: reusable hook or helper util instead of duplicating from useQueryState\n const [format, setFormat] = useState(value.seriesNameFormat);\n const [lastSyncedFormat, setLastSyncedFormat] = useState(value.seriesNameFormat);\n if (value.seriesNameFormat !== lastSyncedFormat) {\n setFormat(value.seriesNameFormat);\n setLastSyncedFormat(value.seriesNameFormat);\n }\n\n // Update our local state as the user types\n const handleFormatChange = (e: string): void => {\n setFormat(e);\n };\n\n // Propagate changes to the panel preview component when seriesNameFormat TextField is blurred\n const handleFormatBlur = (): void => {\n setLastSyncedFormat(format);\n onChange(\n produce(value, (draft) => {\n draft.seriesNameFormat = format;\n })\n );\n };\n\n return { format, handleFormatChange, handleFormatBlur };\n}\n\n/**\n * Hook to manage `minStep` state to ensure panel preview does not rerender until text input is blurred\n */\nexport function useMinStepState(props: PrometheusTimeSeriesQueryEditorProps): {\n minStep: string | undefined;\n handleMinStepChange: (e: DurationString | undefined) => void;\n handleMinStepBlur: () => void;\n} {\n const { onChange, value } = props;\n\n // TODO: reusable hook or helper util instead of duplicating from useQueryState\n const [minStep, setMinStep] = useState(value.minStep);\n const [lastSyncedMinStep, setLastSyncedMinStep] = useState(value.minStep);\n if (value.minStep !== lastSyncedMinStep) {\n setMinStep(value.minStep);\n setLastSyncedMinStep(value.minStep);\n }\n\n // Update our local state as the user types\n const handleMinStepChange = (e: DurationString | undefined): void => {\n setMinStep(e);\n };\n\n // Propagate changes to the panel preview component when minStep TextField is blurred\n const handleMinStepBlur = (): void => {\n setLastSyncedMinStep(minStep);\n onChange(\n produce(value, (draft) => {\n draft.minStep = minStep;\n })\n );\n };\n\n return { minStep, handleMinStepChange, handleMinStepBlur };\n}\n"],"names":["useState","produce","useQueryState","props","onChange","value","query","setQuery","lastSyncedQuery","setLastSyncedQuery","handleQueryChange","e","handleQueryBlur","draft","useFormatState","format","setFormat","seriesNameFormat","lastSyncedFormat","setLastSyncedFormat","handleFormatChange","handleFormatBlur","useMinStepState","minStep","setMinStep","lastSyncedMinStep","setLastSyncedMinStep","handleMinStepChange","handleMinStepBlur"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,QAAQ,QAAQ,QAAQ;AACjC,SAASC,OAAO,QAAQ,QAAQ;AAOhC;;;;;CAKC,GACD,OAAO,SAASC,cAAcC,KAA2C;IAKvE,MAAM,EAAEC,QAAQ,EAAEC,KAAK,EAAE,GAAGF;IAE5B,kCAAkC;IAClC,MAAM,CAACG,OAAOC,SAAS,GAAGP,SAASK,MAAMC,KAAK;IAE9C,gHAAgH;IAChH,kCAAkC;IAClC,MAAM,CAACE,iBAAiBC,mBAAmB,GAAGT,SAASK,MAAMC,KAAK;IAClE,IAAID,MAAMC,KAAK,KAAKE,iBAAiB;QACnCD,SAASF,MAAMC,KAAK;QACpBG,mBAAmBJ,MAAMC,KAAK;IAChC;IAEA,kDAAkD;IAClD,MAAMI,oBAAoB,CAACC;QACzBJ,SAASI;IACX;IAEA,iHAAiH;IACjH,eAAe;IACf,MAAMC,kBAAkB;QACtBH,mBAAmBH;QACnBF,SACEH,QAAQI,OAAO,CAACQ;YACdA,MAAMP,KAAK,GAAGA;QAChB;IAEJ;IAEA,OAAO;QAAEA;QAAOI;QAAmBE;IAAgB;AACrD;AAEA;;CAEC,GACD,OAAO,SAASE,eAAeX,KAA2C;IAKxE,MAAM,EAAEC,QAAQ,EAAEC,KAAK,EAAE,GAAGF;IAE5B,+EAA+E;IAC/E,MAAM,CAACY,QAAQC,UAAU,GAAGhB,SAASK,MAAMY,gBAAgB;IAC3D,MAAM,CAACC,kBAAkBC,oBAAoB,GAAGnB,SAASK,MAAMY,gBAAgB;IAC/E,IAAIZ,MAAMY,gBAAgB,KAAKC,kBAAkB;QAC/CF,UAAUX,MAAMY,gBAAgB;QAChCE,oBAAoBd,MAAMY,gBAAgB;IAC5C;IAEA,2CAA2C;IAC3C,MAAMG,qBAAqB,CAACT;QAC1BK,UAAUL;IACZ;IAEA,8FAA8F;IAC9F,MAAMU,mBAAmB;QACvBF,oBAAoBJ;QACpBX,SACEH,QAAQI,OAAO,CAACQ;YACdA,MAAMI,gBAAgB,GAAGF;QAC3B;IAEJ;IAEA,OAAO;QAAEA;QAAQK;QAAoBC;IAAiB;AACxD;AAEA;;CAEC,GACD,OAAO,SAASC,gBAAgBnB,KAA2C;IAKzE,MAAM,EAAEC,QAAQ,EAAEC,KAAK,EAAE,GAAGF;IAE5B,+EAA+E;IAC/E,MAAM,CAACoB,SAASC,WAAW,GAAGxB,SAASK,MAAMkB,OAAO;IACpD,MAAM,CAACE,mBAAmBC,qBAAqB,GAAG1B,SAASK,MAAMkB,OAAO;IACxE,IAAIlB,MAAMkB,OAAO,KAAKE,mBAAmB;QACvCD,WAAWnB,MAAMkB,OAAO;QACxBG,qBAAqBrB,MAAMkB,OAAO;IACpC;IAEA,2CAA2C;IAC3C,MAAMI,sBAAsB,CAAChB;QAC3Ba,WAAWb;IACb;IAEA,qFAAqF;IACrF,MAAMiB,oBAAoB;QACxBF,qBAAqBH;QACrBnB,SACEH,QAAQI,OAAO,CAACQ;YACdA,MAAMU,OAAO,GAAGA;QAClB;IAEJ;IAEA,OAAO;QAAEA;QAASI;QAAqBC;IAAkB;AAC3D"}
|
package/mf-manifest.json
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
"name": "Prometheus",
|
|
6
6
|
"type": "app",
|
|
7
7
|
"buildInfo": {
|
|
8
|
-
"buildVersion": "0.
|
|
8
|
+
"buildVersion": "0.52.0",
|
|
9
9
|
"buildName": "@perses-dev/prometheus-plugin"
|
|
10
10
|
},
|
|
11
11
|
"remoteEntry": {
|
|
12
|
-
"name": "__mf/js/Prometheus.
|
|
12
|
+
"name": "__mf/js/Prometheus.c57c8a9f.js",
|
|
13
13
|
"path": "",
|
|
14
14
|
"type": "global"
|
|
15
15
|
},
|
|
@@ -152,7 +152,7 @@
|
|
|
152
152
|
"__mf/js/async/738.aca54e25.js",
|
|
153
153
|
"__mf/js/async/3980.7cea5715.js",
|
|
154
154
|
"__mf/js/async/6377.ca974d89.js",
|
|
155
|
-
"__mf/js/async/5503.
|
|
155
|
+
"__mf/js/async/5503.daedd4dd.js",
|
|
156
156
|
"__mf/js/async/1465.3b5e12d5.js",
|
|
157
157
|
"__mf/js/async/4421.42e889f6.js",
|
|
158
158
|
"__mf/js/async/4062.3ab7f987.js",
|
|
@@ -209,7 +209,7 @@
|
|
|
209
209
|
"__mf/js/async/738.aca54e25.js",
|
|
210
210
|
"__mf/js/async/3980.7cea5715.js",
|
|
211
211
|
"__mf/js/async/6377.ca974d89.js",
|
|
212
|
-
"__mf/js/async/5503.
|
|
212
|
+
"__mf/js/async/5503.daedd4dd.js",
|
|
213
213
|
"__mf/js/async/4062.3ab7f987.js",
|
|
214
214
|
"__mf/js/async/5913.4e5abd09.js",
|
|
215
215
|
"__mf/js/async/2285.15378f70.js",
|
|
@@ -257,7 +257,7 @@
|
|
|
257
257
|
"__mf/js/async/738.aca54e25.js",
|
|
258
258
|
"__mf/js/async/3980.7cea5715.js",
|
|
259
259
|
"__mf/js/async/6377.ca974d89.js",
|
|
260
|
-
"__mf/js/async/5503.
|
|
260
|
+
"__mf/js/async/5503.daedd4dd.js",
|
|
261
261
|
"__mf/js/async/1465.3b5e12d5.js",
|
|
262
262
|
"__mf/js/async/4421.42e889f6.js",
|
|
263
263
|
"__mf/js/async/4062.3ab7f987.js",
|
|
@@ -329,7 +329,7 @@
|
|
|
329
329
|
"js": {
|
|
330
330
|
"async": [],
|
|
331
331
|
"sync": [
|
|
332
|
-
"__mf/js/async/5503.
|
|
332
|
+
"__mf/js/async/5503.daedd4dd.js"
|
|
333
333
|
]
|
|
334
334
|
},
|
|
335
335
|
"css": {
|
|
@@ -491,8 +491,8 @@
|
|
|
491
491
|
"__mf/js/async/2675.99cf926f.js",
|
|
492
492
|
"__mf/js/async/5724.6ee6ec51.js",
|
|
493
493
|
"__mf/js/async/537.6911ea2e.js",
|
|
494
|
-
"__mf/js/async/5345.
|
|
495
|
-
"__mf/js/async/__federation_expose_PrometheusTimeSeriesQuery.
|
|
494
|
+
"__mf/js/async/5345.1f4fc17b.js",
|
|
495
|
+
"__mf/js/async/__federation_expose_PrometheusTimeSeriesQuery.fc3c5730.js",
|
|
496
496
|
"__mf/js/async/7272.a763aa92.js",
|
|
497
497
|
"__mf/js/async/__federation_expose_PrometheusLabelValuesVariable.a4085adb.js",
|
|
498
498
|
"__mf/js/async/__federation_expose_PrometheusLabelNamesVariable.8551745e.js",
|
|
@@ -501,7 +501,7 @@
|
|
|
501
501
|
"__mf/js/async/7376.c7eb05b9.js",
|
|
502
502
|
"__mf/js/async/9550.e19763f8.js",
|
|
503
503
|
"__mf/js/async/3818.dde21d04.js",
|
|
504
|
-
"__mf/js/async/__federation_expose_PrometheusExplorer.
|
|
504
|
+
"__mf/js/async/__federation_expose_PrometheusExplorer.171d04eb.js",
|
|
505
505
|
"__mf/js/async/3871.6915e369.js",
|
|
506
506
|
"__mf/js/async/1465.3b5e12d5.js",
|
|
507
507
|
"__mf/js/async/528.d364bb0e.js",
|
|
@@ -513,7 +513,7 @@
|
|
|
513
513
|
"__mf/js/async/738.aca54e25.js",
|
|
514
514
|
"__mf/js/async/3980.7cea5715.js",
|
|
515
515
|
"__mf/js/async/6377.ca974d89.js",
|
|
516
|
-
"__mf/js/async/5503.
|
|
516
|
+
"__mf/js/async/5503.daedd4dd.js",
|
|
517
517
|
"__mf/js/async/4421.42e889f6.js",
|
|
518
518
|
"__mf/js/async/4062.3ab7f987.js",
|
|
519
519
|
"__mf/js/async/212.bd5d617a.js",
|
|
@@ -546,8 +546,8 @@
|
|
|
546
546
|
"__mf/js/async/2675.99cf926f.js",
|
|
547
547
|
"__mf/js/async/5724.6ee6ec51.js",
|
|
548
548
|
"__mf/js/async/537.6911ea2e.js",
|
|
549
|
-
"__mf/js/async/5345.
|
|
550
|
-
"__mf/js/async/__federation_expose_PrometheusTimeSeriesQuery.
|
|
549
|
+
"__mf/js/async/5345.1f4fc17b.js",
|
|
550
|
+
"__mf/js/async/__federation_expose_PrometheusTimeSeriesQuery.fc3c5730.js"
|
|
551
551
|
],
|
|
552
552
|
"async": [
|
|
553
553
|
"__mf/js/async/1964.95da06f6.js",
|
|
@@ -567,7 +567,7 @@
|
|
|
567
567
|
"__mf/js/async/2675.99cf926f.js",
|
|
568
568
|
"__mf/js/async/5724.6ee6ec51.js",
|
|
569
569
|
"__mf/js/async/537.6911ea2e.js",
|
|
570
|
-
"__mf/js/async/5345.
|
|
570
|
+
"__mf/js/async/5345.1f4fc17b.js",
|
|
571
571
|
"__mf/js/async/__federation_expose_PrometheusLabelValuesVariable.a4085adb.js",
|
|
572
572
|
"__mf/js/async/__federation_expose_PrometheusLabelNamesVariable.8551745e.js",
|
|
573
573
|
"__mf/js/async/__federation_expose_PrometheusPromQLVariable.46f99477.js",
|
|
@@ -575,7 +575,7 @@
|
|
|
575
575
|
"__mf/js/async/7376.c7eb05b9.js",
|
|
576
576
|
"__mf/js/async/9550.e19763f8.js",
|
|
577
577
|
"__mf/js/async/3818.dde21d04.js",
|
|
578
|
-
"__mf/js/async/__federation_expose_PrometheusExplorer.
|
|
578
|
+
"__mf/js/async/__federation_expose_PrometheusExplorer.171d04eb.js",
|
|
579
579
|
"__mf/js/async/3871.6915e369.js",
|
|
580
580
|
"__mf/js/async/1465.3b5e12d5.js",
|
|
581
581
|
"__mf/js/async/528.d364bb0e.js",
|
|
@@ -586,7 +586,7 @@
|
|
|
586
586
|
"__mf/js/async/6292.7b8efa78.js",
|
|
587
587
|
"__mf/js/async/738.aca54e25.js",
|
|
588
588
|
"__mf/js/async/6377.ca974d89.js",
|
|
589
|
-
"__mf/js/async/5503.
|
|
589
|
+
"__mf/js/async/5503.daedd4dd.js",
|
|
590
590
|
"__mf/js/async/4421.42e889f6.js",
|
|
591
591
|
"__mf/js/async/4062.3ab7f987.js",
|
|
592
592
|
"__mf/js/async/212.bd5d617a.js",
|
|
@@ -621,7 +621,7 @@
|
|
|
621
621
|
"__mf/js/async/2675.99cf926f.js",
|
|
622
622
|
"__mf/js/async/5724.6ee6ec51.js",
|
|
623
623
|
"__mf/js/async/537.6911ea2e.js",
|
|
624
|
-
"__mf/js/async/5345.
|
|
624
|
+
"__mf/js/async/5345.1f4fc17b.js",
|
|
625
625
|
"__mf/js/async/__federation_expose_PrometheusLabelValuesVariable.a4085adb.js"
|
|
626
626
|
],
|
|
627
627
|
"async": [
|
|
@@ -643,7 +643,7 @@
|
|
|
643
643
|
"__mf/js/async/7376.c7eb05b9.js",
|
|
644
644
|
"__mf/js/async/9550.e19763f8.js",
|
|
645
645
|
"__mf/js/async/3818.dde21d04.js",
|
|
646
|
-
"__mf/js/async/__federation_expose_PrometheusExplorer.
|
|
646
|
+
"__mf/js/async/__federation_expose_PrometheusExplorer.171d04eb.js",
|
|
647
647
|
"__mf/js/async/3871.6915e369.js",
|
|
648
648
|
"__mf/js/async/1465.3b5e12d5.js",
|
|
649
649
|
"__mf/js/async/528.d364bb0e.js",
|
|
@@ -654,7 +654,7 @@
|
|
|
654
654
|
"__mf/js/async/6292.7b8efa78.js",
|
|
655
655
|
"__mf/js/async/738.aca54e25.js",
|
|
656
656
|
"__mf/js/async/6377.ca974d89.js",
|
|
657
|
-
"__mf/js/async/5503.
|
|
657
|
+
"__mf/js/async/5503.daedd4dd.js",
|
|
658
658
|
"__mf/js/async/4421.42e889f6.js",
|
|
659
659
|
"__mf/js/async/4062.3ab7f987.js",
|
|
660
660
|
"__mf/js/async/212.bd5d617a.js",
|
|
@@ -689,7 +689,7 @@
|
|
|
689
689
|
"__mf/js/async/2675.99cf926f.js",
|
|
690
690
|
"__mf/js/async/5724.6ee6ec51.js",
|
|
691
691
|
"__mf/js/async/537.6911ea2e.js",
|
|
692
|
-
"__mf/js/async/5345.
|
|
692
|
+
"__mf/js/async/5345.1f4fc17b.js",
|
|
693
693
|
"__mf/js/async/__federation_expose_PrometheusLabelNamesVariable.8551745e.js"
|
|
694
694
|
],
|
|
695
695
|
"async": [
|
|
@@ -711,7 +711,7 @@
|
|
|
711
711
|
"__mf/js/async/7376.c7eb05b9.js",
|
|
712
712
|
"__mf/js/async/9550.e19763f8.js",
|
|
713
713
|
"__mf/js/async/3818.dde21d04.js",
|
|
714
|
-
"__mf/js/async/__federation_expose_PrometheusExplorer.
|
|
714
|
+
"__mf/js/async/__federation_expose_PrometheusExplorer.171d04eb.js",
|
|
715
715
|
"__mf/js/async/3871.6915e369.js",
|
|
716
716
|
"__mf/js/async/1465.3b5e12d5.js",
|
|
717
717
|
"__mf/js/async/528.d364bb0e.js",
|
|
@@ -722,7 +722,7 @@
|
|
|
722
722
|
"__mf/js/async/6292.7b8efa78.js",
|
|
723
723
|
"__mf/js/async/738.aca54e25.js",
|
|
724
724
|
"__mf/js/async/6377.ca974d89.js",
|
|
725
|
-
"__mf/js/async/5503.
|
|
725
|
+
"__mf/js/async/5503.daedd4dd.js",
|
|
726
726
|
"__mf/js/async/4421.42e889f6.js",
|
|
727
727
|
"__mf/js/async/4062.3ab7f987.js",
|
|
728
728
|
"__mf/js/async/212.bd5d617a.js",
|
|
@@ -757,7 +757,7 @@
|
|
|
757
757
|
"__mf/js/async/2675.99cf926f.js",
|
|
758
758
|
"__mf/js/async/5724.6ee6ec51.js",
|
|
759
759
|
"__mf/js/async/537.6911ea2e.js",
|
|
760
|
-
"__mf/js/async/5345.
|
|
760
|
+
"__mf/js/async/5345.1f4fc17b.js",
|
|
761
761
|
"__mf/js/async/__federation_expose_PrometheusPromQLVariable.46f99477.js"
|
|
762
762
|
],
|
|
763
763
|
"async": [
|
|
@@ -779,7 +779,7 @@
|
|
|
779
779
|
"__mf/js/async/7376.c7eb05b9.js",
|
|
780
780
|
"__mf/js/async/9550.e19763f8.js",
|
|
781
781
|
"__mf/js/async/3818.dde21d04.js",
|
|
782
|
-
"__mf/js/async/__federation_expose_PrometheusExplorer.
|
|
782
|
+
"__mf/js/async/__federation_expose_PrometheusExplorer.171d04eb.js",
|
|
783
783
|
"__mf/js/async/3871.6915e369.js",
|
|
784
784
|
"__mf/js/async/1465.3b5e12d5.js",
|
|
785
785
|
"__mf/js/async/528.d364bb0e.js",
|
|
@@ -790,7 +790,7 @@
|
|
|
790
790
|
"__mf/js/async/6292.7b8efa78.js",
|
|
791
791
|
"__mf/js/async/738.aca54e25.js",
|
|
792
792
|
"__mf/js/async/6377.ca974d89.js",
|
|
793
|
-
"__mf/js/async/5503.
|
|
793
|
+
"__mf/js/async/5503.daedd4dd.js",
|
|
794
794
|
"__mf/js/async/4421.42e889f6.js",
|
|
795
795
|
"__mf/js/async/4062.3ab7f987.js",
|
|
796
796
|
"__mf/js/async/212.bd5d617a.js",
|
|
@@ -826,7 +826,7 @@
|
|
|
826
826
|
"__mf/js/async/7376.c7eb05b9.js",
|
|
827
827
|
"__mf/js/async/9550.e19763f8.js",
|
|
828
828
|
"__mf/js/async/3818.dde21d04.js",
|
|
829
|
-
"__mf/js/async/__federation_expose_PrometheusExplorer.
|
|
829
|
+
"__mf/js/async/__federation_expose_PrometheusExplorer.171d04eb.js"
|
|
830
830
|
],
|
|
831
831
|
"async": [
|
|
832
832
|
"__mf/js/async/1964.95da06f6.js",
|
|
@@ -848,8 +848,8 @@
|
|
|
848
848
|
"__mf/js/async/2675.99cf926f.js",
|
|
849
849
|
"__mf/js/async/5724.6ee6ec51.js",
|
|
850
850
|
"__mf/js/async/537.6911ea2e.js",
|
|
851
|
-
"__mf/js/async/5345.
|
|
852
|
-
"__mf/js/async/__federation_expose_PrometheusTimeSeriesQuery.
|
|
851
|
+
"__mf/js/async/5345.1f4fc17b.js",
|
|
852
|
+
"__mf/js/async/__federation_expose_PrometheusTimeSeriesQuery.fc3c5730.js",
|
|
853
853
|
"__mf/js/async/7272.a763aa92.js",
|
|
854
854
|
"__mf/js/async/__federation_expose_PrometheusLabelValuesVariable.a4085adb.js",
|
|
855
855
|
"__mf/js/async/__federation_expose_PrometheusLabelNamesVariable.8551745e.js",
|
|
@@ -861,7 +861,7 @@
|
|
|
861
861
|
"__mf/js/async/6292.7b8efa78.js",
|
|
862
862
|
"__mf/js/async/6377.ca974d89.js",
|
|
863
863
|
"__mf/js/async/3090.9fb5fe73.js",
|
|
864
|
-
"__mf/js/async/5503.
|
|
864
|
+
"__mf/js/async/5503.daedd4dd.js",
|
|
865
865
|
"__mf/js/async/4323.4266fd6a.js",
|
|
866
866
|
"__mf/js/async/3057.e568f9b6.js",
|
|
867
867
|
"__mf/js/async/7740.0c5363fd.js",
|