@perses-dev/pyroscope-plugin 0.5.0-beta.0 → 0.5.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.
Files changed (144) hide show
  1. package/__mf/js/{Pyroscope.2cc96a50.js → Pyroscope.bfbb30fc.js} +5 -5
  2. package/__mf/js/async/1728.5a1ce5fd.js +1 -0
  3. package/__mf/js/async/2488.1263bef3.js +7 -0
  4. package/__mf/js/async/392.9a585980.js +2 -0
  5. package/__mf/js/async/4657.cd5be1f7.js +2 -0
  6. package/__mf/js/async/54.ad215e09.js +22 -0
  7. package/__mf/js/async/5440.8c124a65.js +2 -0
  8. package/__mf/js/async/{5440.f3809507.js.LICENSE.txt → 5440.8c124a65.js.LICENSE.txt} +3 -3
  9. package/__mf/js/async/9010.f18f7884.js +2 -0
  10. package/__mf/js/async/{7570.a8cf961f.js → 9025.b66d1100.js} +1 -1
  11. package/__mf/js/async/{8035.39b8a613.js → 9877.4eb72ec5.js} +9 -9
  12. package/__mf/js/async/{__federation_expose_PyroscopeDatasource.108cb2d6.js → __federation_expose_PyroscopeDatasource.deb0c623.js} +2 -2
  13. package/__mf/js/async/{__federation_expose_PyroscopeExplorer.f9864130.js → __federation_expose_PyroscopeExplorer.b2a1605a.js} +2 -2
  14. package/__mf/js/async/{__federation_expose_PyroscopeProfileQuery.58db5efb.js → __federation_expose_PyroscopeProfileQuery.adcc14cb.js} +2 -2
  15. package/__mf/js/{main.b6d04adf.js → main.378262c7.js} +3 -3
  16. package/lib/bootstrap.js +1 -1
  17. package/lib/bootstrap.js.map +1 -1
  18. package/lib/cjs/bootstrap.js +1 -1
  19. package/lib/cjs/components/AddFilterItem.js +1 -1
  20. package/lib/cjs/components/DeleteFilterItem.js +1 -1
  21. package/lib/cjs/components/FilterItem.js +1 -1
  22. package/lib/cjs/components/Filters.js +1 -1
  23. package/lib/cjs/components/LabelName.js +1 -1
  24. package/lib/cjs/components/LabelValue.js +1 -1
  25. package/lib/cjs/components/Operator.js +1 -1
  26. package/lib/cjs/components/ProfileTypeSelector.js +1 -1
  27. package/lib/cjs/components/Service.js +1 -1
  28. package/lib/cjs/components/index.js +1 -1
  29. package/lib/cjs/env.d.js +1 -1
  30. package/lib/cjs/explore/PyroscopeExplorer.js +1 -1
  31. package/lib/cjs/explore/index.js +1 -1
  32. package/lib/cjs/getPluginModule.js +1 -1
  33. package/lib/cjs/index-federation.js +1 -1
  34. package/lib/cjs/index.js +1 -1
  35. package/lib/cjs/model/api-types.js +1 -1
  36. package/lib/cjs/model/index.js +1 -1
  37. package/lib/cjs/model/profile-query-model.js +1 -1
  38. package/lib/cjs/model/pyroscope-client.js +1 -1
  39. package/lib/cjs/model/pyroscope-selectors.js +1 -1
  40. package/lib/cjs/plugins/PyroscopeDatasourceEditor.js +1 -1
  41. package/lib/cjs/plugins/index.js +1 -1
  42. package/lib/cjs/plugins/pyroscope-datasource-types.js +1 -1
  43. package/lib/cjs/plugins/pyroscope-datasource.js +1 -1
  44. package/lib/cjs/plugins/pyroscope-profile-query/PyroscopeProfileQuery.js +1 -1
  45. package/lib/cjs/plugins/pyroscope-profile-query/PyroscopeProfileQueryEditor.js +1 -1
  46. package/lib/cjs/plugins/pyroscope-profile-query/get-profile-data.js +1 -1
  47. package/lib/cjs/plugins/pyroscope-profile-query/index.js +1 -1
  48. package/lib/cjs/plugins/pyroscope-profile-query/query-editor-model.js +1 -1
  49. package/lib/cjs/setup-tests.js +1 -1
  50. package/lib/cjs/test/index.js +1 -1
  51. package/lib/cjs/test/mock-data.js +1 -1
  52. package/lib/cjs/test/setup-tests.js +1 -1
  53. package/lib/cjs/utils/types.js +1 -1
  54. package/lib/cjs/utils/use-query.js +1 -1
  55. package/lib/components/AddFilterItem.js +1 -1
  56. package/lib/components/AddFilterItem.js.map +1 -1
  57. package/lib/components/DeleteFilterItem.js +1 -1
  58. package/lib/components/DeleteFilterItem.js.map +1 -1
  59. package/lib/components/FilterItem.js +1 -1
  60. package/lib/components/FilterItem.js.map +1 -1
  61. package/lib/components/Filters.js +1 -1
  62. package/lib/components/Filters.js.map +1 -1
  63. package/lib/components/LabelName.js +1 -1
  64. package/lib/components/LabelName.js.map +1 -1
  65. package/lib/components/LabelValue.js +1 -1
  66. package/lib/components/LabelValue.js.map +1 -1
  67. package/lib/components/Operator.js +1 -1
  68. package/lib/components/Operator.js.map +1 -1
  69. package/lib/components/ProfileTypeSelector.js +1 -1
  70. package/lib/components/ProfileTypeSelector.js.map +1 -1
  71. package/lib/components/Service.js +1 -1
  72. package/lib/components/Service.js.map +1 -1
  73. package/lib/components/index.js +1 -1
  74. package/lib/components/index.js.map +1 -1
  75. package/lib/env.d.js +1 -1
  76. package/lib/env.d.js.map +1 -1
  77. package/lib/explore/PyroscopeExplorer.js +1 -1
  78. package/lib/explore/PyroscopeExplorer.js.map +1 -1
  79. package/lib/explore/index.js +1 -1
  80. package/lib/explore/index.js.map +1 -1
  81. package/lib/getPluginModule.js +1 -1
  82. package/lib/getPluginModule.js.map +1 -1
  83. package/lib/index-federation.js +1 -1
  84. package/lib/index-federation.js.map +1 -1
  85. package/lib/index.js +1 -1
  86. package/lib/index.js.map +1 -1
  87. package/lib/model/api-types.js +1 -1
  88. package/lib/model/api-types.js.map +1 -1
  89. package/lib/model/index.js +1 -1
  90. package/lib/model/index.js.map +1 -1
  91. package/lib/model/profile-query-model.js +1 -1
  92. package/lib/model/profile-query-model.js.map +1 -1
  93. package/lib/model/pyroscope-client.js +1 -1
  94. package/lib/model/pyroscope-client.js.map +1 -1
  95. package/lib/model/pyroscope-selectors.js +1 -1
  96. package/lib/model/pyroscope-selectors.js.map +1 -1
  97. package/lib/plugins/PyroscopeDatasourceEditor.js +1 -1
  98. package/lib/plugins/PyroscopeDatasourceEditor.js.map +1 -1
  99. package/lib/plugins/index.js +1 -1
  100. package/lib/plugins/index.js.map +1 -1
  101. package/lib/plugins/pyroscope-datasource-types.js +1 -1
  102. package/lib/plugins/pyroscope-datasource-types.js.map +1 -1
  103. package/lib/plugins/pyroscope-datasource.js +1 -1
  104. package/lib/plugins/pyroscope-datasource.js.map +1 -1
  105. package/lib/plugins/pyroscope-profile-query/PyroscopeProfileQuery.js +1 -1
  106. package/lib/plugins/pyroscope-profile-query/PyroscopeProfileQuery.js.map +1 -1
  107. package/lib/plugins/pyroscope-profile-query/PyroscopeProfileQueryEditor.js +1 -1
  108. package/lib/plugins/pyroscope-profile-query/PyroscopeProfileQueryEditor.js.map +1 -1
  109. package/lib/plugins/pyroscope-profile-query/get-profile-data.js +1 -1
  110. package/lib/plugins/pyroscope-profile-query/get-profile-data.js.map +1 -1
  111. package/lib/plugins/pyroscope-profile-query/index.js +1 -1
  112. package/lib/plugins/pyroscope-profile-query/index.js.map +1 -1
  113. package/lib/plugins/pyroscope-profile-query/query-editor-model.js +1 -1
  114. package/lib/plugins/pyroscope-profile-query/query-editor-model.js.map +1 -1
  115. package/lib/setup-tests.js +1 -1
  116. package/lib/setup-tests.js.map +1 -1
  117. package/lib/test/index.js +1 -1
  118. package/lib/test/index.js.map +1 -1
  119. package/lib/test/mock-data.js +1 -1
  120. package/lib/test/mock-data.js.map +1 -1
  121. package/lib/test/setup-tests.js +1 -1
  122. package/lib/test/setup-tests.js.map +1 -1
  123. package/lib/utils/types.js +1 -1
  124. package/lib/utils/types.js.map +1 -1
  125. package/lib/utils/use-query.js +1 -1
  126. package/lib/utils/use-query.js.map +1 -1
  127. package/mf-manifest.json +36 -36
  128. package/mf-stats.json +36 -36
  129. package/package.json +6 -6
  130. package/__mf/js/async/1490.83898a50.js +0 -22
  131. package/__mf/js/async/1728.82a39224.js +0 -1
  132. package/__mf/js/async/3664.4d82937b.js +0 -2
  133. package/__mf/js/async/392.6f4ed257.js +0 -2
  134. package/__mf/js/async/5440.f3809507.js +0 -2
  135. package/__mf/js/async/5501.84760779.js +0 -2
  136. package/__mf/js/async/8971.ec4be707.js +0 -7
  137. /package/__mf/js/async/{8971.ec4be707.js.LICENSE.txt → 2488.1263bef3.js.LICENSE.txt} +0 -0
  138. /package/__mf/js/async/{392.6f4ed257.js.LICENSE.txt → 392.9a585980.js.LICENSE.txt} +0 -0
  139. /package/__mf/js/async/{3664.4d82937b.js.LICENSE.txt → 4657.cd5be1f7.js.LICENSE.txt} +0 -0
  140. /package/__mf/js/async/{1490.83898a50.js.LICENSE.txt → 54.ad215e09.js.LICENSE.txt} +0 -0
  141. /package/__mf/js/async/{5501.84760779.js.LICENSE.txt → 9010.f18f7884.js.LICENSE.txt} +0 -0
  142. /package/__mf/js/async/{__federation_expose_PyroscopeDatasource.108cb2d6.js.LICENSE.txt → __federation_expose_PyroscopeDatasource.deb0c623.js.LICENSE.txt} +0 -0
  143. /package/__mf/js/async/{__federation_expose_PyroscopeExplorer.f9864130.js.LICENSE.txt → __federation_expose_PyroscopeExplorer.b2a1605a.js.LICENSE.txt} +0 -0
  144. /package/__mf/js/async/{__federation_expose_PyroscopeProfileQuery.58db5efb.js.LICENSE.txt → __federation_expose_PyroscopeProfileQuery.adcc14cb.js.LICENSE.txt} +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/model/api-types.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\n/**\n * Request parameters of Pyroscope HTTP API endpoint GET /pyroscope/render\n * https://grafana.com/docs/pyroscope/latest/reference-server-api/#querying-profile-data\n */\nexport interface SearchProfilesParameters {\n query: string;\n /** the start time can be an absolute value (number) or a relative value (string). Ex of relative value : now-15m*/\n from: string | number;\n /** end of the search window, default : now */\n until?: string | number;\n /** format of the returned profiling data, default: json */\n format?: 'json' | 'dot';\n /** maximum number of nodes the resulting flame graph will contain, default: 50 */\n maxNodes?: number;\n groupeBy?: string;\n}\n\n/**\n * Response of Pyroscope HTTP API endpoint GET /pyroscope/render\n * https://grafana.com/docs/pyroscope/latest/reference-server-api/#query-output\n */\nexport interface SearchProfilesResponse {\n flamebearer: Flamebearer;\n metadata: Metadata;\n timeline: Timeline;\n}\n\nexport interface Flamebearer {\n names: string[];\n levels: number[][];\n numTicks: number;\n maxSelf: number;\n}\n\nexport interface Metadata {\n format: 'single' | 'double';\n spyName: string;\n sampleRate: number;\n units: string;\n name: string;\n}\n\nexport interface Timeline {\n startTime: number;\n samples: number[];\n durationDelta: number;\n}\n\n/**\n * Request parameters of Pyroscope HTTP API endpoint POST /querier.v1.QuerierService/ProfileTypes\n */\nexport type SearchProfileTypesParameters = Record<string, never>;\n\n/**\n * Response of Pyroscope HTTP API endpoint POST /querier.v1.QuerierService/ProfileTypes\n */\nexport interface SearchProfileTypesResponse {\n profileTypes: ProfileType[];\n}\n\nexport interface ProfileType {\n ID: string;\n name: string;\n sampleType: string;\n sampleUnit: string;\n periodType: string;\n periodUnit: string;\n}\n\n/**\n * Request parameters of Pyroscope HTTP API endpoint POST /querier.v1.QuerierService/LabelNames\n */\nexport type SearchLabelNamesParameters = Record<string, never>;\n\n/**\n * Response of Pyroscope HTTP API endpoint POST /querier.v1.QuerierService/LabelNames\n */\nexport interface SearchLabelNamesResponse {\n names: string[];\n}\n\n/**\n * Request parameters of Pyroscope HTTP API endpoint POST /querier.v1.QuerierService/LabelValues\n */\nexport type SearchLabelValuesParameters = Record<string, never>;\n\n/**\n * Response of Pyroscope HTTP API endpoint POST /querier.v1.QuerierService/LabelValues\n */\nexport interface SearchLabelValuesResponse {\n names: string[];\n}\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;;;CAGC,GAmFD;;CAEC,GACD,WAEC"}
