@perses-dev/plugin-system 0.49.0-rc.1 → 0.49.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.
@@ -38,6 +38,7 @@ const _jsxruntime = require("react/jsx-runtime");
38
38
  const _react = require("react");
39
39
  const _timeseriesqueries = require("../time-series-queries");
40
40
  const _tracequeries = require("../trace-queries");
41
+ const _UsageMetricsProvider = require("../UsageMetricsProvider");
41
42
  const _model = require("./model");
42
43
  const DataQueriesContext = /*#__PURE__*/ (0, _react.createContext)(undefined);
43
44
  function useDataQueriesContext() {
@@ -82,6 +83,7 @@ function DataQueriesProvider(props) {
82
83
  }
83
84
  };
84
85
  });
86
+ const usageMetrics = (0, _UsageMetricsProvider.useUsageMetrics)();
85
87
  // Filter definitions for time series query and other future query plugins
86
88
  const timeSeriesQueries = queryDefinitions.filter((definition)=>definition.kind === 'TimeSeriesQuery');
87
89
  const timeSeriesResults = (0, _timeseriesqueries.useTimeSeriesQueries)(timeSeriesQueries, options, queryOptions);
@@ -99,6 +101,17 @@ function DataQueriesProvider(props) {
99
101
  ...(0, _model.transformQueryResults)(timeSeriesResults, timeSeriesQueries),
100
102
  ...(0, _model.transformQueryResults)(traceResults, traceQueries)
101
103
  ];
104
+ if (queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.enabled) {
105
+ for (const result of mergedQueryResults){
106
+ if (!result.isLoading && !result.isFetching && !result.error) {
107
+ usageMetrics.markQuery(result.definition, 'success');
108
+ } else if (result.error) {
109
+ usageMetrics.markQuery(result.definition, 'error');
110
+ } else {
111
+ usageMetrics.markQuery(result.definition, 'pending');
112
+ }
113
+ }
114
+ }
102
115
  return {
103
116
  queryResults: mergedQueryResults,
104
117
  isFetching: mergedQueryResults.some((result)=>result.isFetching),
@@ -111,7 +124,9 @@ function DataQueriesProvider(props) {
111
124
  timeSeriesResults,
112
125
  traceQueries,
113
126
  traceResults,
114
- refetchAll
127
+ refetchAll,
128
+ queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.enabled,
129
+ usageMetrics
115
130
  ]);