1
+ {"version":3,"sources":["../../../src/model/api-types.ts"],"sourcesContent":["// Copyright 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\n/**\n * Request parameters of Pyroscope HTTP API endpoint GET /pyroscope/render\n * https://grafana.com/docs/pyroscope/latest/reference-server-api/#querying-profile-data\n */\nexport interface SearchProfilesParameters {\n query: string;\n /** the start time can be an absolute value (number) or a relative value (string). Ex of relative value : now-15m*/\n from: string | number;\n /** end of the search window, default : now */\n until?: string | number;\n /** format of the returned profiling data, default: json */\n format?: 'json' | 'dot';\n /** maximum number of nodes the resulting flame graph will contain, default: 50 */\n maxNodes?: number;\n groupeBy?: string;\n}\n\n/**\n * Response of Pyroscope HTTP API endpoint GET /pyroscope/render\n * https://grafana.com/docs/pyroscope/latest/reference-server-api/#query-output\n */\nexport interface SearchProfilesResponse {\n flamebearer: Flamebearer;\n metadata: Metadata;\n timeline: Timeline;\n}\n\nexport interface Flamebearer {\n names: string[];\n levels: number[][];\n numTicks: number;\n maxSelf: number;\n}\n\nexport interface Metadata {\n format: 'single' | 'double';\n spyName: string;\n sampleRate: number;\n units: string;\n name: string;\n}\n\nexport interface Timeline {\n startTime: number;\n samples: number[];\n durationDelta: number;\n}\n\n/**\n * Request parameters of Pyroscope HTTP API endpoint POST /querier.v1.QuerierService/ProfileTypes\n */\nexport type SearchProfileTypesParameters = Record<string, never>;\n\n/**\n * Response of Pyroscope HTTP API endpoint POST /querier.v1.QuerierService/ProfileTypes\n */\nexport interface SearchProfileTypesResponse {\n profileTypes: ProfileType[];\n}\n\nexport interface ProfileType {\n ID: string;\n name: string;\n sampleType: string;\n sampleUnit: string;\n periodType: string;\n periodUnit: string;\n}\n\n/**\n * Request parameters of Pyroscope HTTP API endpoint POST /querier.v1.QuerierService/LabelNames\n */\nexport type SearchLabelNamesParameters = Record<string, never>;\n\n/**\n * Response of Pyroscope HTTP API endpoint POST /querier.v1.QuerierService/LabelNames\n */\nexport interface SearchLabelNamesResponse {\n names: string[];\n}\n\n/**\n * Request parameters of Pyroscope HTTP API endpoint POST /querier.v1.QuerierService/LabelValues\n */\nexport type SearchLabelValuesParameters = Record<string, never>;\n\n/**\n * Response of Pyroscope HTTP API endpoint POST /querier.v1.QuerierService/LabelValues\n */\nexport interface SearchLabelValuesResponse {\n names: string[];\n}\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC;;;CAGC,GAmFD;;CAEC,GACD,WAEC"}
@@ -1,4 +1,4 @@
1
- // Copyright 2025 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/model/index.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\nexport * from './pyroscope-client';\nexport * from './pyroscope-selectors';\nexport * from './profile-query-model';\nexport * from './api-types';\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,qBAAqB;AACnC,cAAc,wBAAwB;AACtC,cAAc,wBAAwB;AACtC,cAAc,cAAc"}
1
+ {"version":3,"sources":["../../../src/model/index.ts"],"sourcesContent":["// Copyright 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 './pyroscope-client';\nexport * from './pyroscope-selectors';\nexport * from './profile-query-model';\nexport * from './api-types';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,qBAAqB;AACnC,cAAc,wBAAwB;AACtC,cAAc,wBAAwB;AACtC,cAAc,cAAc"}
@@ -1,4 +1,4 @@
1
- // Copyright 2025 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/model/profile-query-model.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 { LabelFilter } from '../utils/types';\nimport { PyroscopeDatasourceSelector } from './pyroscope-selectors';\n/**\n * The spec/options for the PyroscopeProfileQuery plugin.\n */\nexport interface PyroscopeProfileQuerySpec {\n datasource?: PyroscopeDatasourceSelector;\n maxNodes?: number;\n profileType: string;\n filters?: LabelFilter[];\n service?: string;\n}\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;AAIjC;;CAEC,GACD,WAMC"}
1
+ {"version":3,"sources":["../../../src/model/profile-query-model.ts"],"sourcesContent":["// Copyright 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 { LabelFilter } from '../utils/types';\nimport { PyroscopeDatasourceSelector } from './pyroscope-selectors';\n/**\n * The spec/options for the PyroscopeProfileQuery plugin.\n */\nexport interface PyroscopeProfileQuerySpec {\n datasource?: PyroscopeDatasourceSelector;\n maxNodes?: number;\n profileType: string;\n filters?: LabelFilter[];\n service?: string;\n}\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAIjC;;CAEC,GACD,WAMC"}
@@ -1,4 +1,4 @@
1
- // Copyright 2025 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/model/pyroscope-client.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 { fetch, RequestHeaders } from '@perses-dev/core';\nimport { DatasourceClient } from '@perses-dev/plugin-system';\nimport {\n SearchProfilesParameters,\n SearchProfilesResponse,\n SearchProfileTypesParameters,\n SearchProfileTypesResponse,\n SearchLabelNamesParameters,\n SearchLabelNamesResponse,\n SearchLabelValuesParameters,\n SearchLabelValuesResponse,\n} from './api-types';\n\ninterface PyroscopeClientOptions {\n datasourceUrl: string;\n headers?: RequestHeaders;\n}\n\nexport interface PyroscopeClient extends DatasourceClient {\n options: PyroscopeClientOptions;\n searchProfiles(params: SearchProfilesParameters, headers?: RequestHeaders): Promise<SearchProfilesResponse>;\n searchProfileTypes(\n params: SearchProfileTypesParameters,\n headers: RequestHeaders,\n body: Record<string, string | number>\n ): Promise<SearchProfileTypesResponse>;\n searchLabelNames(\n params: SearchLabelNamesParameters,\n headers: RequestHeaders,\n body: Record<string, string | number>\n ): Promise<SearchLabelNamesResponse>;\n searchLabelValues(\n params: SearchLabelValuesParameters,\n headers: RequestHeaders,\n body: Record<string, string | number>\n ): Promise<SearchLabelValuesResponse>;\n searchServices(params: SearchLabelValuesParameters, headers: RequestHeaders): Promise<SearchLabelValuesResponse>;\n}\n\nexport interface QueryOptions {\n datasourceUrl: string;\n headers?: RequestHeaders;\n}\n\nexport const executeRequest = async <T>(...args: Parameters<typeof global.fetch>): Promise<T> => {\n const response = await fetch(...args);\n try {\n return await response.json();\n } catch (e) {\n console.error('Invalid response from server', e);\n throw new Error('Invalid response from server');\n }\n};\n\nfunction fetchWithGet<T, TResponse>(apiURI: string, params: T | null, queryOptions: QueryOptions): Promise<TResponse> {\n const { datasourceUrl, headers = {} } = queryOptions;\n\n let url = `${datasourceUrl}${apiURI}`;\n if (params) {\n url += '?' + new URLSearchParams(params);\n }\n const init = {\n method: 'GET',\n headers,\n };\n\n return executeRequest<TResponse>(url, init);\n}\n\nfunction fetchWithPost<T, TResponse>(\n apiURI: string,\n params: T | null,\n queryOptions: QueryOptions,\n body: Record<string, string | number>\n): Promise<TResponse> {\n const { datasourceUrl, headers = {} } = queryOptions;\n\n let url = `${datasourceUrl}${apiURI}`;\n if (params) {\n url += '?' + new URLSearchParams(params);\n }\n const init = {\n method: 'POST',\n headers,\n body: JSON.stringify(body),\n };\n\n return executeRequest<TResponse>(url, init);\n}\n\n/**\n * Returns profiling data.\n */\nexport function searchProfiles(\n params: SearchProfilesParameters,\n queryOptions: QueryOptions\n): Promise<SearchProfilesResponse> {\n return fetchWithGet<SearchProfilesParameters, SearchProfilesResponse>('/pyroscope/render', params, queryOptions);\n}\n\n/**\n * Returns a list of all profile types.\n */\nexport function searchProfileTypes(\n params: SearchProfileTypesParameters,\n queryOptions: QueryOptions,\n body: Record<string, string | number>\n): Promise<SearchProfileTypesResponse> {\n return fetchWithPost<SearchProfileTypesParameters, SearchProfileTypesResponse>(\n '/querier.v1.QuerierService/ProfileTypes',\n params,\n queryOptions,\n body\n );\n}\n\n/**\n * Returns a list of all label names.\n */\nexport function searchLabelNames(\n params: SearchLabelNamesParameters,\n queryOptions: QueryOptions,\n body: Record<string, string | number>\n): Promise<SearchLabelNamesResponse> {\n return fetchWithPost<SearchLabelNamesParameters, SearchLabelNamesResponse>(\n '/querier.v1.QuerierService/LabelNames',\n params,\n queryOptions,\n body\n );\n}\n\n/**\n * Returns a list of all label values for a given label name.\n */\nexport function searchLabelValues(\n params: SearchLabelValuesParameters,\n queryOptions: QueryOptions,\n body: Record<string, string | number>\n): Promise<SearchLabelValuesResponse> {\n return fetchWithPost<SearchLabelValuesParameters, SearchLabelValuesResponse>(\n '/querier.v1.QuerierService/LabelValues',\n params,\n queryOptions,\n body\n );\n}\n\n/**\n * Returns a list of all services.\n * This is a special case of label values where the label name is \"service_name\".\n */\nexport function searchServices(\n params: SearchLabelValuesParameters,\n queryOptions: QueryOptions\n): Promise<SearchLabelValuesResponse> {\n return fetchWithPost<SearchLabelValuesParameters, SearchLabelValuesResponse>(\n '/querier.v1.QuerierService/LabelValues',\n params,\n queryOptions,\n { name: 'service_name' }\n );\n}\n"],"names":["fetch","executeRequest","args","response","json","e","console","error","Error","fetchWithGet","apiURI","params","queryOptions","datasourceUrl","headers","url","URLSearchParams","init","method","fetchWithPost","body","JSON","stringify","searchProfiles","searchProfileTypes","searchLabelNames","searchLabelValues","searchServices","name"],"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,QAAwB,mBAAmB;AA4CzD,OAAO,MAAMC,iBAAiB,OAAU,GAAGC;IACzC,MAAMC,WAAW,MAAMH,SAASE;IAChC,IAAI;QACF,OAAO,MAAMC,SAASC,IAAI;IAC5B,EAAE,OAAOC,GAAG;QACVC,QAAQC,KAAK,CAAC,gCAAgCF;QAC9C,MAAM,IAAIG,MAAM;IAClB;AACF,EAAE;AAEF,SA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;AAE3B"}
1
+ {"version":3,"sources":["../../../src/model/pyroscope-client.ts"],"sourcesContent":["// Copyright 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, RequestHeaders } from '@perses-dev/core';\nimport { DatasourceClient } from '@perses-dev/plugin-system';\nimport {\n SearchProfilesParameters,\n SearchProfilesResponse,\n SearchProfileTypesParameters,\n SearchProfileTypesResponse,\n SearchLabelNamesParameters,\n SearchLabelNamesResponse,\n SearchLabelValuesParameters,\n SearchLabelValuesResponse,\n} from './api-types';\n\ninterface PyroscopeClientOptions {\n datasourceUrl: string;\n headers?: RequestHeaders;\n}\n\nexport interface PyroscopeClient extends DatasourceClient {\n options: PyroscopeClientOptions;\n searchProfiles(params: SearchProfilesParameters, headers?: RequestHeaders): Promise<SearchProfilesResponse>;\n searchProfileTypes(\n params: SearchProfileTypesParameters,\n headers: RequestHeaders,\n body: Record<string, string | number>\n ): Promise<SearchProfileTypesResponse>;\n searchLabelNames(\n params: SearchLabelNamesParameters,\n headers: RequestHeaders,\n body: Record<string, string | number>\n ): Promise<SearchLabelNamesResponse>;\n searchLabelValues(\n params: SearchLabelValuesParameters,\n headers: RequestHeaders,\n body: Record<string, string | number>\n ): Promise<SearchLabelValuesResponse>;\n searchServices(params: SearchLabelValuesParameters, headers: RequestHeaders): Promise<SearchLabelValuesResponse>;\n}\n\nexport interface QueryOptions {\n datasourceUrl: string;\n headers?: RequestHeaders;\n}\n\nexport const executeRequest = async <T>(...args: Parameters<typeof global.fetch>): Promise<T> => {\n const response = await fetch(...args);\n try {\n return await response.json();\n } catch (e) {\n console.error('Invalid response from server', e);\n throw new Error('Invalid response from server');\n }\n};\n\nfunction fetchWithGet<T, TResponse>(apiURI: string, params: T | null, queryOptions: QueryOptions): Promise<TResponse> {\n const { datasourceUrl, headers = {} } = queryOptions;\n\n let url = `${datasourceUrl}${apiURI}`;\n if (params) {\n url += '?' + new URLSearchParams(params);\n }\n const init = {\n method: 'GET',\n headers,\n };\n\n return executeRequest<TResponse>(url, init);\n}\n\nfunction fetchWithPost<T, TResponse>(\n apiURI: string,\n params: T | null,\n queryOptions: QueryOptions,\n body: Record<string, string | number>\n): Promise<TResponse> {\n const { datasourceUrl, headers = {} } = queryOptions;\n\n let url = `${datasourceUrl}${apiURI}`;\n if (params) {\n url += '?' + new URLSearchParams(params);\n }\n const init = {\n method: 'POST',\n headers,\n body: JSON.stringify(body),\n };\n\n return executeRequest<TResponse>(url, init);\n}\n\n/**\n * Returns profiling data.\n */\nexport function searchProfiles(\n params: SearchProfilesParameters,\n queryOptions: QueryOptions\n): Promise<SearchProfilesResponse> {\n return fetchWithGet<SearchProfilesParameters, SearchProfilesResponse>('/pyroscope/render', params, queryOptions);\n}\n\n/**\n * Returns a list of all profile types.\n */\nexport function searchProfileTypes(\n params: SearchProfileTypesParameters,\n queryOptions: QueryOptions,\n body: Record<string, string | number>\n): Promise<SearchProfileTypesResponse> {\n return fetchWithPost<SearchProfileTypesParameters, SearchProfileTypesResponse>(\n '/querier.v1.QuerierService/ProfileTypes',\n params,\n queryOptions,\n body\n );\n}\n\n/**\n * Returns a list of all label names.\n */\nexport function searchLabelNames(\n params: SearchLabelNamesParameters,\n queryOptions: QueryOptions,\n body: Record<string, string | number>\n): Promise<SearchLabelNamesResponse> {\n return fetchWithPost<SearchLabelNamesParameters, SearchLabelNamesResponse>(\n '/querier.v1.QuerierService/LabelNames',\n params,\n queryOptions,\n body\n );\n}\n\n/**\n * Returns a list of all label values for a given label name.\n */\nexport function searchLabelValues(\n params: SearchLabelValuesParameters,\n queryOptions: QueryOptions,\n body: Record<string, string | number>\n): Promise<SearchLabelValuesResponse> {\n return fetchWithPost<SearchLabelValuesParameters, SearchLabelValuesResponse>(\n '/querier.v1.QuerierService/LabelValues',\n params,\n queryOptions,\n body\n );\n}\n\n/**\n * Returns a list of all services.\n * This is a special case of label values where the label name is \"service_name\".\n */\nexport function searchServices(\n params: SearchLabelValuesParameters,\n queryOptions: QueryOptions\n): Promise<SearchLabelValuesResponse> {\n return fetchWithPost<SearchLabelValuesParameters, SearchLabelValuesResponse>(\n '/querier.v1.QuerierService/LabelValues',\n params,\n queryOptions,\n { name: 'service_name' }\n );\n}\n"],"names":["fetch","executeRequest","args","response","json","e","console","error","Error","fetchWithGet","apiURI","params","queryOptions","datasourceUrl","headers","url","URLSearchParams","init","method","fetchWithPost","body","JSON","stringify","searchProfiles","searchProfileTypes","searchLabelNames","searchLabelValues","searchServices","name"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,KAAK,QAAwB,mBAAmB;AA4CzD,OAAO,MAAMC,iBAAiB,OAAU,GAAGC;IACzC,MAAMC,WAAW,MAAMH,SAASE;IAChC,IAAI;QACF,OAAO,MAAMC,SAASC,IAAI;IAC5B,EAAE,OAAOC,GAAG;QACVC,QAAQC,KAAK,CAAC,gCAAgCF;QAC9C,MAAM,IAAIG,MAAM;IAClB;AACF,EAAE;AAEF,SAASC,aAA2BC,MAAc,EAAEC,MAAgB,EAAEC,YAA0B;IAC9F,MAAM,EAAEC,aAAa,EAAEC,UAAU,CAAC,CAAC,EAAE,GAAGF;IAExC,IAAIG,MAAM,GAAGF,gBAAgBH,QAAQ;IACrC,IAAIC,QAAQ;QACVI,OAAO,MAAM,IAAIC,gBAAgBL;IACnC;IACA,MAAMM,OAAO;QACXC,QAAQ;QACRJ;IACF;IAEA,OAAOb,eAA0Bc,KAAKE;AACxC;AAEA,SAASE,cACPT,MAAc,EACdC,MAAgB,EAChBC,YAA0B,EAC1BQ,IAAqC;IAErC,MAAM,EAAEP,aAAa,EAAEC,UAAU,CAAC,CAAC,EAAE,GAAGF;IAExC,IAAIG,MAAM,GAAGF,gBAAgBH,QAAQ;IACrC,IAAIC,QAAQ;QACVI,OAAO,MAAM,IAAIC,gBAAgBL;IACnC;IACA,MAAMM,OAAO;QACXC,QAAQ;QACRJ;QACAM,MAAMC,KAAKC,SAAS,CAACF;IACvB;IAEA,OAAOnB,eAA0Bc,KAAKE;AACxC;AAEA;;CAEC,GACD,OAAO,SAASM,eACdZ,MAAgC,EAChCC,YAA0B;IAE1B,OAAOH,aAA+D,qBAAqBE,QAAQC;AACrG;AAEA;;CAEC,GACD,OAAO,SAASY,mBACdb,MAAoC,EACpCC,YAA0B,EAC1BQ,IAAqC;IAErC,OAAOD,cACL,2CACAR,QACAC,cACAQ;AAEJ;AAEA;;CAEC,GACD,OAAO,SAASK,iBACdd,MAAkC,EAClCC,YAA0B,EAC1BQ,IAAqC;IAErC,OAAOD,cACL,yCACAR,QACAC,cACAQ;AAEJ;AAEA;;CAEC,GACD,OAAO,SAASM,kBACdf,MAAmC,EACnCC,YAA0B,EAC1BQ,IAAqC;IAErC,OAAOD,cACL,0CACAR,QACAC,cACAQ;AAEJ;AAEA;;;CAGC,GACD,OAAO,SAASO,eACdhB,MAAmC,EACnCC,YAA0B;IAE1B,OAAOO,cACL,0CACAR,QACAC,cACA;QAAEgB,MAAM;IAAe;AAE3B"}
@@ -1,4 +1,4 @@
1
- // Copyright 2025 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/model/pyroscope-selectors.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 { DatasourceSelector } from '@perses-dev/core';\n\nexport const PYROSCOPE_DATASOURCE_KIND = 'PyroscopeDatasource' as const;\n\n/**\n * DatasourceSelector for Pyroscope Datasources.\n */\nexport interface PyroscopeDatasourceSelector extends DatasourceSelector {\n kind: typeof PYROSCOPE_DATASOURCE_KIND;\n}\n\n/**\n * A default selector that asks for the default Pyroscope Datasource.\n */\nexport const DEFAULT_PYROSCOPE: PyroscopeDatasourceSelector = { kind: PYROSCOPE_DATASOURCE_KIND };\n\n/**\n * Returns true if the provided PyroscopeDatasourceSelector is the default one.\n */\nexport function isDefaultPyroscopeSelector(selector: PyroscopeDatasourceSelector): boolean {\n return selector.name === undefined;\n}\n\n/**\n * Type guard to make sure a DatasourceSelector is a Pyroscope one.\n */\nexport function isPyroscopeDatasourceSelector(selector: DatasourceSelector): selector is PyroscopeDatasourceSelector {\n return selector.kind === PYROSCOPE_DATASOURCE_KIND;\n}\n"],"names":["PYROSCOPE_DATASOURCE_KIND","DEFAULT_PYROSCOPE","kind","isDefaultPyroscopeSelector","selector","name","undefined","isPyroscopeDatasourceSelector"],"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;AAIjC,OAAO,MAAMA,4BAA4B,sBAA+B;AASxE;;CAEC,GACD,OAAO,MAAMC,oBAAiD;IAAEC,MAAMF;AAA0B,EAAE;AAElG;;CAEC,GACD,OAAO,SAASG,2BAA2BC,QAAqC;IAC9E,OAAOA,SAASC,IAAI,KAAKC;AAC3B;AAEA;;CAEC,GACD,OAAO,SAASC,8BAA8BH,QAA4B;IACxE,OAAOA,SAASF,IAAI,KAAKF;AAC3B"}
1
+ {"version":3,"sources":["../../../src/model/pyroscope-selectors.ts"],"sourcesContent":["// Copyright 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 { DatasourceSelector } from '@perses-dev/core';\n\nexport const PYROSCOPE_DATASOURCE_KIND = 'PyroscopeDatasource' as const;\n\n/**\n * DatasourceSelector for Pyroscope Datasources.\n */\nexport interface PyroscopeDatasourceSelector extends DatasourceSelector {\n kind: typeof PYROSCOPE_DATASOURCE_KIND;\n}\n\n/**\n * A default selector that asks for the default Pyroscope Datasource.\n */\nexport const DEFAULT_PYROSCOPE: PyroscopeDatasourceSelector = { kind: PYROSCOPE_DATASOURCE_KIND };\n\n/**\n * Returns true if the provided PyroscopeDatasourceSelector is the default one.\n */\nexport function isDefaultPyroscopeSelector(selector: PyroscopeDatasourceSelector): boolean {\n return selector.name === undefined;\n}\n\n/**\n * Type guard to make sure a DatasourceSelector is a Pyroscope one.\n */\nexport function isPyroscopeDatasourceSelector(selector: DatasourceSelector): selector is PyroscopeDatasourceSelector {\n return selector.kind === PYROSCOPE_DATASOURCE_KIND;\n}\n"],"names":["PYROSCOPE_DATASOURCE_KIND","DEFAULT_PYROSCOPE","kind","isDefaultPyroscopeSelector","selector","name","undefined","isPyroscopeDatasourceSelector"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAIjC,OAAO,MAAMA,4BAA4B,sBAA+B;AASxE;;CAEC,GACD,OAAO,MAAMC,oBAAiD;IAAEC,MAAMF;AAA0B,EAAE;AAElG;;CAEC,GACD,OAAO,SAASG,2BAA2BC,QAAqC;IAC9E,OAAOA,SAASC,IAAI,KAAKC;AAC3B;AAEA;;CAEC,GACD,OAAO,SAASC,8BAA8BH,QAA4B;IACxE,OAAOA,SAASF,IAAI,KAAKF;AAC3B"}
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- // Copyright 2025 The Perses Authors
2
+ // Copyright The Perses Authors
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
5
5
  // You may obtain a copy of the License at
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/plugins/PyroscopeDatasourceEditor.tsx"],"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 { HTTPSettingsEditor } from '@perses-dev/plugin-system';\nimport React, { ReactElement } from 'react';\nimport { PyroscopeDatasourceSpec } from './pyroscope-datasource-types';\n\nexport interface PyroscopeDatasourceEditorProps {\n value: PyroscopeDatasourceSpec;\n onChange: (next: PyroscopeDatasourceSpec) => void;\n isReadonly?: boolean;\n}\n\nexport function PyroscopeDatasourceEditor(props: PyroscopeDatasourceEditorProps): ReactElement {\n const { value, onChange, isReadonly } = props;\n\n const initialSpecDirect: PyroscopeDatasourceSpec = {\n directUrl: '',\n };\n\n const initialSpecProxy: PyroscopeDatasourceSpec = {\n proxy: {\n kind: 'HTTPProxy',\n spec: {\n allowedEndpoints: [\n // list of standard endpoints suggested by default\n {\n endpointPattern: '/pyroscope/render',\n method: 'GET',\n },\n {\n endpointPattern: '/querier.v1.QuerierService/ProfileTypes',\n method: 'POST',\n },\n {\n endpointPattern: '/querier.v1.QuerierService/LabelNames',\n method: 'POST',\n },\n {\n endpointPattern: '/querier.v1.QuerierService/LabelValues',\n method: 'POST',\n },\n ],\n url: '',\n },\n },\n };\n\n return (\n <HTTPSettingsEditor\n value={value}\n onChange={onChange}\n isReadonly={isReadonly}\n initialSpecDirect={initialSpecDirect}\n initialSpecProxy={initialSpecProxy}\n />\n );\n}\n"],"names":["HTTPSettingsEditor","React","PyroscopeDatasourceEditor","props","value","onChange","isReadonly","initialSpecDirect","directUrl","initialSpecProxy","proxy","kind","spec","allowedEndpoints","endpointPattern","method","url"],"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,kBAAkB,QAAQ,4BAA4B;AAC/D,OAAOC,WAA6B,QAAQ;AAS5C,OAAO,SAASC,0BAA0BC,KAAqC;IAC7E,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,UAAU,EAAE,GAAGH;IAExC,MAAMI,oBAA6C;QACjDC,WAAW;IACb;IAEA,MAAMC,mBAA4C;QAChDC,OAAO;YACLC,MAAM;YACNC,MAAM;gBACJC,kBAAkB;oBAChB,kDAAkD;oBAClD;wBACEC,iBAAiB;wBACjBC,QAAQ;oBACV;oBACA;wBACED,iBAAiB;wBACjBC,QAAQ;oBACV;oBACA;wBACED,iBAAiB;wBACjBC,QAAQ;oBACV;oBACA;wBACED,iBAAiB;wBACjBC,QAAQ;oBACV;iBACD;gBACDC,KAAK;YACP;QACF;IACF;IAEA,qBACE,KAAChB;QACCI,OAAOA;QACPC,UAAUA;QACVC,YAAYA;QACZC,mBAAmBA;QACnBE,kBAAkBA;;AAGxB"}
1
+ {"version":3,"sources":["../../../src/plugins/PyroscopeDatasourceEditor.tsx"],"sourcesContent":["// Copyright 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 { HTTPSettingsEditor } from '@perses-dev/plugin-system';\nimport React, { ReactElement } from 'react';\nimport { PyroscopeDatasourceSpec } from './pyroscope-datasource-types';\n\nexport interface PyroscopeDatasourceEditorProps {\n value: PyroscopeDatasourceSpec;\n onChange: (next: PyroscopeDatasourceSpec) => void;\n isReadonly?: boolean;\n}\n\nexport function PyroscopeDatasourceEditor(props: PyroscopeDatasourceEditorProps): ReactElement {\n const { value, onChange, isReadonly } = props;\n\n const initialSpecDirect: PyroscopeDatasourceSpec = {\n directUrl: '',\n };\n\n const initialSpecProxy: PyroscopeDatasourceSpec = {\n proxy: {\n kind: 'HTTPProxy',\n spec: {\n allowedEndpoints: [\n // list of standard endpoints suggested by default\n {\n endpointPattern: '/pyroscope/render',\n method: 'GET',\n },\n {\n endpointPattern: '/querier.v1.QuerierService/ProfileTypes',\n method: 'POST',\n },\n {\n endpointPattern: '/querier.v1.QuerierService/LabelNames',\n method: 'POST',\n },\n {\n endpointPattern: '/querier.v1.QuerierService/LabelValues',\n method: 'POST',\n },\n ],\n url: '',\n },\n },\n };\n\n return (\n <HTTPSettingsEditor\n value={value}\n onChange={onChange}\n isReadonly={isReadonly}\n initialSpecDirect={initialSpecDirect}\n initialSpecProxy={initialSpecProxy}\n />\n );\n}\n"],"names":["HTTPSettingsEditor","React","PyroscopeDatasourceEditor","props","value","onChange","isReadonly","initialSpecDirect","directUrl","initialSpecProxy","proxy","kind","spec","allowedEndpoints","endpointPattern","method","url"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,kBAAkB,QAAQ,4BAA4B;AAC/D,OAAOC,WAA6B,QAAQ;AAS5C,OAAO,SAASC,0BAA0BC,KAAqC;IAC7E,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,UAAU,EAAE,GAAGH;IAExC,MAAMI,oBAA6C;QACjDC,WAAW;IACb;IAEA,MAAMC,mBAA4C;QAChDC,OAAO;YACLC,MAAM;YACNC,MAAM;gBACJC,kBAAkB;oBAChB,kDAAkD;oBAClD;wBACEC,iBAAiB;wBACjBC,QAAQ;oBACV;oBACA;wBACED,iBAAiB;wBACjBC,QAAQ;oBACV;oBACA;wBACED,iBAAiB;wBACjBC,QAAQ;oBACV;oBACA;wBACED,iBAAiB;wBACjBC,QAAQ;oBACV;iBACD;gBACDC,KAAK;YACP;QACF;IACF;IAEA,qBACE,KAAChB;QACCI,OAAOA;QACPC,UAAUA;QACVC,YAAYA;QACZC,mBAAmBA;QACnBE,kBAAkBA;;AAGxB"}
@@ -1,4 +1,4 @@
1
- // Copyright 2025 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/plugins/index.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\nexport * from './pyroscope-profile-query';\nexport * from './pyroscope-datasource-types';\nexport * from './pyroscope-datasource';\nexport * from './PyroscopeDatasourceEditor';\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,4BAA4B;AAC1C,cAAc,+BAA+B;AAC7C,cAAc,yBAAyB;AACvC,cAAc,8BAA8B"}
1
+ {"version":3,"sources":["../../../src/plugins/index.ts"],"sourcesContent":["// Copyright 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 './pyroscope-profile-query';\nexport * from './pyroscope-datasource-types';\nexport * from './pyroscope-datasource';\nexport * from './PyroscopeDatasourceEditor';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,4BAA4B;AAC1C,cAAc,+BAA+B;AAC7C,cAAc,yBAAyB;AACvC,cAAc,8BAA8B"}
@@ -1,4 +1,4 @@
1
- // Copyright 2025 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/plugins/pyroscope-datasource-types.tsx"],"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 { HTTPProxy } from '@perses-dev/core';\n\nexport interface PyroscopeDatasourceSpec {\n directUrl?: string;\n proxy?: HTTPProxy;\n}\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;AAIjC,WAGC"}
1
+ {"version":3,"sources":["../../../src/plugins/pyroscope-datasource-types.tsx"],"sourcesContent":["// Copyright 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 { HTTPProxy } from '@perses-dev/core';\n\nexport interface PyroscopeDatasourceSpec {\n directUrl?: string;\n proxy?: HTTPProxy;\n}\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAIjC,WAGC"}
@@ -1,4 +1,4 @@
1
- // Copyright 2025 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/plugins/pyroscope-datasource.tsx"],"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 { DatasourcePlugin } from '@perses-dev/plugin-system';\nimport {\n PyroscopeClient,\n searchProfiles,\n searchProfileTypes,\n searchLabelNames,\n searchLabelValues,\n searchServices,\n} from '../model/pyroscope-client';\nimport { PyroscopeDatasourceSpec } from './pyroscope-datasource-types';\nimport { PyroscopeDatasourceEditor } from './PyroscopeDatasourceEditor';\n\n/**\n * Creates a PyroscopeClient for a specific datasource spec.\n */\nconst createClient: DatasourcePlugin<PyroscopeDatasourceSpec, PyroscopeClient>['createClient'] = (spec, options) => {\n const { directUrl, proxy } = spec;\n const { proxyUrl } = options;\n\n // Use the direct URL if specified, but fallback to the proxyUrl by default if not specified\n const datasourceUrl = directUrl ?? proxyUrl;\n if (datasourceUrl === undefined) {\n throw new Error('No URL specified for Pyroscope client. You can use directUrl in the spec to configure it.');\n }\n\n const specHeaders = proxy?.spec.headers;\n\n return {\n options: {\n datasourceUrl,\n },\n searchProfiles: (params, headers) => searchProfiles(params, { datasourceUrl, headers: headers ?? specHeaders }),\n searchProfileTypes: (params, headers, body) =>\n searchProfileTypes(params, { datasourceUrl, headers: headers ?? specHeaders }, body),\n searchLabelNames: (params, headers, body) =>\n searchLabelNames(params, { datasourceUrl, headers: headers ?? specHeaders }, body),\n searchLabelValues: (params, headers, body) =>\n searchLabelValues(params, { datasourceUrl, headers: headers ?? specHeaders }, body),\n searchServices: (params, headers) => searchServices(params, { datasourceUrl, headers: headers ?? specHeaders }),\n };\n};\n\nexport const PyroscopeDatasource: DatasourcePlugin<PyroscopeDatasourceSpec, PyroscopeClient> = {\n createClient,\n OptionsEditorComponent: PyroscopeDatasourceEditor,\n createInitialOptions: () => ({ directUrl: '' }),\n};\n"],"names":["searchProfiles","searchProfileTypes","searchLabelNames","searchLabelValues","searchServices","PyroscopeDatasourceEditor","createClient","spec","options","directUrl","proxy","proxyUrl","datasourceUrl","undefined","Error","specHeaders","headers","params","body","PyroscopeDatasource","OptionsEditorComponent","createInitialOptions"],"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;AAGjC,SAEEA,cAAc,EACdC,kBAAkB,EAClBC,gBAAgB,EAChBC,iBAAiB,EACjBC,cAAc,QACT,4BAA4B;AAEnC,SAASC,yBAAyB,QAAQ,8BAA8B;AAExE;;CAEC,GACD,MAAMC,eAA2F,CAACC,MAAMC;IACtG,MAAM,EAAEC,SAAS,EAAEC,KAAK,EAAE,GAAGH;IAC7B,MAAM,EAAEI,QAAQ,EAAE,GAAGH;IAErB,4FAA4F;IAC5F,MAAMI,gBAAgBH,aAAaE;IACnC,IAAIC,kBAAkBC,WAAW;QAC/B,MAAM,IAAIC,MAAM;IAClB;IAEA,MAAMC,cAAcL,OAAOH,KAAKS;IAEhC,OAAO;QACLR,SAAS;YACPI;QACF;QACAZ,gBAAgB,CAACiB,QAAQD,UAAYhB,eAAeiB,QAAQ;gBAAEL;gBAAeI,SAASA,WAAWD;YAAY;QAC7Gd,oBAAoB,CAACgB,QAAQD,SAASE,OACpCjB,mBAAmBgB,QAAQ;gBAAEL;gBAAeI,SAASA,WAAWD;YAAY,GAAGG;QACjFhB,kBAAkB,CAACe,QAAQD,SAASE,OAClChB,iBAAiBe,QAAQ;gBAAEL;gBAAeI,SAASA,WAAWD;YAAY,GAAGG;QAC/Ef,mBAAmB,CAACc,QAAQD,SAASE,OACnCf,kBAAkBc,QAAQ;gBAAEL;gBAAeI,SAASA,WAAWD;YAAY,GAAGG;QAChFd,gBAAgB,CAACa,QAAQD,UAAYZ,eAAea,QAAQ;gBAAEL;gBAAeI,SAASA,WAAWD;YAAY;IAC/G;AACF;AAEA,OAAO,MAAMI,sBAAkF;IAC7Fb;IACAc,wBAAwBf;IACxBgB,sBAAsB,IAAO,CAAA;YAAEZ,WAAW;QAAG,CAAA;AAC/C,EAAE"}
1
+ {"version":3,"sources":["../../../src/plugins/pyroscope-datasource.tsx"],"sourcesContent":["// Copyright 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 { DatasourcePlugin } from '@perses-dev/plugin-system';\nimport {\n PyroscopeClient,\n searchProfiles,\n searchProfileTypes,\n searchLabelNames,\n searchLabelValues,\n searchServices,\n} from '../model/pyroscope-client';\nimport { PyroscopeDatasourceSpec } from './pyroscope-datasource-types';\nimport { PyroscopeDatasourceEditor } from './PyroscopeDatasourceEditor';\n\n/**\n * Creates a PyroscopeClient for a specific datasource spec.\n */\nconst createClient: DatasourcePlugin<PyroscopeDatasourceSpec, PyroscopeClient>['createClient'] = (spec, options) => {\n const { directUrl, proxy } = spec;\n const { proxyUrl } = options;\n\n // Use the direct URL if specified, but fallback to the proxyUrl by default if not specified\n const datasourceUrl = directUrl ?? proxyUrl;\n if (datasourceUrl === undefined) {\n throw new Error('No URL specified for Pyroscope client. You can use directUrl in the spec to configure it.');\n }\n\n const specHeaders = proxy?.spec.headers;\n\n return {\n options: {\n datasourceUrl,\n },\n searchProfiles: (params, headers) => searchProfiles(params, { datasourceUrl, headers: headers ?? specHeaders }),\n searchProfileTypes: (params, headers, body) =>\n searchProfileTypes(params, { datasourceUrl, headers: headers ?? specHeaders }, body),\n searchLabelNames: (params, headers, body) =>\n searchLabelNames(params, { datasourceUrl, headers: headers ?? specHeaders }, body),\n searchLabelValues: (params, headers, body) =>\n searchLabelValues(params, { datasourceUrl, headers: headers ?? specHeaders }, body),\n searchServices: (params, headers) => searchServices(params, { datasourceUrl, headers: headers ?? specHeaders }),\n };\n};\n\nexport const PyroscopeDatasource: DatasourcePlugin<PyroscopeDatasourceSpec, PyroscopeClient> = {\n createClient,\n OptionsEditorComponent: PyroscopeDatasourceEditor,\n createInitialOptions: () => ({ directUrl: '' }),\n};\n"],"names":["searchProfiles","searchProfileTypes","searchLabelNames","searchLabelValues","searchServices","PyroscopeDatasourceEditor","createClient","spec","options","directUrl","proxy","proxyUrl","datasourceUrl","undefined","Error","specHeaders","headers","params","body","PyroscopeDatasource","OptionsEditorComponent","createInitialOptions"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAGjC,SAEEA,cAAc,EACdC,kBAAkB,EAClBC,gBAAgB,EAChBC,iBAAiB,EACjBC,cAAc,QACT,4BAA4B;AAEnC,SAASC,yBAAyB,QAAQ,8BAA8B;AAExE;;CAEC,GACD,MAAMC,eAA2F,CAACC,MAAMC;IACtG,MAAM,EAAEC,SAAS,EAAEC,KAAK,EAAE,GAAGH;IAC7B,MAAM,EAAEI,QAAQ,EAAE,GAAGH;IAErB,4FAA4F;IAC5F,MAAMI,gBAAgBH,aAAaE;IACnC,IAAIC,kBAAkBC,WAAW;QAC/B,MAAM,IAAIC,MAAM;IAClB;IAEA,MAAMC,cAAcL,OAAOH,KAAKS;IAEhC,OAAO;QACLR,SAAS;YACPI;QACF;QACAZ,gBAAgB,CAACiB,QAAQD,UAAYhB,eAAeiB,QAAQ;gBAAEL;gBAAeI,SAASA,WAAWD;YAAY;QAC7Gd,oBAAoB,CAACgB,QAAQD,SAASE,OACpCjB,mBAAmBgB,QAAQ;gBAAEL;gBAAeI,SAASA,WAAWD;YAAY,GAAGG;QACjFhB,kBAAkB,CAACe,QAAQD,SAASE,OAClChB,iBAAiBe,QAAQ;gBAAEL;gBAAeI,SAASA,WAAWD;YAAY,GAAGG;QAC/Ef,mBAAmB,CAACc,QAAQD,SAASE,OACnCf,kBAAkBc,QAAQ;gBAAEL;gBAAeI,SAASA,WAAWD;YAAY,GAAGG;QAChFd,gBAAgB,CAACa,QAAQD,UAAYZ,eAAea,QAAQ;gBAAEL;gBAAeI,SAASA,WAAWD;YAAY;IAC/G;AACF;AAEA,OAAO,MAAMI,sBAAkF;IAC7Fb;IACAc,wBAAwBf;IACxBgB,sBAAsB,IAAO,CAAA;YAAEZ,WAAW;QAAG,CAAA;AAC/C,EAAE"}
@@ -1,4 +1,4 @@
1
- // Copyright 2025 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/plugins/pyroscope-profile-query/PyroscopeProfileQuery.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 { LabelFilter } from '../../utils/types';\nimport { getProfileData } from './get-profile-data';\nimport { PyroscopeProfileQueryEditor } from './PyroscopeProfileQueryEditor';\n\nexport const PyroscopeProfileQuery = {\n getProfileData,\n OptionsEditorComponent: PyroscopeProfileQueryEditor,\n createInitialOptions: (): {\n maxNodes: number;\n datasource?: string;\n service: string;\n profileType: string;\n filters: LabelFilter[];\n } => ({\n maxNodes: 0,\n datasource: undefined,\n service: '',\n profileType: '',\n filters: [{ labelName: '', labelValue: '', operator: '=' }],\n }),\n};\n"],"names":["getProfileData","PyroscopeProfileQueryEditor","PyroscopeProfileQuery","OptionsEditorComponent","createInitialOptions","maxNodes","datasource","undefined","service","profileType","filters","labelName","labelValue","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;AAGjC,SAASA,cAAc,QAAQ,qBAAqB;AACpD,SAASC,2BAA2B,QAAQ,gCAAgC;AAE5E,OAAO,MAAMC,wBAAwB;IACnCF;IACAG,wBAAwBF;IACxBG,sBAAsB,IAMhB,CAAA;YACJC,UAAU;YACVC,YAAYC;YACZC,SAAS;YACTC,aAAa;YACbC,SAAS;gBAAC;oBAAEC,WAAW;oBAAIC,YAAY;oBAAIC,UAAU;gBAAI;aAAE;QAC7D,CAAA;AACF,EAAE"}
1
+ {"version":3,"sources":["../../../../src/plugins/pyroscope-profile-query/PyroscopeProfileQuery.ts"],"sourcesContent":["// Copyright 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 { LabelFilter } from '../../utils/types';\nimport { getProfileData } from './get-profile-data';\nimport { PyroscopeProfileQueryEditor } from './PyroscopeProfileQueryEditor';\n\nexport const PyroscopeProfileQuery = {\n getProfileData,\n OptionsEditorComponent: PyroscopeProfileQueryEditor,\n createInitialOptions: (): {\n maxNodes: number;\n datasource?: string;\n service: string;\n profileType: string;\n filters: LabelFilter[];\n } => ({\n maxNodes: 0,\n datasource: undefined,\n service: '',\n profileType: '',\n filters: [{ labelName: '', labelValue: '', operator: '=' }],\n }),\n};\n"],"names":["getProfileData","PyroscopeProfileQueryEditor","PyroscopeProfileQuery","OptionsEditorComponent","createInitialOptions","maxNodes","datasource","undefined","service","profileType","filters","labelName","labelValue","operator"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAGjC,SAASA,cAAc,QAAQ,qBAAqB;AACpD,SAASC,2BAA2B,QAAQ,gCAAgC;AAE5E,OAAO,MAAMC,wBAAwB;IACnCF;IACAG,wBAAwBF;IACxBG,sBAAsB,IAMhB,CAAA;YACJC,UAAU;YACVC,YAAYC;YACZC,SAAS;YACTC,aAAa;YACbC,SAAS;gBAAC;oBAAEC,WAAW;oBAAIC,YAAY;oBAAIC,UAAU;gBAAI;aAAE;QAC7D,CAAA;AACF,EAAE"}
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- // Copyright 2025 The Perses Authors
2
+ // Copyright The Perses Authors
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
5
5
  // You may obtain a copy of the License at
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/plugins/pyroscope-profile-query/PyroscopeProfileQueryEditor.tsx"],"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 { DatasourceSelect, DatasourceSelectProps } from '@perses-dev/plugin-system';\nimport { useId } from '@perses-dev/components';\nimport { produce } from 'immer';\nimport { FormControl, InputLabel, Stack, TextField, useTheme } from '@mui/material';\nimport { ReactElement } from 'react';\nimport {\n DEFAULT_PYROSCOPE,\n isDefaultPyroscopeSelector,\n isPyroscopeDatasourceSelector,\n PYROSCOPE_DATASOURCE_KIND,\n} from '../../model';\nimport { ProfileTypeSelector, Service, Filters } from '../../components';\nimport {\n ProfileQueryEditorProps,\n useMaxNodesState,\n useProfileTypeState,\n useServiceState,\n useFiltersState,\n} from './query-editor-model';\n\nexport function PyroscopeProfileQueryEditor(props: ProfileQueryEditorProps): ReactElement {\n const { onChange, value } = props;\n const { datasource } = value;\n const selectedDatasource = datasource ?? DEFAULT_PYROSCOPE;\n const datasourceSelectLabelID = useId('pyroscope-datasource-label');\n\n const { maxNodes, handleMaxNodesChange, maxNodesHasError } = useMaxNodesState(props);\n const { profileType, handleProfileTypeChange } = useProfileTypeState(props);\n const { service, handleServiceChange } = useServiceState(props);\n const { filters, handleFiltersChange } = useFiltersState(props);\n\n const handleDatasourceChange: DatasourceSelectProps['onChange'] = (next) => {\n // Check if the next value is a DatasourceSelector\n if (typeof next === 'object' && 'kind' in next && 'name' in next) {\n if (isPyroscopeDatasourceSelector(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 draft.datasource = isDefaultPyroscopeSelector(next) ? undefined : next;\n })\n );\n return;\n }\n }\n\n throw new Error('Got unexpected non-Pyroscope datasource selector');\n };\n\n return (\n <Stack spacing={2}>\n <FormControl margin=\"dense\" fullWidth={false}>\n <InputLabel id={datasourceSelectLabelID} shrink>\n Pyroscope Datasource\n </InputLabel>\n <DatasourceSelect\n datasourcePluginKind={PYROSCOPE_DATASOURCE_KIND}\n value={selectedDatasource}\n onChange={handleDatasourceChange}\n labelId={datasourceSelectLabelID}\n label=\"Pyroscope Datasource\"\n notched\n />\n </FormControl>\n <Stack\n direction=\"row\"\n sx={{\n [useTheme().breakpoints.down('sm')]: {\n flexWrap: 'wrap',\n },\n gap: 2,\n rowGap: 1,\n }}\n >\n <Service datasource={selectedDatasource} value={service} onChange={handleServiceChange} />\n <ProfileTypeSelector datasource={selectedDatasource} value={profileType} onChange={handleProfileTypeChange} />\n <TextField\n type=\"number\"\n size=\"small\"\n label=\"Max Nodes\"\n value={maxNodes}\n error={maxNodesHasError}\n onChange={(e) => handleMaxNodesChange(e.target.value)}\n sx={(theme) => ({ width: 250, [theme.breakpoints.down('sm')]: { width: '100%' } })}\n slotProps={{ htmlInput: { step: 1 } }}\n />\n </Stack>\n <Filters datasource={selectedDatasource} value={filters} onChange={handleFiltersChange} />\n </Stack>\n );\n}\n"],"names":["DatasourceSelect","useId","produce","FormControl","InputLabel","Stack","TextField","useTheme","DEFAULT_PYROSCOPE","isDefaultPyroscopeSelector","isPyroscopeDatasourceSelector","PYROSCOPE_DATASOURCE_KIND","ProfileTypeSelector","Service","Filters","useMaxNodesState","useProfileTypeState","useServiceState","useFiltersState","PyroscopeProfileQueryEditor","props","onChange","value","datasource","selectedDatasource","datasourceSelectLabelID","maxNodes","handleMaxNodesChange","maxNodesHasError","profileType","handleProfileTypeChange","service","handleServiceChange","filters","handleFiltersChange","handleDatasourceChange","next","draft","undefined","Error","spacing","margin","fullWidth","id","shrink","datasourcePluginKind","labelId","label","notched","direction","sx","breakpoints","down","flexWrap","gap","rowGap","type","size","error","e","target","theme","width","slotProps","htmlInput","step"],"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,gBAAgB,QAA+B,4BAA4B;AACpF,SAASC,KAAK,QAAQ,yBAAyB;AAC/C,SAASC,OAAO,QAAQ,QAAQ;AAChC,SAASC,WAAW,EAAEC,UAAU,EAAEC,KAAK,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,gBAAgB;AAEpF,SACEC,iBAAiB,EACjBC,0BAA0B,EAC1BC,6BAA6B,EAC7BC,yBAAyB,QACpB,cAAc;AACrB,SAASC,mBAAmB,EAAEC,OAAO,EAAEC,OAAO,QAAQ,mBAAmB;AACzE,SAEEC,gBAAgB,EAChBC,mBAAmB,EACnBC,eAAe,EACfC,eAAe,QACV,uBAAuB;AAE9B,OAAO,SAASC,4BAA4BC,KAA8B;IACxE,MAAM,EAAEC,QAAQ,EAAEC,KAAK,EAAE,GAAGF;IAC5B,MAAM,EAAEG,UAAU,EAAE,GAAGD;IACvB,MAAME,qBAAqBD,cAAcf;IACzC,MAAMiB,0BAA0BxB,MAAM;IAEtC,MAAM,EAAEyB,QAAQ,EAAEC,oBAAoB,EAAEC,gBAAgB,EAAE,GAAGb,iBAAiBK;IAC9E,MAAM,EAAES,WAAW,EAAEC,uBAAuB,EAAE,GAAGd,oBAAoBI;IACrE,MAAM,EAAEW,OAAO,EAAEC,mBAAmB,EAAE,GAAGf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AEC,MAAM;4BAAE;wBAAE;;;;0BAGxC,KAACnD;gBAAQS,YAAYC;gBAAoBF,OAAOW;gBAASZ,UAAUa;;;;AAGzE"}
1
+ {"version":3,"sources":["../../../../src/plugins/pyroscope-profile-query/PyroscopeProfileQueryEditor.tsx"],"sourcesContent":["// Copyright 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 { DatasourceSelect, DatasourceSelectProps } from '@perses-dev/plugin-system';\nimport { useId } from '@perses-dev/components';\nimport { produce } from 'immer';\nimport { FormControl, InputLabel, Stack, TextField, useTheme } from '@mui/material';\nimport { ReactElement } from 'react';\nimport {\n DEFAULT_PYROSCOPE,\n isDefaultPyroscopeSelector,\n isPyroscopeDatasourceSelector,\n PYROSCOPE_DATASOURCE_KIND,\n} from '../../model';\nimport { ProfileTypeSelector, Service, Filters } from '../../components';\nimport {\n ProfileQueryEditorProps,\n useMaxNodesState,\n useProfileTypeState,\n useServiceState,\n useFiltersState,\n} from './query-editor-model';\n\nexport function PyroscopeProfileQueryEditor(props: ProfileQueryEditorProps): ReactElement {\n const { onChange, value } = props;\n const { datasource } = value;\n const selectedDatasource = datasource ?? DEFAULT_PYROSCOPE;\n const datasourceSelectLabelID = useId('pyroscope-datasource-label');\n\n const { maxNodes, handleMaxNodesChange, maxNodesHasError } = useMaxNodesState(props);\n const { profileType, handleProfileTypeChange } = useProfileTypeState(props);\n const { service, handleServiceChange } = useServiceState(props);\n const { filters, handleFiltersChange } = useFiltersState(props);\n\n const handleDatasourceChange: DatasourceSelectProps['onChange'] = (next) => {\n // Check if the next value is a DatasourceSelector\n if (typeof next === 'object' && 'kind' in next && 'name' in next) {\n if (isPyroscopeDatasourceSelector(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 draft.datasource = isDefaultPyroscopeSelector(next) ? undefined : next;\n })\n );\n return;\n }\n }\n\n throw new Error('Got unexpected non-Pyroscope datasource selector');\n };\n\n return (\n <Stack spacing={2}>\n <FormControl margin=\"dense\" fullWidth={false}>\n <InputLabel id={datasourceSelectLabelID} shrink>\n Pyroscope Datasource\n </InputLabel>\n <DatasourceSelect\n datasourcePluginKind={PYROSCOPE_DATASOURCE_KIND}\n value={selectedDatasource}\n onChange={handleDatasourceChange}\n labelId={datasourceSelectLabelID}\n label=\"Pyroscope Datasource\"\n notched\n />\n </FormControl>\n <Stack\n direction=\"row\"\n sx={{\n [useTheme().breakpoints.down('sm')]: {\n flexWrap: 'wrap',\n },\n gap: 2,\n rowGap: 1,\n }}\n >\n <Service datasource={selectedDatasource} value={service} onChange={handleServiceChange} />\n <ProfileTypeSelector datasource={selectedDatasource} value={profileType} onChange={handleProfileTypeChange} />\n <TextField\n type=\"number\"\n size=\"small\"\n label=\"Max Nodes\"\n value={maxNodes}\n error={maxNodesHasError}\n onChange={(e) => handleMaxNodesChange(e.target.value)}\n sx={(theme) => ({ width: 250, [theme.breakpoints.down('sm')]: { width: '100%' } })}\n slotProps={{ htmlInput: { step: 1 } }}\n />\n </Stack>\n <Filters datasource={selectedDatasource} value={filters} onChange={handleFiltersChange} />\n </Stack>\n );\n}\n"],"names":["DatasourceSelect","useId","produce","FormControl","InputLabel","Stack","TextField","useTheme","DEFAULT_PYROSCOPE","isDefaultPyroscopeSelector","isPyroscopeDatasourceSelector","PYROSCOPE_DATASOURCE_KIND","ProfileTypeSelector","Service","Filters","useMaxNodesState","useProfileTypeState","useServiceState","useFiltersState","PyroscopeProfileQueryEditor","props","onChange","value","datasource","selectedDatasource","datasourceSelectLabelID","maxNodes","handleMaxNodesChange","maxNodesHasError","profileType","handleProfileTypeChange","service","handleServiceChange","filters","handleFiltersChange","handleDatasourceChange","next","draft","undefined","Error","spacing","margin","fullWidth","id","shrink","datasourcePluginKind","labelId","label","notched","direction","sx","breakpoints","down","flexWrap","gap","rowGap","type","size","error","e","target","theme","width","slotProps","htmlInput","step"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,gBAAgB,QAA+B,4BAA4B;AACpF,SAASC,KAAK,QAAQ,yBAAyB;AAC/C,SAASC,OAAO,QAAQ,QAAQ;AAChC,SAASC,WAAW,EAAEC,UAAU,EAAEC,KAAK,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,gBAAgB;AAEpF,SACEC,iBAAiB,EACjBC,0BAA0B,EAC1BC,6BAA6B,EAC7BC,yBAAyB,QACpB,cAAc;AACrB,SAASC,mBAAmB,EAAEC,OAAO,EAAEC,OAAO,QAAQ,mBAAmB;AACzE,SAEEC,gBAAgB,EAChBC,mBAAmB,EACnBC,eAAe,EACfC,eAAe,QACV,uBAAuB;AAE9B,OAAO,SAASC,4BAA4BC,KAA8B;IACxE,MAAM,EAAEC,QAAQ,EAAEC,KAAK,EAAE,GAAGF;IAC5B,MAAM,EAAEG,UAAU,EAAE,GAAGD;IACvB,MAAME,qBAAqBD,cAAcf;IACzC,MAAMiB,0BAA0BxB,MAAM;IAEtC,MAAM,EAAEyB,QAAQ,EAAEC,oBAAoB,EAAEC,gBAAgB,EAAE,GAAGb,iBAAiBK;IAC9E,MAAM,EAAES,WAAW,EAAEC,uBAAuB,EAAE,GAAGd,oBAAoBI;IACrE,MAAM,EAAEW,OAAO,EAAEC,mBAAmB,EAAE,GAAGf,gBAAgBG;IACzD,MAAM,EAAEa,OAAO,EAAEC,mBAAmB,EAAE,GAAGhB,gBAAgBE;IAEzD,MAAMe,y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;;;;AAGzE"}
@@ -1,4 +1,4 @@
1
- // Copyright 2025 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/plugins/pyroscope-profile-query/get-profile-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 { ProfileQueryPlugin } from '@perses-dev/plugin-system';\nimport { AbsoluteTimeRange, StackTrace, ProfileData } from '@perses-dev/core';\nimport { getUnixTime } from 'date-fns';\nimport { PyroscopeProfileQuerySpec, PYROSCOPE_DATASOURCE_KIND, PyroscopeDatasourceSelector } from '../../model';\nimport { PyroscopeClient } from '../../model/pyroscope-client';\nimport { SearchProfilesParameters, SearchProfilesResponse } from '../../model/api-types';\nimport { computeFilterExpr } from '../../utils/types';\n\nexport function getUnixTimeRange(timeRange: AbsoluteTimeRange): { start: number; end: number } {\n const { start, end } = timeRange;\n return {\n start: Math.ceil(getUnixTime(start)),\n end: Math.ceil(getUnixTime(end)),\n };\n}\n\nexport const getProfileData: ProfileQueryPlugin<PyroscopeProfileQuerySpec>['getProfileData'] = async (\n spec,\n context\n) => {\n const defaultPyroscopeDatasource: PyroscopeDatasourceSelector = {\n kind: PYROSCOPE_DATASOURCE_KIND,\n };\n\n const client: PyroscopeClient = await context.datasourceStore.getDatasourceClient(\n spec.datasource ?? defaultPyroscopeDatasource\n );\n\n const buildQueryString = () => {\n let query: string = '';\n if (spec.service) {\n query = `service_name=\"${spec.service}\"`;\n }\n if (spec.filters && spec.filters.length > 0) {\n const filterExpr = computeFilterExpr(spec.filters);\n if (query === '') {\n query = filterExpr;\n } else {\n query += ',' + filterExpr;\n }\n }\n query = spec.profileType + (query === '' ? '' : '{' + query + '}');\n return query;\n };\n\n const getParams = (): SearchProfilesParameters => {\n const params: SearchProfilesParameters = {\n // example of query\n // query: `process_cpu:cpu:nanoseconds:cpu:nanoseconds{service_name=\"pyroscope\"}`,\n query: buildQueryString(),\n // the default value is now-1h\n from: 'now-1h',\n };\n\n // handle time range selection from UI drop down (e.g. last 5 minutes, last 1 hour )\n if (context.absoluteTimeRange) {\n const { start, end } = getUnixTimeRange(context.absoluteTimeRange);\n params.from = start;\n params.until = end;\n }\n\n if (spec.maxNodes) {\n params.maxNodes = spec.maxNodes;\n }\n\n return params;\n };\n\n const response = await client.searchProfiles(getParams());\n\n // return a profile data\n return transformProfileResponse(response);\n};\n\n/**\n * This function transform the Pyroscope response into the Perses profile format\n */\nfunction transformProfileResponse(response: SearchProfilesResponse): ProfileData {\n const newResponse: ProfileData = {\n profile: {\n stackTrace: {} as StackTrace,\n },\n numTicks: 0,\n maxSelf: 0,\n metadata: {\n spyName: '',\n sampleRate: 0,\n units: '',\n name: '',\n },\n timeline: {\n startTime: 0,\n samples: [],\n durationDelta: 0,\n },\n };\n\n if (!response) {\n return newResponse;\n }\n\n const stackTraces: StackTrace[][] = [];\n\n // stackTraces id from 1\n let id = 1;\n // Set the profile stackTrace property\n for (let i = 0; i < response.flamebearer.levels.length; i++) {\n let current = 0;\n const row: StackTrace[] = [];\n\n const level = response.flamebearer.levels[i];\n\n if (!level) {\n continue;\n }\n\n for (let j = 0; j < level.length; j += 4) {\n const temp: StackTrace = {} as StackTrace;\n temp.id = id;\n id += 1;\n const indexInNamesArray = level[j + 3]; // index in names array\n if (indexInNamesArray !== undefined) {\n const name = response.flamebearer.names[indexInNamesArray];\n\n if (name) {\n temp.name = name;\n }\n }\n temp.level = i;\n\n const total = level[j + 1];\n if (total !== undefined) {\n temp.total = total;\n }\n\n const self = level[j + 2];\n\n if (self !== undefined) {\n temp.self = self;\n }\n\n // start and end\n const offset = level[j];\n if (offset !== undefined) {\n current += offset; // current += offset\n }\n temp.start = current;\n if (total !== undefined) {\n current += total; // current += total\n }\n temp.end = current;\n\n temp.children = [];\n\n row.push(temp);\n }\n\n stackTraces.push(row);\n }\n\n addChildren(stackTraces); // adding children to nodes\n if (stackTraces[0]?.[0]) {\n newResponse.profile.stackTrace = stackTraces[0][0];\n }\n\n // Set other properties\n newResponse.numTicks = response.flamebearer.numTicks;\n newResponse.maxSelf = response.flamebearer.maxSelf;\n\n newResponse.metadata = {\n spyName: response.metadata.spyName,\n sampleRate: response.metadata.sampleRate,\n units: response.metadata.units,\n name: response.metadata.name,\n };\n\n newResponse.timeline = {\n startTime: response.timeline.startTime,\n samples: response.timeline.samples,\n durationDelta: response.timeline.durationDelta,\n };\n\n return newResponse;\n}\n\n// todo: optimize this method as soon as possible\nfunction addChildren(stackTraces: StackTrace[][]): void {\n // for (let i = stackTraces.length - 1; i > 0; i--) {\n for (let i = 1; i < stackTraces.length; i++) {\n const currentLevel = stackTraces[i];\n const parentLevel = stackTraces[i - 1];\n\n if (!currentLevel || !parentLevel) {\n continue;\n }\n\n for (let j = 0; j < currentLevel.length; j++) {\n const currentStack = currentLevel[j];\n if (!currentStack) {\n continue;\n }\n\n for (let k = 0; k < parentLevel.length; k++) {\n const parentStack = parentLevel[k];\n if (!parentStack) {\n continue;\n }\n\n if (currentStack.start >= parentStack.start && currentStack.end <= parentStack.end) {\n parentStack.children.push(currentStack);\n break;\n }\n }\n }\n }\n}\n"],"names":["getUnixTime","PYROSCOPE_DATASOURCE_KIND","computeFilterExpr","getUnixTimeRange","timeRange","start","end","Math","ceil","getProfileData","spec","context","defaultPyroscopeDatasource","kind","client","datasourceStore","getDatasourceClient","datasource","buildQueryString","query","service","filters","length","filterExpr","profileType","getParams","params","from","absoluteTimeRange","until","maxNodes","response","searchProfiles","transformProfileResponse","newResponse","profile","stackTrace","numTicks","maxSelf","metadata","spyName","sampleRate","units","name","timeline","startTime","samples","durationDelta","stackTraces","id","i","flamebearer","levels","current","row","level","j","temp","indexInNamesArray","undefined","names","total","self","offset","children","push","addChildren","currentLevel","parentLevel","currentStack","k","parentStack"],"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;AAIjC,SAASA,WAAW,QAAQ,WAAW;AACvC,SAAoCC,yBAAyB,QAAqC,cAAc;AAGhH,SAASC,iBAAiB,QAAQ,oBAAoB;AAEtD,OAAO,SAASC,iBAAiBC,SAA4B;IAC3D,MAAM,EAAEC,KAAK,EAAEC,GAAG,EAAE,GAAGF;IACvB,OAAO;QACLC,OAAOE,KAAKC,IAAI,CAACR,YAAYK;QAC7BC,KAAKC,KAAKC,IAAI,CAACR,YAAYM;IAC7B;AACF;AAEA,OAAO,MAAMG,iBAAkF,OAC7FC,MACAC;IAEA,MAAMC,6BAA0D;QAC9DC,MAAMZ;IACR;IAEA,MAAMa,SAA0B,MAAMH,QAAQI,eAAe,CAACC,mBAAmB,CAC/EN,KAAKO,UAAU,IAAIL;IAGrB,MAAMM,mBAAmB;QACvB,IAAIC,QAAgB;QACpB,IAAIT,KAAKU,OAAO,EAAE;YAChBD,QAAQ,CAAC,cAAc,EAAET,KAAKU,OAAO,CAAC,CAAC,CAAC;QAC1C;QACA,IAAIV,KAAKW,OAAO,IAAIX,KAAKW,OAAO,CAACC,MAAM,GAAG,GAAG;YAC3C,MAAMC,aAAarB,kBAAkBQ,KAAKW,OAAO;YACjD,IAAIF,UAAU,IAAI;gBAChBA,QAAQI;YACV,OAAO;gBACLJ,SAAS,MAAMI;YACjB;QACF;QACAJ,QAAQT,KAAKc,WAAW,GAAIL,CAAAA,UAAU,KAAK,K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AASQ,QAAQ,CAACE,UAAU;QACxCC,OAAOX,SAASQ,QAAQ,CAACG,KAAK;QAC9BC,MAAMZ,SAASQ,QAAQ,CAACI,IAAI;IAC9B;IAEAT,YAAYU,QAAQ,GAAG;QACrBC,WAAWd,SAASa,QAAQ,CAACC,SAAS;QACtCC,SAASf,SAASa,QAAQ,CAACE,OAAO;QAClCC,eAAehB,SAASa,QAAQ,CAACG,aAAa;IAChD;IAEA,OAAOb;AACT;AAEA,iDAAiD;AACjD,SAASgC,YAAYlB,WAA2B;IAC9C,qDAAqD;IACrD,IAAK,IAAIE,IAAI,GAAGA,IAAIF,YAAY1B,MAAM,EAAE4B,IAAK;QAC3C,MAAMiB,eAAenB,WAAW,CAACE,EAAE;QACnC,MAAMkB,cAAcpB,WAAW,CAACE,IAAI,EAAE;QAEtC,IAAI,CAACiB,gBAAgB,CAACC,aAAa;YACjC;QACF;QAEA,IAAK,IAAIZ,IAAI,GAAGA,IAAIW,aAAa7C,MAAM,EAAEkC,IAAK;YAC5C,MAAMa,eAAeF,YAAY,CAACX,EAAE;YACpC,IAAI,CAACa,cAAc;gBACjB;YACF;YAEA,IAAK,IAAIC,IAAI,GAAGA,IAAIF,YAAY9C,MAAM,EAAEgD,IAAK;gBAC3C,MAAMC,cAAcH,WAAW,CAACE,EAAE;gBAClC,IAAI,CAACC,aAAa;oBAChB;gBACF;gBAEA,IAAIF,aAAahE,KAAK,IAAIkE,YAAYlE,KAAK,IAAIgE,aAAa/D,GAAG,IAAIiE,YAAYjE,GAAG,EAAE;oBAClFiE,YAAYP,QAAQ,CAACC,IAAI,CAACI;oBAC1B;gBACF;YACF;QACF;IACF;AACF"}
1
+ {"version":3,"sources":["../../../../src/plugins/pyroscope-profile-query/get-profile-data.ts"],"sourcesContent":["// Copyright 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 { ProfileQueryPlugin } from '@perses-dev/plugin-system';\nimport { AbsoluteTimeRange, StackTrace, ProfileData } from '@perses-dev/core';\nimport { getUnixTime } from 'date-fns';\nimport { PyroscopeProfileQuerySpec, PYROSCOPE_DATASOURCE_KIND, PyroscopeDatasourceSelector } from '../../model';\nimport { PyroscopeClient } from '../../model/pyroscope-client';\nimport { SearchProfilesParameters, SearchProfilesResponse } from '../../model/api-types';\nimport { computeFilterExpr } from '../../utils/types';\n\nexport function getUnixTimeRange(timeRange: AbsoluteTimeRange): { start: number; end: number } {\n const { start, end } = timeRange;\n return {\n start: Math.ceil(getUnixTime(start)),\n end: Math.ceil(getUnixTime(end)),\n };\n}\n\nexport const getProfileData: ProfileQueryPlugin<PyroscopeProfileQuerySpec>['getProfileData'] = async (\n spec,\n context\n) => {\n const defaultPyroscopeDatasource: PyroscopeDatasourceSelector = {\n kind: PYROSCOPE_DATASOURCE_KIND,\n };\n\n const client: PyroscopeClient = await context.datasourceStore.getDatasourceClient(\n spec.datasource ?? defaultPyroscopeDatasource\n );\n\n const buildQueryString = () => {\n let query: string = '';\n if (spec.service) {\n query = `service_name=\"${spec.service}\"`;\n }\n if (spec.filters && spec.filters.length > 0) {\n const filterExpr = computeFilterExpr(spec.filters);\n if (query === '') {\n query = filterExpr;\n } else {\n query += ',' + filterExpr;\n }\n }\n query = spec.profileType + (query === '' ? '' : '{' + query + '}');\n return query;\n };\n\n const getParams = (): SearchProfilesParameters => {\n const params: SearchProfilesParameters = {\n // example of query\n // query: `process_cpu:cpu:nanoseconds:cpu:nanoseconds{service_name=\"pyroscope\"}`,\n query: buildQueryString(),\n // the default value is now-1h\n from: 'now-1h',\n };\n\n // handle time range selection from UI drop down (e.g. last 5 minutes, last 1 hour )\n if (context.absoluteTimeRange) {\n const { start, end } = getUnixTimeRange(context.absoluteTimeRange);\n params.from = start;\n params.until = end;\n }\n\n if (spec.maxNodes) {\n params.maxNodes = spec.maxNodes;\n }\n\n return params;\n };\n\n const response = await client.searchProfiles(getParams());\n\n // return a profile data\n return transformProfileResponse(response);\n};\n\n/**\n * This function transform the Pyroscope response into the Perses profile format\n */\nfunction transformProfileResponse(response: SearchProfilesResponse): ProfileData {\n const newResponse: ProfileData = {\n profile: {\n stackTrace: {} as StackTrace,\n },\n numTicks: 0,\n maxSelf: 0,\n metadata: {\n spyName: '',\n sampleRate: 0,\n units: '',\n name: '',\n },\n timeline: {\n startTime: 0,\n samples: [],\n durationDelta: 0,\n },\n };\n\n if (!response) {\n return newResponse;\n }\n\n const stackTraces: StackTrace[][] = [];\n\n // stackTraces id from 1\n let id = 1;\n // Set the profile stackTrace property\n for (let i = 0; i < response.flamebearer.levels.length; i++) {\n let current = 0;\n const row: StackTrace[] = [];\n\n const level = response.flamebearer.levels[i];\n\n if (!level) {\n continue;\n }\n\n for (let j = 0; j < level.length; j += 4) {\n const temp: StackTrace = {} as StackTrace;\n temp.id = id;\n id += 1;\n const indexInNamesArray = level[j + 3]; // index in names array\n if (indexInNamesArray !== undefined) {\n const name = response.flamebearer.names[indexInNamesArray];\n\n if (name) {\n temp.name = name;\n }\n }\n temp.level = i;\n\n const total = level[j + 1];\n if (total !== undefined) {\n temp.total = total;\n }\n\n const self = level[j + 2];\n\n if (self !== undefined) {\n temp.self = self;\n }\n\n // start and end\n const offset = level[j];\n if (offset !== undefined) {\n current += offset; // current += offset\n }\n temp.start = current;\n if (total !== undefined) {\n current += total; // current += total\n }\n temp.end = current;\n\n temp.children = [];\n\n row.push(temp);\n }\n\n stackTraces.push(row);\n }\n\n addChildren(stackTraces); // adding children to nodes\n if (stackTraces[0]?.[0]) {\n newResponse.profile.stackTrace = stackTraces[0][0];\n }\n\n // Set other properties\n newResponse.numTicks = response.flamebearer.numTicks;\n newResponse.maxSelf = response.flamebearer.maxSelf;\n\n newResponse.metadata = {\n spyName: response.metadata.spyName,\n sampleRate: response.metadata.sampleRate,\n units: response.metadata.units,\n name: response.metadata.name,\n };\n\n newResponse.timeline = {\n startTime: response.timeline.startTime,\n samples: response.timeline.samples,\n durationDelta: response.timeline.durationDelta,\n };\n\n return newResponse;\n}\n\n// todo: optimize this method as soon as possible\nfunction addChildren(stackTraces: StackTrace[][]): void {\n // for (let i = stackTraces.length - 1; i > 0; i--) {\n for (let i = 1; i < stackTraces.length; i++) {\n const currentLevel = stackTraces[i];\n const parentLevel = stackTraces[i - 1];\n\n if (!currentLevel || !parentLevel) {\n continue;\n }\n\n for (let j = 0; j < currentLevel.length; j++) {\n const currentStack = currentLevel[j];\n if (!currentStack) {\n continue;\n }\n\n for (let k = 0; k < parentLevel.length; k++) {\n const parentStack = parentLevel[k];\n if (!parentStack) {\n continue;\n }\n\n if (currentStack.start >= parentStack.start && currentStack.end <= parentStack.end) {\n parentStack.children.push(currentStack);\n break;\n }\n }\n }\n }\n}\n"],"names":["getUnixTime","PYROSCOPE_DATASOURCE_KIND","computeFilterExpr","getUnixTimeRange","timeRange","start","end","Math","ceil","getProfileData","spec","context","defaultPyroscopeDatasource","kind","client","datasourceStore","getDatasourceClient","datasource","buildQueryString","query","service","filters","length","filterExpr","profileType","getParams","params","from","absoluteTimeRange","until","maxNodes","response","searchProfiles","transformProfileResponse","newResponse","profile","stackTrace","numTicks","maxSelf","metadata","spyName","sampleRate","units","name","timeline","startTime","samples","durationDelta","stackTraces","id","i","flamebearer","levels","current","row","level","j","temp","indexInNamesArray","undefined","names","total","self","offset","children","push","addChildren","currentLevel","parentLevel","currentStack","k","parentStack"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAIjC,SAASA,WAAW,QAAQ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YAAY1B,MAAM,EAAE4B,IAAK;QAC3C,MAAMiB,eAAenB,WAAW,CAACE,EAAE;QACnC,MAAMkB,cAAcpB,WAAW,CAACE,IAAI,EAAE;QAEtC,IAAI,CAACiB,gBAAgB,CAACC,aAAa;YACjC;QACF;QAEA,IAAK,IAAIZ,IAAI,GAAGA,IAAIW,aAAa7C,MAAM,EAAEkC,IAAK;YAC5C,MAAMa,eAAeF,YAAY,CAACX,EAAE;YACpC,IAAI,CAACa,cAAc;gBACjB;YACF;YAEA,IAAK,IAAIC,IAAI,GAAGA,IAAIF,YAAY9C,MAAM,EAAEgD,IAAK;gBAC3C,MAAMC,cAAcH,WAAW,CAACE,EAAE;gBAClC,IAAI,CAACC,aAAa;oBAChB;gBACF;gBAEA,IAAIF,aAAahE,KAAK,IAAIkE,YAAYlE,KAAK,IAAIgE,aAAa/D,GAAG,IAAIiE,YAAYjE,GAAG,EAAE;oBAClFiE,YAAYP,QAAQ,CAACC,IAAI,CAACI;oBAC1B;gBACF;YACF;QACF;IACF;AACF"}
@@ -1,4 +1,4 @@
1
- // Copyright 2025 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/plugins/pyroscope-profile-query/index.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\nexport * from './get-profile-data';\nexport * from './PyroscopeProfileQuery';\nexport * from './PyroscopeProfileQueryEditor';\nexport * from './query-editor-model';\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,qBAAqB;AACnC,cAAc,0BAA0B;AACxC,cAAc,gCAAgC;AAC9C,cAAc,uBAAuB"}
1
+ {"version":3,"sources":["../../../../src/plugins/pyroscope-profile-query/index.ts"],"sourcesContent":["// Copyright 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 './get-profile-data';\nexport * from './PyroscopeProfileQuery';\nexport * from './PyroscopeProfileQueryEditor';\nexport * from './query-editor-model';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,qBAAqB;AACnC,cAAc,0BAA0B;AACxC,cAAc,gCAAgC;AAC9C,cAAc,uBAAuB"}
@@ -1,4 +1,4 @@
1
- // Copyright 2025 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/plugins/pyroscope-profile-query/query-editor-model.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 { useState } from 'react';\nimport { produce } from 'immer';\nimport { OptionsEditorProps } from '@perses-dev/plugin-system';\nimport { PyroscopeProfileQuerySpec } from '../../model/profile-query-model';\nimport { LabelFilter } from '../../utils/types';\n\nexport type ProfileQueryEditorProps = OptionsEditorProps<PyroscopeProfileQuerySpec>;\n\n/**\n * Hook to manage `maxNodes` state to ensure panel preview rerender when maxNodes is changed.\n */\nexport function useMaxNodesState(props: ProfileQueryEditorProps): {\n maxNodes: string;\n handleMaxNodesChange: (e: string) => void;\n maxNodesHasError: boolean;\n} {\n const { onChange, value } = props;\n\n const [maxNodes, setMaxNodes] = useState(value.maxNodes ? value.maxNodes.toString() : '');\n const [lastSyncedMaxNodes, setLastSyncedMaxNodes] = useState(value.maxNodes);\n\n if (value.maxNodes !== lastSyncedMaxNodes) {\n setMaxNodes(value.maxNodes ? value.maxNodes.toString() : '');\n setLastSyncedMaxNodes(value.maxNodes);\n }\n\n // maxNodes must be empty or an integer between 0 and max_flamegraph_nodes_max (0 < maxNodes <= max_flamegraph_nodes_max)\n // what is the actual value of max_flamegraph_nodes_max?\n // todo: add a constraint to the maxNodes related to max_flamegraph_nodes_max\n const maxNodesHasError = !(maxNodes === '' || (/^[0-9]+$/.test(maxNodes) && parseInt(maxNodes) > 0));\n\n // Update our local state as the user types\n const handleMaxNodesChange = (e: string): void => {\n setMaxNodes(e);\n // Propagate changes to the panel immediately\n onChange(\n produce(value, (draft) => {\n draft.maxNodes = e === '' ? undefined : parseInt(e);\n })\n );\n };\n\n return { maxNodes, handleMaxNodesChange, maxNodesHasError };\n}\n\n/**\n * Hook to manage `profileType` state to ensure panel preview rerender when profileType is changed.\n */\nexport function useProfileTypeState(props: ProfileQueryEditorProps): {\n profileType: string;\n handleProfileTypeChange: (e: string) => void;\n} {\n const { onChange, value } = props;\n\n const [profileType, setProfileType] = useState(value.profileType ? value.profileType : '');\n const [lastSyncedProfileType, setLastSyncedProfileType] = useState(value.profileType);\n\n if (value.profileType !== lastSyncedProfileType) {\n setProfileType(value.profileType);\n setLastSyncedProfileType(value.profileType);\n }\n\n // Update our local state as the user types\n const handleProfileTypeChange = (e: string): void => {\n setProfileType(e);\n // Propagate changes to the panel immediately\n onChange(\n produce(value, (draft) => {\n draft.profileType = e;\n })\n );\n };\n\n return { profileType, handleProfileTypeChange };\n}\n\n/**\n * Hook to manage `service` state to ensure panel preview rerender when service is changed.\n */\nexport function useServiceState(props: ProfileQueryEditorProps): {\n service: string;\n handleServiceChange: (e: string) => void;\n} {\n const { onChange, value } = props;\n\n const [service, setService] = useState(value.service ? value.service : '');\n const [lastSyncedService, setLastSyncedService] = useState(value.service);\n\n if (value.service !== lastSyncedService) {\n setService(value.service || '');\n setLastSyncedService(value.service);\n }\n\n // Update our local state as the user types\n const handleServiceChange = (e: string): void => {\n setService(e);\n // Propagate changes to the panel immediately\n onChange(\n produce(value, (draft) => {\n draft.service = e;\n })\n );\n };\n\n return { service, handleServiceChange };\n}\n\n/**\n * Hook to manage `filters` state to ensure panel preview rerender when filters is changed.\n */\nexport function useFiltersState(props: ProfileQueryEditorProps): {\n filters: LabelFilter[];\n handleFiltersChange: (f: LabelFilter[]) => void;\n} {\n const { onChange, value } = props;\n\n const [filters, setFilters] = useState(value.filters ? value.filters : []);\n\n const handleFiltersChange = (f: LabelFilter[]): void => {\n setFilters(f);\n\n onChange(\n produce(value, (draft) => {\n draft.filters = f;\n })\n );\n };\n\n return { filters, handleFiltersChange };\n}\n"],"names":["useState","produce","useMaxNodesState","props","onChange","value","maxNodes","setMaxNodes","toString","lastSyncedMaxNodes","setLastSyncedMaxNodes","maxNodesHasError","test","parseInt","handleMaxNodesChange","e","draft","undefined","useProfileTypeState","profileType","setProfileType","lastSyncedProfileType","setLastSyncedProfileType","handleProfileTypeChange","useServiceState","service","setService","lastSyncedService","setLastSyncedService","handleServiceChange","useFiltersState","filters","setFilters","handleFiltersChange","f"],"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;;CAEC,GACD,OAAO,SAASC,iBAAiBC,KAA8B;IAK7D,MAAM,EAAEC,QAAQ,EAAEC,KAAK,EAAE,GAAGF;IAE5B,MAAM,CAACG,UAAUC,YAAY,GAAGP,SAASK,MAAMC,QAAQ,GAAGD,MAAMC,QAAQ,CAACE,QAAQ,KAAK;IACtF,MAAM,CAACC,oBAAoBC,sBAAsB,GAAGV,SAASK,MAAMC,QAAQ;IAE3E,IAAID,MAAMC,QAAQ,KAAKG,oBAAoB;QACzCF,YAAYF,MAAMC,QAAQ,GAAGD,MAAMC,QAAQ,CAACE,QAAQ,KAAK;QACzDE,sBAAsBL,MAAMC,QAAQ;IACtC;IAEA,yHAAyH;IACzH,wDAAwD;IACxD,6EAA6E;IAC7E,MAAMK,mBAAmB,CAAEL,CAAAA,aAAa,MAAO,WAAWM,IAAI,CAACN,aAAaO,SAASP,YAAY,CAAC;IAElG,2CAA2C;IAC3C,MAAMQ,uBAAuB,CAACC;QAC5BR,YAAYQ;QACZ,6CAA6C;QAC7CX,SACEH,QAAQI,OAAO,CAACW;YACdA,MAAMV,QAAQ,GAAGS,MAAM,KAAKE,YAAYJ,SAASE;QACnD;IAEJ;IAEA,OAAO;QAAET;QAAUQ;QAAsBH;IAAiB;AAC5D;AAEA;;CAEC,GACD,OAAO,SAASO,oBAAoBf,KAA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AAG1B,MAAM0B,OAAO,GAAG,EAAE;IAEzE,MAAME,sBAAsB,CAACC;QAC3BF,WAAWE;QAEX9B,SACEH,QAAQI,OAAO,CAACW;YACdA,MAAMe,OAAO,GAAGG;QAClB;IAEJ;IAEA,OAAO;QAAEH;QAASE;IAAoB;AACxC"}
1
+ {"version":3,"sources":["../../../../src/plugins/pyroscope-profile-query/query-editor-model.ts"],"sourcesContent":["// Copyright 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 { PyroscopeProfileQuerySpec } from '../../model/profile-query-model';\nimport { LabelFilter } from '../../utils/types';\n\nexport type ProfileQueryEditorProps = OptionsEditorProps<PyroscopeProfileQuerySpec>;\n\n/**\n * Hook to manage `maxNodes` state to ensure panel preview rerender when maxNodes is changed.\n */\nexport function useMaxNodesState(props: ProfileQueryEditorProps): {\n maxNodes: string;\n handleMaxNodesChange: (e: string) => void;\n maxNodesHasError: boolean;\n} {\n const { onChange, value } = props;\n\n const [maxNodes, setMaxNodes] = useState(value.maxNodes ? value.maxNodes.toString() : '');\n const [lastSyncedMaxNodes, setLastSyncedMaxNodes] = useState(value.maxNodes);\n\n if (value.maxNodes !== lastSyncedMaxNodes) {\n setMaxNodes(value.maxNodes ? value.maxNodes.toString() : '');\n setLastSyncedMaxNodes(value.maxNodes);\n }\n\n // maxNodes must be empty or an integer between 0 and max_flamegraph_nodes_max (0 < maxNodes <= max_flamegraph_nodes_max)\n // what is the actual value of max_flamegraph_nodes_max?\n // todo: add a constraint to the maxNodes related to max_flamegraph_nodes_max\n const maxNodesHasError = !(maxNodes === '' || (/^[0-9]+$/.test(maxNodes) && parseInt(maxNodes) > 0));\n\n // Update our local state as the user types\n const handleMaxNodesChange = (e: string): void => {\n setMaxNodes(e);\n // Propagate changes to the panel immediately\n onChange(\n produce(value, (draft) => {\n draft.maxNodes = e === '' ? undefined : parseInt(e);\n })\n );\n };\n\n return { maxNodes, handleMaxNodesChange, maxNodesHasError };\n}\n\n/**\n * Hook to manage `profileType` state to ensure panel preview rerender when profileType is changed.\n */\nexport function useProfileTypeState(props: ProfileQueryEditorProps): {\n profileType: string;\n handleProfileTypeChange: (e: string) => void;\n} {\n const { onChange, value } = props;\n\n const [profileType, setProfileType] = useState(value.profileType ? value.profileType : '');\n const [lastSyncedProfileType, setLastSyncedProfileType] = useState(value.profileType);\n\n if (value.profileType !== lastSyncedProfileType) {\n setProfileType(value.profileType);\n setLastSyncedProfileType(value.profileType);\n }\n\n // Update our local state as the user types\n const handleProfileTypeChange = (e: string): void => {\n setProfileType(e);\n // Propagate changes to the panel immediately\n onChange(\n produce(value, (draft) => {\n draft.profileType = e;\n })\n );\n };\n\n return { profileType, handleProfileTypeChange };\n}\n\n/**\n * Hook to manage `service` state to ensure panel preview rerender when service is changed.\n */\nexport function useServiceState(props: ProfileQueryEditorProps): {\n service: string;\n handleServiceChange: (e: string) => void;\n} {\n const { onChange, value } = props;\n\n const [service, setService] = useState(value.service ? value.service : '');\n const [lastSyncedService, setLastSyncedService] = useState(value.service);\n\n if (value.service !== lastSyncedService) {\n setService(value.service || '');\n setLastSyncedService(value.service);\n }\n\n // Update our local state as the user types\n const handleServiceChange = (e: string): void => {\n setService(e);\n // Propagate changes to the panel immediately\n onChange(\n produce(value, (draft) => {\n draft.service = e;\n })\n );\n };\n\n return { service, handleServiceChange };\n}\n\n/**\n * Hook to manage `filters` state to ensure panel preview rerender when filters is changed.\n */\nexport function useFiltersState(props: ProfileQueryEditorProps): {\n filters: LabelFilter[];\n handleFiltersChange: (f: LabelFilter[]) => void;\n} {\n const { onChange, value } = props;\n\n const [filters, setFilters] = useState(value.filters ? value.filters : []);\n\n const handleFiltersChange = (f: LabelFilter[]): void => {\n setFilters(f);\n\n onChange(\n produce(value, (draft) => {\n draft.filters = f;\n })\n );\n };\n\n return { filters, handleFiltersChange };\n}\n"],"names":["useState","produce","useMaxNodesState","props","onChange","value","maxNodes","setMaxNodes","toString","lastSyncedMaxNodes","setLastSyncedMaxNodes","maxNodesHasError","test","parseInt","handleMaxNodesChange","e","draft","undefined","useProfileTypeState","profileType","setProfileType","lastSyncedProfileType","setLastSyncedProfileType","handleProfileTypeChange","useServiceState","service","setService","lastSyncedService","setLastSyncedService","handleServiceChange","useFiltersState","filters","setFilters","handleFiltersChange","f"],"mappings":"AAAA,+BAA+B;AAC/B,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;;CAEC,GACD,OAAO,SAASC,iBAAiBC,KAA8B;IAK7D,MAAM,EAAEC,QAAQ,EAAEC,KAAK,EAAE,GAAGF;IAE5B,MAAM,CAACG,UAAUC,YAAY,GAAGP,SAASK,MAAMC,QAAQ,GAAGD,MAAMC,QAAQ,CAACE,QAAQ,KAAK;IACtF,MAAM,CAACC,oBAAoBC,sBAAsB,GAAGV,SAASK,MAAMC,QAAQ;IAE3E,IAAID,MAAMC,QAAQ,KAAKG,oBAAoB;QACzCF,YAAYF,MAAMC,QAAQ,GAAGD,MAAMC,QAAQ,CAACE,QAAQ,KAAK;QACzDE,sBAAsBL,MAAMC,QAAQ;IACtC;IAEA,yHAAyH;IACzH,wDAAwD;IACxD,6EAA6E;IAC7E,MAAMK,mBAAmB,CAAEL,CAAAA,aAAa,MAAO,WAAWM,IAAI,CA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,WAAWX;QACX,6CAA6C;QAC7CX,SACEH,QAAQI,OAAO,CAACW;YACdA,MAAMS,OAAO,GAAGV;QAClB;IAEJ;IAEA,OAAO;QAAEU;QAASI;IAAoB;AACxC;AAEA;;CAEC,GACD,OAAO,SAASC,gBAAgB3B,KAA8B;IAI5D,MAAM,EAAEC,QAAQ,EAAEC,KAAK,EAAE,GAAGF;IAE5B,MAAM,CAAC4B,SAASC,WAAW,GAAGhC,SAASK,MAAM0B,OAAO,GAAG1B,MAAM0B,OAAO,GAAG,EAAE;IAEzE,MAAME,sBAAsB,CAACC;QAC3BF,WAAWE;QAEX9B,SACEH,QAAQI,OAAO,CAACW;YACdA,MAAMe,OAAO,GAAGG;QAClB;IAEJ;IAEA,OAAO;QAAEH;QAASE;IAAoB;AACxC"}
@@ -1,4 +1,4 @@
1
- // Copyright 2025 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/setup-tests.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 '@testing-library/jest-dom';\n\n// Always mock e-charts during tests since we don't have a proper canvas in jsdom\njest.mock('echarts/core');\n"],"names":["jest","mock"],"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,OAAO,4BAA4B;AAEnC,iFAAiF;AACjFA,KAAKC,IAAI,CAAC"}
1
+ {"version":3,"sources":["../../src/setup-tests.ts"],"sourcesContent":["// Copyright 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 '@testing-library/jest-dom';\n\n// Always mock e-charts during tests since we don't have a proper canvas in jsdom\njest.mock('echarts/core');\n"],"names":["jest","mock"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,OAAO,4BAA4B;AAEnC,iFAAiF;AACjFA,KAAKC,IAAI,CAAC"}
package/lib/test/index.js CHANGED
@@ -1,4 +1,4 @@
1
- // Copyright 2025 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/test/index.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\nexport * from './mock-data';\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,cAAc"}
1
+ {"version":3,"sources":["../../../src/test/index.ts"],"sourcesContent":["// Copyright 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 './mock-data';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,cAAc"}
@@ -1,4 +1,4 @@
1
- // Copyright 2025 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/test/mock-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 { SearchProfileTypesResponse, SearchLabelNamesResponse, SearchLabelValuesResponse } from '../model/api-types';\n\nexport const MOCK_PROFILE_TYPES_RESPONSE: SearchProfileTypesResponse = {\n profileTypes: [\n {\n ID: 'block:contentions:count:contentions:count',\n name: 'block',\n sampleType: 'contentions',\n sampleUnit: 'count',\n periodType: 'contentions',\n periodUnit: 'count',\n },\n {\n ID: 'block:delay:nanoseconds:contentions:count',\n name: 'block',\n sampleType: 'delay',\n sampleUnit: 'nanoseconds',\n periodType: 'contentions',\n periodUnit: 'count',\n },\n {\n ID: 'goroutines:goroutine:count:goroutine:count',\n name: 'goroutines',\n sampleType: 'goroutine',\n sampleUnit: 'count',\n periodType: 'goroutine',\n periodUnit: 'count',\n },\n {\n ID: 'memory:alloc_objects:count:space:bytes',\n name: 'memory',\n sampleType: 'alloc_objects',\n sampleUnit: 'count',\n periodType: 'space',\n periodUnit: 'bytes',\n },\n {\n ID: 'memory:alloc_space:bytes:space:bytes',\n name: 'memory',\n sampleType: 'alloc_space',\n sampleUnit: 'bytes',\n periodType: 'space',\n periodUnit: 'bytes',\n },\n {\n ID: 'memory:inuse_objects:count:space:bytes',\n name: 'memory',\n sampleType: 'inuse_objects',\n sampleUnit: 'count',\n periodType: 'space',\n periodUnit: 'bytes',\n },\n {\n ID: 'memory:inuse_space:bytes:space:bytes',\n name: 'memory',\n sampleType: 'inuse_space',\n sampleUnit: 'bytes',\n periodType: 'space',\n periodUnit: 'bytes',\n },\n {\n ID: 'mutex:contentions:count:contentions:count',\n name: 'mutex',\n sampleType: 'contentions',\n sampleUnit: 'count',\n periodType: 'contentions',\n periodUnit: 'count',\n },\n {\n ID: 'mutex:delay:nanoseconds:contentions:count',\n name: 'mutex',\n sampleType: 'delay',\n sampleUnit: 'nanoseconds',\n periodType: 'contentions',\n periodUnit: 'count',\n },\n {\n ID: 'process_cpu:cpu:nanoseconds:cpu:nanoseconds',\n name: 'process_cpu',\n sampleType: 'cpu',\n sampleUnit: 'nanoseconds',\n periodType: 'cpu',\n periodUnit: 'nanoseconds',\n },\n {\n ID: 'process_cpu:samples:count:cpu:nanoseconds',\n name: 'process_cpu',\n sampleType: 'samples',\n sampleUnit: 'count',\n periodType: 'cpu',\n periodUnit: 'nanoseconds',\n },\n ],\n};\n\nexport const MOCK_LABEL_NAMES_RESPONSE: SearchLabelNamesResponse = {\n names: [\n '__name__',\n '__period_type__',\n '__period_unit__',\n '__profile_type__',\n '__service_name__',\n '__type__',\n '__unit__',\n 'hostname',\n 'pyroscope_spy',\n 'region',\n 'service_git_ref',\n 'service_name',\n 'service_repository',\n 'target',\n 'vehicle',\n ],\n};\n\n// label values for \"name\" : \"region\"\nexport const MOCK_LABEL_VALUES_RESPONSE_NAME_REGION: SearchLabelValuesResponse = {\n names: ['ap-south', 'eu-north', 'us-east'],\n};\n"],"names":["MOCK_PROFILE_TYPES_RESPONSE","profileTypes","ID","name","sampleType","sampleUnit","periodType","periodUnit","MOCK_LABEL_NAMES_RESPONSE","names","MOCK_LABEL_VALUES_RESPONSE_NAME_REGION"],"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;AAIjC,OAAO,MAAMA,8BAA0D;IACrEC,cAAc;QACZ;YACEC,IAAI;YACJC,MAAM;YACNC,YAAY;YACZC,YAAY;YACZC,YAAY;YACZC,YAAY;QACd;QACA;YACEL,IAAI;YACJC,MAAM;YACNC,YAAY;YACZC,YAAY;YACZC,YAAY;YACZC,YAAY;QACd;QACA;YACEL,IAAI;YACJC,MAAM;YACNC,YAAY;YACZC,YAAY;YACZC,YAAY;YACZC,YAAY;QACd;QACA;YACEL,IAAI;YACJC,MAAM;YACNC,YAAY;YACZC,YAAY;YACZC,YAAY;YACZC,YAAY;QACd;QACA;YACEL,IAAI;YACJC,MAAM;YACNC,YAAY;YACZC,YAAY;YACZC,YAAY;YACZC,YAAY;QACd;QACA;YACEL,IAAI;YACJC,MAAM;YACNC,YAAY;YACZC,YAAY;YACZC,YAAY;YACZC,YAAY;QACd;QACA;YACEL,IAAI;YACJC,MAAM;YACNC,YAAY;YACZC,YAAY;YACZC,YAAY;YACZC,YAAY;QACd;QACA;YACEL,IAAI;YACJC,MAAM;YACNC,YAAY;YACZC,YAAY;YACZC,YAAY;YACZC,YAAY;QACd;QACA;YACEL,IAAI;YACJC,MAAM;YACNC,YAAY;YACZC,YAAY;YACZC,YAAY;YACZC,YAAY;QACd;QACA;YACEL,IAAI;YACJC,MAAM;YACNC,YAAY;YACZC,YAAY;YACZC,YAAY;YACZC,YAAY;QACd;QACA;YACEL,IAAI;YACJC,MAAM;YACNC,YAAY;YACZC,YAAY;YACZC,YAAY;YACZC,YAAY;QACd;KACD;AACH,EAAE;AAEF,OAAO,MAAMC,4BAAsD;IACjEC,OAAO;QACL;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;KACD;AACH,EAAE;AAEF,qCAAqC;AACrC,OAAO,MAAMC,yCAAoE;IAC/ED,OAAO;QAAC;QAAY;QAAY;KAAU;AAC5C,EAAE"}
1
+ {"version":3,"sources":["../../../src/test/mock-data.ts"],"sourcesContent":["// Copyright 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 { SearchProfileTypesResponse, SearchLabelNamesResponse, SearchLabelValuesResponse } from '../model/api-types';\n\nexport const MOCK_PROFILE_TYPES_RESPONSE: SearchProfileTypesResponse = {\n profileTypes: [\n {\n ID: 'block:contentions:count:contentions:count',\n name: 'block',\n sampleType: 'contentions',\n sampleUnit: 'count',\n periodType: 'contentions',\n periodUnit: 'count',\n },\n {\n ID: 'block:delay:nanoseconds:contentions:count',\n name: 'block',\n sampleType: 'delay',\n sampleUnit: 'nanoseconds',\n periodType: 'contentions',\n periodUnit: 'count',\n },\n {\n ID: 'goroutines:goroutine:count:goroutine:count',\n name: 'goroutines',\n sampleType: 'goroutine',\n sampleUnit: 'count',\n periodType: 'goroutine',\n periodUnit: 'count',\n },\n {\n ID: 'memory:alloc_objects:count:space:bytes',\n name: 'memory',\n sampleType: 'alloc_objects',\n sampleUnit: 'count',\n periodType: 'space',\n periodUnit: 'bytes',\n },\n {\n ID: 'memory:alloc_space:bytes:space:bytes',\n name: 'memory',\n sampleType: 'alloc_space',\n sampleUnit: 'bytes',\n periodType: 'space',\n periodUnit: 'bytes',\n },\n {\n ID: 'memory:inuse_objects:count:space:bytes',\n name: 'memory',\n sampleType: 'inuse_objects',\n sampleUnit: 'count',\n periodType: 'space',\n periodUnit: 'bytes',\n },\n {\n ID: 'memory:inuse_space:bytes:space:bytes',\n name: 'memory',\n sampleType: 'inuse_space',\n sampleUnit: 'bytes',\n periodType: 'space',\n periodUnit: 'bytes',\n },\n {\n ID: 'mutex:contentions:count:contentions:count',\n name: 'mutex',\n sampleType: 'contentions',\n sampleUnit: 'count',\n periodType: 'contentions',\n periodUnit: 'count',\n },\n {\n ID: 'mutex:delay:nanoseconds:contentions:count',\n name: 'mutex',\n sampleType: 'delay',\n sampleUnit: 'nanoseconds',\n periodType: 'contentions',\n periodUnit: 'count',\n },\n {\n ID: 'process_cpu:cpu:nanoseconds:cpu:nanoseconds',\n name: 'process_cpu',\n sampleType: 'cpu',\n sampleUnit: 'nanoseconds',\n periodType: 'cpu',\n periodUnit: 'nanoseconds',\n },\n {\n ID: 'process_cpu:samples:count:cpu:nanoseconds',\n name: 'process_cpu',\n sampleType: 'samples',\n sampleUnit: 'count',\n periodType: 'cpu',\n periodUnit: 'nanoseconds',\n },\n ],\n};\n\nexport const MOCK_LABEL_NAMES_RESPONSE: SearchLabelNamesResponse = {\n names: [\n '__name__',\n '__period_type__',\n '__period_unit__',\n '__profile_type__',\n '__service_name__',\n '__type__',\n '__unit__',\n 'hostname',\n 'pyroscope_spy',\n 'region',\n 'service_git_ref',\n 'service_name',\n 'service_repository',\n 'target',\n 'vehicle',\n ],\n};\n\n// label values for \"name\" : \"region\"\nexport const MOCK_LABEL_VALUES_RESPONSE_NAME_REGION: SearchLabelValuesResponse = {\n names: ['ap-south', 'eu-north', 'us-east'],\n};\n"],"names":["MOCK_PROFILE_TYPES_RESPONSE","profileTypes","ID","name","sampleType","sampleUnit","periodType","periodUnit","MOCK_LABEL_NAMES_RESPONSE","names","MOCK_LABEL_VALUES_RESPONSE_NAME_REGION"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAIjC,OAAO,MAAMA,8BAA0D;IACrEC,cAAc;QACZ;YACEC,IAAI;YACJC,MAAM;YACNC,YAAY;YACZC,YAAY;YACZC,YAAY;YACZC,YAAY;QACd;QACA;YACEL,IAAI;YACJC,MAAM;YACNC,YAAY;YACZC,YAAY;YACZC,YAAY;YACZC,YAAY;QACd;QACA;YACEL,IAAI;YACJC,MAAM;YACNC,YAAY;YACZC,YAAY;YACZC,YAAY;YACZC,YAAY;QACd;QACA;YACEL,IAAI;YACJC,MAAM;YACNC,YAAY;YACZC,YAAY;YACZC,YAAY;YACZC,YAAY;QACd;QACA;YACEL,IAAI;YACJC,MAAM;YACNC,YAAY;YACZC,YAAY;YACZC,YAAY;YACZC,YAAY;QACd;QACA;YACEL,IAAI;YACJC,MAAM;YACNC,YAAY;YACZC,YAAY;YACZC,YAAY;YACZC,YAAY;QACd;QACA;YACEL,IAAI;YACJC,MAAM;YACNC,YAAY;YACZC,YAAY;YACZC,YAAY;YACZC,YAAY;QACd;QACA;YACEL,IAAI;YACJC,MAAM;YACNC,YAAY;YACZC,YAAY;YACZC,YAAY;YACZC,YAAY;QACd;QACA;YACEL,IAAI;YACJC,MAAM;YACNC,YAAY;YACZC,YAAY;YACZC,YAAY;YACZC,YAAY;QACd;QACA;YACEL,IAAI;YACJC,MAAM;YACNC,YAAY;YACZC,YAAY;YACZC,YAAY;YACZC,YAAY;QACd;QACA;YACEL,IAAI;YACJC,MAAM;YACNC,YAAY;YACZC,YAAY;YACZC,YAAY;YACZC,YAAY;QACd;KACD;AACH,EAAE;AAEF,OAAO,MAAMC,4BAAsD;IACjEC,OAAO;QACL;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;KACD;AACH,EAAE;AAEF,qCAAqC;AACrC,OAAO,MAAMC,yCAAoE;IAC/ED,OAAO;QAAC;QAAY;QAAY;KAAU;AAC5C,EAAE"}
@@ -1,4 +1,4 @@
1
- // Copyright 2025 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/test/setup-tests.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 '@testing-library/jest-dom/extend-expect';\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,OAAO,0CAA0C"}
1
+ {"version":3,"sources":["../../../src/test/setup-tests.ts"],"sourcesContent":["// Copyright 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 '@testing-library/jest-dom/extend-expect';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,OAAO,0CAA0C"}
@@ -1,4 +1,4 @@
1
- // Copyright 2025 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utils/types.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\nexport type OperatorType = '=' | '!=' | '=~' | '!~';\n\nexport interface LabelFilter {\n labelName: string;\n labelValue: string;\n operator: OperatorType;\n}\n\nexport function computeFilterExpr(filters: LabelFilter[]): string {\n return `${filters\n .filter((filter) => filter.labelName !== '' && filter.labelValue !== '')\n .map((filter) => `${filter.labelName}${filter.operator}\"${filter.labelValue}\"`)\n .join(',')}`;\n}\n"],"names":["computeFilterExpr","filters","filter","labelName","labelValue","map","operator","join"],"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;AAUjC,OAAO,SAASA,kBAAkBC,OAAsB;IACtD,OAAO,GAAGA,QACPC,MAAM,CAAC,CAACA,SAAWA,OAAOC,SAAS,KAAK,MAAMD,OAAOE,UAAU,KAAK,IACpEC,GAAG,CAAC,CAACH,SAAW,GAAGA,OAAOC,SAAS,GAAGD,OAAOI,QAAQ,CAAC,CAAC,EAAEJ,OAAOE,UAAU,CAAC,CAAC,CAAC,EAC7EG,IAAI,CAAC,MAAM;AAChB"}
1
+ {"version":3,"sources":["../../../src/utils/types.ts"],"sourcesContent":["// Copyright 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 type OperatorType = '=' | '!=' | '=~' | '!~';\n\nexport interface LabelFilter {\n labelName: string;\n labelValue: string;\n operator: OperatorType;\n}\n\nexport function computeFilterExpr(filters: LabelFilter[]): string {\n return `${filters\n .filter((filter) => filter.labelName !== '' && filter.labelValue !== '')\n .map((filter) => `${filter.labelName}${filter.operator}\"${filter.labelValue}\"`)\n .join(',')}`;\n}\n"],"names":["computeFilterExpr","filters","filter","labelName","labelValue","map","operator","join"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAUjC,OAAO,SAASA,kBAAkBC,OAAsB;IACtD,OAAO,GAAGA,QACPC,MAAM,CAAC,CAACA,SAAWA,OAAOC,SAAS,KAAK,MAAMD,OAAOE,UAAU,KAAK,IACpEC,GAAG,CAAC,CAACH,SAAW,GAAGA,OAAOC,SAAS,GAAGD,OAAOI,QAAQ,CAAC,CAAC,EAAEJ,OAAOE,UAAU,CAAC,CAAC,CAAC,EAC7EG,IAAI,CAAC,MAAM;AAChB"}
@@ -1,4 +1,4 @@
1
- // Copyright 2025 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at