116
131
  return /*#__PURE__*/ (0, _jsxruntime.jsx)(DataQueriesContext.Provider, {
117
132
  value: ctx,
@@ -0,0 +1,99 @@
1
+ // Copyright 2023 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ function _export(target, all) {
18
+ for(var name in all)Object.defineProperty(target, name, {
19
+ enumerable: true,
20
+ get: all[name]
21
+ });
22
+ }
23
+ _export(exports, {
24
+ UsageMetricsContext: function() {
25
+ return UsageMetricsContext;
26
+ },
27
+ UsageMetricsProvider: function() {
28
+ return UsageMetricsProvider;
29
+ },
30
+ useUsageMetrics: function() {
31
+ return useUsageMetrics;
32
+ },
33
+ useUsageMetricsContext: function() {
34
+ return useUsageMetricsContext;
35
+ }
36
+ });
37
+ const _jsxruntime = require("react/jsx-runtime");
38
+ const _core = require("@perses-dev/core");
39
+ const _react = require("react");
40
+ const UsageMetricsContext = /*#__PURE__*/ (0, _react.createContext)(undefined);
41
+ const useUsageMetricsContext = ()=>{
42
+ return (0, _react.useContext)(UsageMetricsContext);
43
+ };
44
+ const useUsageMetrics = ()=>{
45
+ const ctx = useUsageMetricsContext();
46
+ return {
47
+ markQuery: (definition, newState)=>{
48
+ if (ctx === undefined) {
49
+ return;
50
+ }
51
+ const definitionKey = JSON.stringify(definition);
52
+ if (ctx.pendingQueries.has(definitionKey) && newState === 'pending') {
53
+ // Never allow transitions back to pending, to avoid re-sending stats on a re-render.
54
+ return;
55
+ }
56
+ if (ctx.pendingQueries.get(definitionKey) !== newState) {
57
+ ctx.pendingQueries.set(definitionKey, newState);
58
+ if (newState === 'error') {
59
+ ctx.renderErrorCount += 1;
60
+ }
61
+ const allDone = [
62
+ ...ctx.pendingQueries.values()
63
+ ].every((p)=>p !== 'pending');
64
+ if (ctx.renderDurationMs === 0 && allDone) {
65
+ ctx.renderDurationMs = Date.now() - ctx.startRenderTime;
66
+ submitMetrics(ctx);
67
+ }
68
+ }
69
+ }
70
+ };
71
+ };
72
+ const submitMetrics = async (stats)=>{
73
+ await (0, _core.fetch)('/api/v1/view', {
74
+ method: 'POST',
75
+ headers: {
76
+ 'Content-Type': 'application/json'
77
+ },
78
+ body: JSON.stringify({
79
+ project: stats.project,
80
+ dashboard: stats.dashboard,
81
+ render_time: stats.renderDurationMs / 1000,
82
+ render_errors: stats.renderErrorCount
83
+ })
84
+ });
85
+ };
86
+ const UsageMetricsProvider = ({ project, dashboard, children })=>{
87
+ const ctx = {
88
+ project: project,
89
+ dashboard: dashboard,
90
+ renderErrorCount: 0,
91
+ startRenderTime: Date.now(),
92
+ renderDurationMs: 0,
93
+ pendingQueries: new Map()
94
+ };
95
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(UsageMetricsContext.Provider, {
96
+ value: ctx,
97
+ children: children
98
+ });
99
+ };
@@ -23,6 +23,7 @@ _export_star(require("./time-series-queries"), exports);
23
23
  _export_star(require("./trace-queries"), exports);
24
24
  _export_star(require("./DataQueriesProvider"), exports);
25
25
  _export_star(require("./QueryCountProvider"), exports);
26
+ _export_star(require("./UsageMetricsProvider"), exports);
26
27
  function _export_star(from, to) {
27
28
  Object.keys(from).forEach(function(k) {
28
29
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
@@ -1 +1 @@
1
- {"version":3,"file":"DataQueriesProvider.d.ts","sourceRoot":"","sources":["../../../src/runtime/DataQueriesProvider/DataQueriesProvider.tsx"],"names":[],"mappings":";AAcA,OAAO,EAAE,SAAS,EAA6B,MAAM,kBAAkB,CAAC;AAIxE,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EAEnB,sBAAsB,EAGvB,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,kBAAkB,6DAA+D,CAAC;AAE/F,wBAAgB,qBAAqB,2BAMpC;AAED,wBAAgB,cAAc,CAAC,CAAC,SAAS,MAAM,SAAS,EAAE,SAAS,EAAE,CAAC,GAAG,mBAAmB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAqBzG;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,2CA+ClE"}
1
+ {"version":3,"file":"DataQueriesProvider.d.ts","sourceRoot":"","sources":["../../../src/runtime/DataQueriesProvider/DataQueriesProvider.tsx"],"names":[],"mappings":";AAcA,OAAO,EAAE,SAAS,EAA6B,MAAM,kBAAkB,CAAC;AAKxE,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EAEnB,sBAAsB,EAGvB,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,kBAAkB,6DAA+D,CAAC;AAE/F,wBAAgB,qBAAqB,2BAMpC;AAED,wBAAgB,cAAc,CAAC,CAAC,SAAS,MAAM,SAAS,EAAE,SAAS,EAAE,CAAC,GAAG,mBAAmB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAqBzG;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,2CAqElE"}
@@ -14,6 +14,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
14
14
  import { createContext, useCallback, useContext, useMemo } from 'react';
15
15
  import { useTimeSeriesQueries } from '../time-series-queries';
16
16
  import { useTraceQueries } from '../trace-queries';
17
+ import { useUsageMetrics } from '../UsageMetricsProvider';
17
18
  import { transformQueryResults, useQueryType } from './model';
18
19
  export const DataQueriesContext = /*#__PURE__*/ createContext(undefined);
19
20
  export function useDataQueriesContext() {
@@ -58,6 +59,7 @@ export function DataQueriesProvider(props) {
58
59
  }
59
60
  };
60
61
  });
62
+ const usageMetrics = useUsageMetrics();
61
63
  // Filter definitions for time series query and other future query plugins
62
64
  const timeSeriesQueries = queryDefinitions.filter((definition)=>definition.kind === 'TimeSeriesQuery');
63
65
  const timeSeriesResults = useTimeSeriesQueries(timeSeriesQueries, options, queryOptions);
@@ -75,6 +77,17 @@ export function DataQueriesProvider(props) {
75
77
  ...transformQueryResults(timeSeriesResults, timeSeriesQueries),
76
78
  ...transformQueryResults(traceResults, traceQueries)
77
79
  ];
80
+ if (queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.enabled) {
81
+ for (const result of mergedQueryResults){
82
+ if (!result.isLoading && !result.isFetching && !result.error) {
83
+ usageMetrics.markQuery(result.definition, 'success');
84
+ } else if (result.error) {
85
+ usageMetrics.markQuery(result.definition, 'error');
86
+ } else {
87
+ usageMetrics.markQuery(result.definition, 'pending');
88
+ }
89
+ }
90
+ }
78
91
  return {
79
92
  queryResults: mergedQueryResults,
80
93
  isFetching: mergedQueryResults.some((result)=>result.isFetching),
@@ -87,7 +100,9 @@ export function DataQueriesProvider(props) {
87
100
  timeSeriesResults,
88
101
  traceQueries,
89
102
  traceResults,
90
- refetchAll
103
+ refetchAll,
104
+ queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.enabled,
105
+ usageMetrics
91
106
  ]);
92
107
  return /*#__PURE__*/ _jsx(DataQueriesContext.Provider, {
93
108
  value: ctx,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/runtime/DataQueriesProvider/DataQueriesProvider.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 { createContext, useCallback, useContext, useMemo } from 'react';\nimport { QueryType, TimeSeriesQueryDefinition } from '@perses-dev/core';\nimport { useTimeSeriesQueries } from '../time-series-queries';\nimport { useTraceQueries, TraceQueryDefinition } from '../trace-queries';\n\nimport {\n DataQueriesProviderProps,\n UseDataQueryResults,\n transformQueryResults,\n DataQueriesContextType,\n QueryData,\n useQueryType,\n} from './model';\n\nexport const DataQueriesContext = createContext<DataQueriesContextType | undefined>(undefined);\n\nexport function useDataQueriesContext() {\n const ctx = useContext(DataQueriesContext);\n if (ctx === undefined) {\n throw new Error('No DataQueriesContext found. Did you forget a Provider?');\n }\n return ctx;\n}\n\nexport function useDataQueries<T extends keyof QueryType>(queryType: T): UseDataQueryResults<QueryType[T]> {\n const ctx = useDataQueriesContext();\n\n // Filter the query results based on the specified query type\n const filteredQueryResults = ctx.queryResults.filter(\n (queryResult) => queryResult?.definition?.kind === queryType\n ) as Array<QueryData<QueryType[T]>>;\n\n // Filter the errors based on the specified query type\n const filteredErrors = ctx.errors.filter((errors, index) => ctx.queryResults[index]?.definition?.kind === queryType);\n\n // Create a new context object with the filtered results and errors\n const filteredCtx = {\n queryResults: filteredQueryResults,\n isFetching: filteredQueryResults.some((result) => result.isFetching),\n isLoading: filteredQueryResults.some((result) => result.isLoading),\n refetchAll: ctx.refetchAll,\n errors: filteredErrors,\n };\n\n return filteredCtx;\n}\n\nexport function DataQueriesProvider(props: DataQueriesProviderProps) {\n const { definitions, options, children, queryOptions } = props;\n\n // Returns a query kind, for example \"TimeSeriesQuery\" = getQueryType(\"PrometheusTimeSeriesQuery\")\n const getQueryType = useQueryType();\n\n const queryDefinitions = definitions.map((definition) => {\n const type = getQueryType(definition.kind);\n return {\n kind: type,\n spec: {\n plugin: definition,\n },\n };\n });\n\n // Filter definitions for time series query and other future query plugins\n const timeSeriesQueries = queryDefinitions.filter(\n (definition) => definition.kind === 'TimeSeriesQuery'\n ) as TimeSeriesQueryDefinition[];\n const timeSeriesResults = useTimeSeriesQueries(timeSeriesQueries, options, queryOptions);\n const traceQueries = queryDefinitions.filter(\n (definition) => definition.kind === 'TraceQuery'\n ) as TraceQueryDefinition[];\n const traceResults = useTraceQueries(traceQueries);\n\n const refetchAll = useCallback(() => {\n timeSeriesResults.forEach((result) => result.refetch());\n traceResults.forEach((result) => result.refetch());\n }, [timeSeriesResults, traceResults]);\n\n const ctx = useMemo(() => {\n const mergedQueryResults = [\n ...transformQueryResults(timeSeriesResults, timeSeriesQueries),\n ...transformQueryResults(traceResults, traceQueries),\n ];\n\n return {\n queryResults: mergedQueryResults,\n isFetching: mergedQueryResults.some((result) => result.isFetching),\n isLoading: mergedQueryResults.some((result) => result.isLoading),\n refetchAll,\n errors: mergedQueryResults.map((result) => result.error),\n };\n }, [timeSeriesQueries, timeSeriesResults, traceQueries, traceResults, refetchAll]);\n\n return <DataQueriesContext.Provider value={ctx}>{children}</DataQueriesContext.Provider>;\n}\n"],"names":["createContext","useCallback","useContext","useMemo","useTimeSeriesQueries","useTraceQueries","transformQueryResults","useQueryType","DataQueriesContext","undefined","useDataQueriesContext","ctx","Error","useDataQueries","queryType","filteredQueryResults","queryResults","filter","queryResult","definition","kind","filteredErrors","errors","index","filteredCtx","isFetching","some","result","isLoading","refetchAll","DataQueriesProvider","props","definitions","options","children","queryOptions","getQueryType","queryDefinitions","map","type","spec","plugin","timeSeriesQueries","timeSeriesResults","traceQueries","traceResults","forEach","refetch","mergedQueryResults","error","Provider","value"],"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,aAAa,EAAEC,WAAW,EAAEC,UAAU,EAAEC,OAAO,QAAQ,QAAQ;AAExE,SAASC,oBAAoB,QAAQ,yBAAyB;AAC9D,SAASC,eAAe,QAA8B,mBAAmB;AAEzE,S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0EAA0E;IAC1E,MAAMuB,oBAAoBL,iBAAiBpB,MAAM,CAC/C,CAACE,aAAeA,WAAWC,IAAI,KAAK;IAEtC,MAAMuB,oBAAoBvC,qBAAqBsC,mBAAmBT,SAASE;IAC3E,MAAMS,eAAeP,iBAAiBpB,MAAM,CAC1C,CAACE,aAAeA,WAAWC,IAAI,KAAK;IAEtC,MAAMyB,eAAexC,gBAAgBuC;IAErC,MAAMf,aAAa5B,YAAY;QAC7B0C,kBAAkBG,OAAO,CAAC,CAACnB,SAAWA,OAAOoB,OAAO;QACpDF,aAAaC,OAAO,CAAC,CAACnB,SAAWA,OAAOoB,OAAO;IACjD,GAAG;QAACJ;QAAmBE;KAAa;IAEpC,MAAMlC,MAAMR,QAAQ;QAClB,MAAM6C,qBAAqB;eACtB1C,sBAAsBqC,mBAAmBD;eACzCpC,sBAAsBuC,cAAcD;SACxC;QAED,OAAO;YACL5B,cAAcgC;YACdvB,YAAYuB,mBAAmBtB,IAAI,CAAC,CAACC,SAAWA,OAAOF,UAAU;YACjEG,WAAWoB,mBAAmBtB,IAAI,CAAC,CAACC,SAAWA,OAAOC,SAAS;YAC/DC;YACAP,QAAQ0B,mBAAmBV,GAAG,CAAC,CAACX,SAAWA,OAAOsB,KAAK;QACzD;IACF,GAAG;QAACP;QAAmBC;QAAmBC;QAAcC;QAAchB;KAAW;IAEjF,qBAAO,KAACrB,mBAAmB0C,QAAQ;QAACC,OAAOxC;kBAAMuB;;AACnD"}
1
+ {"version":3,"sources":["../../../src/runtime/DataQueriesProvider/DataQueriesProvider.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 { createContext, useCallback, useContext, useMemo } from 'react';\nimport { QueryType, TimeSeriesQueryDefinition } from '@perses-dev/core';\nimport { useTimeSeriesQueries } from '../time-series-queries';\nimport { useTraceQueries, TraceQueryDefinition } from '../trace-queries';\n\nimport { useUsageMetrics } from '../UsageMetricsProvider';\nimport {\n DataQueriesProviderProps,\n UseDataQueryResults,\n transformQueryResults,\n DataQueriesContextType,\n QueryData,\n useQueryType,\n} from './model';\n\nexport const DataQueriesContext = createContext<DataQueriesContextType | undefined>(undefined);\n\nexport function useDataQueriesContext() {\n const ctx = useContext(DataQueriesContext);\n if (ctx === undefined) {\n throw new Error('No DataQueriesContext found. Did you forget a Provider?');\n }\n return ctx;\n}\n\nexport function useDataQueries<T extends keyof QueryType>(queryType: T): UseDataQueryResults<QueryType[T]> {\n const ctx = useDataQueriesContext();\n\n // Filter the query results based on the specified query type\n const filteredQueryResults = ctx.queryResults.filter(\n (queryResult) => queryResult?.definition?.kind === queryType\n ) as Array<QueryData<QueryType[T]>>;\n\n // Filter the errors based on the specified query type\n const filteredErrors = ctx.errors.filter((errors, index) => ctx.queryResults[index]?.definition?.kind === queryType);\n\n // Create a new context object with the filtered results and errors\n const filteredCtx = {\n queryResults: filteredQueryResults,\n isFetching: filteredQueryResults.some((result) => result.isFetching),\n isLoading: filteredQueryResults.some((result) => result.isLoading),\n refetchAll: ctx.refetchAll,\n errors: filteredErrors,\n };\n\n return filteredCtx;\n}\n\nexport function DataQueriesProvider(props: DataQueriesProviderProps) {\n const { definitions, options, children, queryOptions } = props;\n\n // Returns a query kind, for example \"TimeSeriesQuery\" = getQueryType(\"PrometheusTimeSeriesQuery\")\n const getQueryType = useQueryType();\n\n const queryDefinitions = definitions.map((definition) => {\n const type = getQueryType(definition.kind);\n return {\n kind: type,\n spec: {\n plugin: definition,\n },\n };\n });\n\n const usageMetrics = useUsageMetrics();\n\n // Filter definitions for time series query and other future query plugins\n const timeSeriesQueries = queryDefinitions.filter(\n (definition) => definition.kind === 'TimeSeriesQuery'\n ) as TimeSeriesQueryDefinition[];\n const timeSeriesResults = useTimeSeriesQueries(timeSeriesQueries, options, queryOptions);\n const traceQueries = queryDefinitions.filter(\n (definition) => definition.kind === 'TraceQuery'\n ) as TraceQueryDefinition[];\n const traceResults = useTraceQueries(traceQueries);\n\n const refetchAll = useCallback(() => {\n timeSeriesResults.forEach((result) => result.refetch());\n traceResults.forEach((result) => result.refetch());\n }, [timeSeriesResults, traceResults]);\n\n const ctx = useMemo(() => {\n const mergedQueryResults = [\n ...transformQueryResults(timeSeriesResults, timeSeriesQueries),\n ...transformQueryResults(traceResults, traceQueries),\n ];\n\n if (queryOptions?.enabled) {\n for (const result of mergedQueryResults) {\n if (!result.isLoading && !result.isFetching && !result.error) {\n usageMetrics.markQuery(result.definition, 'success');\n } else if (result.error) {\n usageMetrics.markQuery(result.definition, 'error');\n } else {\n usageMetrics.markQuery(result.definition, 'pending');\n }\n }\n }\n\n return {\n queryResults: mergedQueryResults,\n isFetching: mergedQueryResults.some((result) => result.isFetching),\n isLoading: mergedQueryResults.some((result) => result.isLoading),\n refetchAll,\n errors: mergedQueryResults.map((result) => result.error),\n };\n }, [\n timeSeriesQueries,\n timeSeriesResults,\n traceQueries,\n traceResults,\n refetchAll,\n queryOptions?.enabled,\n usageMetrics,\n ]);\n\n return <DataQueriesContext.Provider value={ctx}>{children}</DataQueriesContext.Provider>;\n}\n"],"names":["createContext","useCallback","useContext","useMemo","useTimeSeriesQueries","useTraceQueries","useUsageMetrics","transformQueryResults","useQueryType","DataQueriesContext","undefined","useDataQueriesContext","ctx","Error","useDataQueries","queryType","filteredQueryResults","queryResults","filter","queryResult","definition","kind","filteredErrors","errors","index","filteredCtx","isFetching","some","result","isLoading","refetchAll","DataQueriesProvider","props","definitions","options","children","queryOptions","getQueryType","queryDefinitions","map","type","spec","plugin","usageMetrics","timeSeriesQueries","timeSeriesResults","traceQueries","traceResults","forEach","refetch","mergedQueryResults","enabled","error","markQuery","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,CAACzB,OAAOR,UAAU,EAAE;gBAC5C,OAAO;oBACLuB,aAAaU,SAAS,CAACzB,OAAOR,UAAU,EAAE;gBAC5C;YACF;QACF;QAEA,OAAO;YACLH,cAAciC;YACdxB,YAAYwB,mBAAmBvB,IAAI,CAAC,CAACC,SAAWA,OAAOF,UAAU;YACjEG,WAAWqB,mBAAmBvB,IAAI,CAAC,CAACC,SAAWA,OAAOC,SAAS;YAC/DC;YACAP,QAAQ2B,mBAAmBX,GAAG,CAAC,CAACX,SAAWA,OAAOwB,KAAK;QACzD;IACF,GAAG;QACDR;QACAC;QACAC;QACAC;QACAjB;QACAM,yBAAAA,mCAAAA,aAAce,OAAO;QACrBR;KACD;IAED,qBAAO,KAAClC,mBAAmB6C,QAAQ;QAACC,OAAO3C;kBAAMuB;;AACnD"}
@@ -0,0 +1,25 @@
1
+ import { QueryDefinition } from '@perses-dev/core';
2
+ import { ReactNode } from 'react';
3
+ type QueryState = 'pending' | 'success' | 'error';
4
+ interface UsageMetrics {
5
+ project: string;
6
+ dashboard: string;
7
+ startRenderTime: number;
8
+ renderDurationMs: number;
9
+ renderErrorCount: number;
10
+ pendingQueries: Map<string, QueryState>;
11
+ }
12
+ interface UsageMetricsProps {
13
+ project: string;
14
+ dashboard: string;
15
+ children: ReactNode;
16
+ }
17
+ interface UseUsageMetricsResults {
18
+ markQuery: (definition: QueryDefinition, state: QueryState) => void;
19
+ }
20
+ export declare const UsageMetricsContext: import("react").Context<UsageMetrics | undefined>;
21
+ export declare const useUsageMetricsContext: () => UsageMetrics | undefined;
22
+ export declare const useUsageMetrics: () => UseUsageMetricsResults;
23
+ export declare const UsageMetricsProvider: ({ project, dashboard, children }: UsageMetricsProps) => import("react/jsx-runtime").JSX.Element;
24
+ export {};
25
+ //# sourceMappingURL=UsageMetricsProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UsageMetricsProvider.d.ts","sourceRoot":"","sources":["../../src/runtime/UsageMetricsProvider.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAS,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAiB,SAAS,EAAc,MAAM,OAAO,CAAC;AAE7D,KAAK,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAElD,UAAU,YAAY;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;CACzC;AAED,UAAU,iBAAiB;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,UAAU,sBAAsB;IAC9B,SAAS,EAAE,CAAC,UAAU,EAAE,eAAe,EAAE,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;CACrE;AAED,eAAO,MAAM,mBAAmB,mDAAqD,CAAC;AAEtF,eAAO,MAAM,sBAAsB,gCAElC,CAAC;AAEF,eAAO,MAAM,eAAe,QAAO,sBA6BlC,CAAC;AAiBF,eAAO,MAAM,oBAAoB,qCAAsC,iBAAiB,4CAWvF,CAAC"}
@@ -0,0 +1,77 @@
1
+ // Copyright 2023 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ import { jsx as _jsx } from "react/jsx-runtime";
14
+ import { fetch } from '@perses-dev/core';
15
+ import { createContext, useContext } from 'react';
16
+ export const UsageMetricsContext = /*#__PURE__*/ createContext(undefined);
17
+ export const useUsageMetricsContext = ()=>{
18
+ return useContext(UsageMetricsContext);
19
+ };
20
+ export const useUsageMetrics = ()=>{
21
+ const ctx = useUsageMetricsContext();
22
+ return {
23
+ markQuery: (definition, newState)=>{
24
+ if (ctx === undefined) {
25
+ return;
26
+ }
27
+ const definitionKey = JSON.stringify(definition);
28
+ if (ctx.pendingQueries.has(definitionKey) && newState === 'pending') {
29
+ // Never allow transitions back to pending, to avoid re-sending stats on a re-render.
30
+ return;
31
+ }
32
+ if (ctx.pendingQueries.get(definitionKey) !== newState) {
33
+ ctx.pendingQueries.set(definitionKey, newState);
34
+ if (newState === 'error') {
35
+ ctx.renderErrorCount += 1;
36
+ }
37
+ const allDone = [
38
+ ...ctx.pendingQueries.values()
39
+ ].every((p)=>p !== 'pending');
40
+ if (ctx.renderDurationMs === 0 && allDone) {
41
+ ctx.renderDurationMs = Date.now() - ctx.startRenderTime;
42
+ submitMetrics(ctx);
43
+ }
44
+ }
45
+ }
46
+ };
47
+ };
48
+ const submitMetrics = async (stats)=>{
49
+ await fetch('/api/v1/view', {
50
+ method: 'POST',
51
+ headers: {
52
+ 'Content-Type': 'application/json'
53
+ },
54
+ body: JSON.stringify({
55
+ project: stats.project,
56
+ dashboard: stats.dashboard,
57
+ render_time: stats.renderDurationMs / 1000,
58
+ render_errors: stats.renderErrorCount
59
+ })
60
+ });
61
+ };
62
+ export const UsageMetricsProvider = ({ project, dashboard, children })=>{
63
+ const ctx = {
64
+ project: project,
65
+ dashboard: dashboard,
66
+ renderErrorCount: 0,
67
+ startRenderTime: Date.now(),
68
+ renderDurationMs: 0,
69
+ pendingQueries: new Map()
70
+ };
71
+ return /*#__PURE__*/ _jsx(UsageMetricsContext.Provider, {
72
+ value: ctx,
73
+ children: children
74
+ });
75
+ };
76
+
77
+ //# sourceMappingURL=UsageMetricsProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/runtime/UsageMetricsProvider.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 { fetch, QueryDefinition } from '@perses-dev/core';\nimport { createContext, ReactNode, useContext } from 'react';\n\ntype QueryState = 'pending' | 'success' | 'error';\n\ninterface UsageMetrics {\n project: string;\n dashboard: string;\n startRenderTime: number;\n renderDurationMs: number;\n renderErrorCount: number;\n pendingQueries: Map<string, QueryState>;\n}\n\ninterface UsageMetricsProps {\n project: string;\n dashboard: string;\n children: ReactNode;\n}\n\ninterface UseUsageMetricsResults {\n markQuery: (definition: QueryDefinition, state: QueryState) => void;\n}\n\nexport const UsageMetricsContext = createContext<UsageMetrics | undefined>(undefined);\n\nexport const useUsageMetricsContext = () => {\n return useContext(UsageMetricsContext);\n};\n\nexport const useUsageMetrics = (): UseUsageMetricsResults => {\n const ctx = useUsageMetricsContext();\n\n return {\n markQuery: (definition: QueryDefinition, newState: QueryState) => {\n if (ctx === undefined) {\n return;\n }\n\n const definitionKey = JSON.stringify(definition);\n if (ctx.pendingQueries.has(definitionKey) && newState === 'pending') {\n // Never allow transitions back to pending, to avoid re-sending stats on a re-render.\n return;\n }\n\n if (ctx.pendingQueries.get(definitionKey) !== newState) {\n ctx.pendingQueries.set(definitionKey, newState);\n if (newState === 'error') {\n ctx.renderErrorCount += 1;\n }\n\n const allDone = [...ctx.pendingQueries.values()].every((p) => p !== 'pending');\n if (ctx.renderDurationMs === 0 && allDone) {\n ctx.renderDurationMs = Date.now() - ctx.startRenderTime;\n submitMetrics(ctx);\n }\n }\n },\n };\n};\n\nconst submitMetrics = async (stats: UsageMetrics) => {\n await fetch('/api/v1/view', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n project: stats.project,\n dashboard: stats.dashboard,\n render_time: stats.renderDurationMs / 1000,\n render_errors: stats.renderErrorCount,\n }),\n });\n};\n\nexport const UsageMetricsProvider = ({ project, dashboard, children }: UsageMetricsProps) => {\n const ctx = {\n project: project,\n dashboard: dashboard,\n renderErrorCount: 0,\n startRenderTime: Date.now(),\n renderDurationMs: 0,\n pendingQueries: new Map(),\n };\n\n return <UsageMetricsContext.Provider value={ctx}>{children}</UsageMetricsContext.Provider>;\n};\n"],"names":["fetch","createContext","useContext","UsageMetricsContext","undefined","useUsageMetricsContext","useUsageMetrics","ctx","markQuery","definition","newState","definitionKey","JSON","stringify","pendingQueries","has","get","set","renderErrorCount","allDone","values","every","p","renderDurationMs","Date","now","startRenderTime","submitMetrics","stats","method","headers","body","project","dashboard","render_time","render_errors","UsageMetricsProvider","children","Map","Provider","value"],"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,KAAK,QAAyB,mBAAmB;AAC1D,SAASC,aAAa,EAAaC,UAAU,QAAQ,QAAQ;AAuB7D,OAAO,MAAMC,oCAAsBF,cAAwCG,WAAW;AAEtF,OAAO,MAAMC,yBAAyB;IACpC,OAAOH,WAAWC;AACpB,EAAE;AAEF,OAAO,MAAMG,kBAAkB;IAC7B,MAAMC,MAAMF;IAEZ,OAAO;QACLG,WAAW,CAACC,YAA6BC;YACvC,IAAIH,QAAQH,WAAW;gBACrB;YACF;YAEA,MAAMO,gBAAgBC,KAAKC,SAAS,CAACJ;YACrC,IAAIF,IAAIO,cAAc,CAACC,GAAG,CAACJ,kBAAkBD,aAAa,WAAW;gBACnE,qFAAqF;gBACrF;YACF;YAEA,IAAIH,IAAIO,cAAc,CAACE,GAAG,CAACL,mBAAmBD,UAAU;gBACtDH,IAAIO,cAAc,CAACG,GAAG,CAACN,eAAeD;gBACtC,IAAIA,aAAa,SAAS;oBACxBH,IAAIW,gBAAgB,IAAI;gBAC1B;gBAEA,MAAMC,UAAU;uBAAIZ,IAAIO,cAAc,CAACM,MAAM;iBAAG,CAACC,KAAK,CAAC,CAACC,IAAMA,MAAM;gBACpE,IAAIf,IAAIgB,gBAAgB,KAAK,KAAKJ,SAAS;oBACzCZ,IAAIgB,gBAAgB,GAAGC,KAAKC,GAAG,KAAKlB,IAAImB,eAAe;oBACvDC,cAAcpB;gBAChB;YACF;QACF;IACF;AACF,EAAE;AAEF,MAAMoB,gBAAgB,OAAOC;IAC3B,MAAM5B,MAAM,gBAAgB;QAC1B6B,QAAQ;QACRC,SAAS;YACP,gBAAgB;QAClB;QACAC,MAAMnB,KAAKC,SAAS,CAAC;YACnBmB,SAASJ,MAAMI,OAAO;YACtBC,WAAWL,MAAMK,SAAS;YAC1BC,aAAaN,MAAML,gBAAgB,GAAG;YACtCY,eAAeP,MAAMV,gBAAgB;QACvC;IACF;AACF;AAEA,OAAO,MAAMkB,uBAAuB,CAAC,EAAEJ,OAAO,EAAEC,SAAS,EAAEI,QAAQ,EAAqB;IACtF,MAAM9B,MAAM;QACVyB,SAASA;QACTC,WAAWA;QACXf,kBAAkB;QAClBQ,iBAAiBF,KAAKC,GAAG;QACzBF,kBAAkB;QAClBT,gBAAgB,IAAIwB;IACtB;IAEA,qBAAO,KAACnC,oBAAoBoC,QAAQ;QAACC,OAAOjC;kBAAM8B;;AACpD,EAAE"}
@@ -7,4 +7,5 @@ export * from './time-series-queries';
7
7
  export * from './trace-queries';
8
8
  export * from './DataQueriesProvider';
9
9
  export * from './QueryCountProvider';
10
+ export * from './UsageMetricsProvider';
10
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAaA,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAaA,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC"}
@@ -19,5 +19,6 @@ export * from './time-series-queries';
19
19
  export * from './trace-queries';
20
20
  export * from './DataQueriesProvider';
21
21
  export * from './QueryCountProvider';
22
+ export * from './UsageMetricsProvider';
22
23
 
23
24
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/runtime/index.ts"],"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\nexport * from './builtin-variables';\nexport * from './datasources';\nexport * from './plugin-registry';\nexport * from './variables';\nexport * from './TimeRangeProvider';\nexport * from './time-series-queries';\nexport * from './trace-queries';\nexport * from './DataQueriesProvider';\nexport * from './QueryCountProvider';\n"],"names":[],"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,cAAc,sBAAsB;AACpC,cAAc,gBAAgB;AAC9B,cAAc,oBAAoB;AAClC,cAAc,cAAc;AAC5B,cAAc,sBAAsB;AACpC,cAAc,wBAAwB;AACtC,cAAc,kBAAkB;AAChC,cAAc,wBAAwB;AACtC,cAAc,uBAAuB"}
1
+ {"version":3,"sources":["../../src/runtime/index.ts"],"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\nexport * from './builtin-variables';\nexport * from './datasources';\nexport * from './plugin-registry';\nexport * from './variables';\nexport * from './TimeRangeProvider';\nexport * from './time-series-queries';\nexport * from './trace-queries';\nexport * from './DataQueriesProvider';\nexport * from './QueryCountProvider';\nexport * from './UsageMetricsProvider';\n"],"names":[],"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,cAAc,sBAAsB;AACpC,cAAc,gBAAgB;AAC9B,cAAc,oBAAoB;AAClC,cAAc,cAAc;AAC5B,cAAc,sBAAsB;AACpC,cAAc,wBAAwB;AACtC,cAAc,kBAAkB;AAChC,cAAc,wBAAwB;AACtC,cAAc,uBAAuB;AACrC,cAAc,yBAAyB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@perses-dev/plugin-system",
3
- "version": "0.49.0-rc.1",
3
+ "version": "0.49.0",
4
4
  "description": "The plugin feature in Pereses",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/perses/perses/blob/main/README.md",
@@ -28,8 +28,8 @@
28
28
  "lint:fix": "eslint --fix src --ext .ts,.tsx"
29
29
  },
30
30
  "dependencies": {
31
- "@perses-dev/components": "0.49.0-rc.1",
32
- "@perses-dev/core": "0.49.0-rc.1",
31
+ "@perses-dev/components": "0.49.0",
32
+ "@perses-dev/core": "0.49.0",
33
33
  "date-fns": "^2.30.0",
34
34
  "immer": "^9.0.15",
35
35
  "react-hook-form": "^7.46.1",
@@ -38,7 +38,7 @@
38
38
  "zod": "^3.22.2"
39
39
  },
40
40
  "devDependencies": {
41
- "@perses-dev/storybook": "0.49.0-rc.1"
41
+ "@perses-dev/storybook": "0.49.0"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "@mui/material": "^5.15.20",