@flanksource/clicky-ui 0.3.83 → 0.3.85
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Combobox.cjs +8 -6
- package/dist/components/Combobox.cjs.map +1 -1
- package/dist/components/Combobox.d.ts.map +1 -1
- package/dist/components/Combobox.js +8 -6
- package/dist/components/Combobox.js.map +1 -1
- package/dist/components/ComboboxMenu.cjs +7 -4
- package/dist/components/ComboboxMenu.cjs.map +1 -1
- package/dist/components/ComboboxMenu.d.ts +3 -2
- package/dist/components/ComboboxMenu.d.ts.map +1 -1
- package/dist/components/ComboboxMenu.js +7 -4
- package/dist/components/ComboboxMenu.js.map +1 -1
- package/dist/components/DateField.cjs.map +1 -1
- package/dist/components/DateField.d.ts +3 -2
- package/dist/components/DateField.d.ts.map +1 -1
- package/dist/components/DateField.js.map +1 -1
- package/dist/components/DatePicker.cjs +9 -61
- package/dist/components/DatePicker.cjs.map +1 -1
- package/dist/components/DatePicker.d.ts +5 -19
- package/dist/components/DatePicker.d.ts.map +1 -1
- package/dist/components/DatePicker.js +11 -63
- package/dist/components/DatePicker.js.map +1 -1
- package/dist/components/DateTimePicker.cjs +9 -78
- package/dist/components/DateTimePicker.cjs.map +1 -1
- package/dist/components/DateTimePicker.d.ts +5 -19
- package/dist/components/DateTimePicker.d.ts.map +1 -1
- package/dist/components/DateTimePicker.js +11 -80
- package/dist/components/DateTimePicker.js.map +1 -1
- package/dist/components/FilterBar.cjs +64 -47
- package/dist/components/FilterBar.cjs.map +1 -1
- package/dist/components/FilterBar.d.ts +20 -2
- package/dist/components/FilterBar.d.ts.map +1 -1
- package/dist/components/FilterBar.js +63 -46
- package/dist/components/FilterBar.js.map +1 -1
- package/dist/components/TimeRange.cjs +156 -128
- package/dist/components/TimeRange.cjs.map +1 -1
- package/dist/components/TimeRange.d.ts +8 -1
- package/dist/components/TimeRange.d.ts.map +1 -1
- package/dist/components/TimeRange.js +156 -128
- package/dist/components/TimeRange.js.map +1 -1
- package/dist/components/calendar-grid.cjs +83 -0
- package/dist/components/calendar-grid.cjs.map +1 -0
- package/dist/components/calendar-grid.d.ts +9 -0
- package/dist/components/calendar-grid.d.ts.map +1 -0
- package/dist/components/calendar-grid.js +83 -0
- package/dist/components/calendar-grid.js.map +1 -0
- package/dist/components/combobox-types.d.ts +5 -0
- package/dist/components/combobox-types.d.ts.map +1 -1
- package/dist/components/date-input-field.cjs +88 -0
- package/dist/components/date-input-field.cjs.map +1 -0
- package/dist/components/date-input-field.d.ts +37 -0
- package/dist/components/date-input-field.d.ts.map +1 -0
- package/dist/components/date-input-field.js +88 -0
- package/dist/components/date-input-field.js.map +1 -0
- package/dist/components/date-math.cjs +67 -0
- package/dist/components/date-math.cjs.map +1 -0
- package/dist/components/date-math.d.ts +33 -0
- package/dist/components/date-math.d.ts.map +1 -0
- package/dist/components/date-math.js +60 -0
- package/dist/components/date-math.js.map +1 -0
- package/dist/components/date-picker-menu.cjs +129 -0
- package/dist/components/date-picker-menu.cjs.map +1 -0
- package/dist/components/date-picker-menu.d.ts +18 -0
- package/dist/components/date-picker-menu.d.ts.map +1 -0
- package/dist/components/date-picker-menu.js +129 -0
- package/dist/components/date-picker-menu.js.map +1 -0
- package/dist/components/filter-bar-context.cjs.map +1 -1
- package/dist/components/filter-bar-context.d.ts +2 -0
- package/dist/components/filter-bar-context.d.ts.map +1 -1
- package/dist/components/filter-bar-context.js.map +1 -1
- package/dist/components/filter-bar-field-utils.cjs +18 -4
- package/dist/components/filter-bar-field-utils.cjs.map +1 -1
- package/dist/components/filter-bar-field-utils.d.ts +3 -2
- package/dist/components/filter-bar-field-utils.d.ts.map +1 -1
- package/dist/components/filter-bar-field-utils.js +19 -5
- package/dist/components/filter-bar-field-utils.js.map +1 -1
- package/dist/components/filter-bar-menu.cjs +189 -0
- package/dist/components/filter-bar-menu.cjs.map +1 -0
- package/dist/components/filter-bar-menu.d.ts +25 -0
- package/dist/components/filter-bar-menu.d.ts.map +1 -0
- package/dist/components/filter-bar-menu.js +189 -0
- package/dist/components/filter-bar-menu.js.map +1 -0
- package/dist/components/filter-bar-multi.cjs +1 -1
- package/dist/components/filter-bar-multi.cjs.map +1 -1
- package/dist/components/filter-bar-multi.js +2 -2
- package/dist/components/filter-bar-multi.js.map +1 -1
- package/dist/components/filter-bar-popup.cjs +37 -0
- package/dist/components/filter-bar-popup.cjs.map +1 -0
- package/dist/components/filter-bar-popup.d.ts +32 -0
- package/dist/components/filter-bar-popup.d.ts.map +1 -0
- package/dist/components/filter-bar-popup.js +37 -0
- package/dist/components/filter-bar-popup.js.map +1 -0
- package/dist/components/filter-bar-tree.cjs +1 -1
- package/dist/components/filter-bar-tree.cjs.map +1 -1
- package/dist/components/filter-bar-tree.js +2 -2
- package/dist/components/filter-bar-tree.js.map +1 -1
- package/dist/components/json-schema-form-date-math.cjs +15 -11
- package/dist/components/json-schema-form-date-math.cjs.map +1 -1
- package/dist/components/json-schema-form-date-math.d.ts +3 -0
- package/dist/components/json-schema-form-date-math.d.ts.map +1 -1
- package/dist/components/json-schema-form-date-math.js +15 -12
- package/dist/components/json-schema-form-date-math.js.map +1 -1
- package/dist/components/json-schema-form-table-array.cjs +5 -3
- package/dist/components/json-schema-form-table-array.cjs.map +1 -1
- package/dist/components/json-schema-form-table-array.d.ts.map +1 -1
- package/dist/components/json-schema-form-table-array.js +5 -3
- package/dist/components/json-schema-form-table-array.js.map +1 -1
- package/dist/components.cjs +1 -1
- package/dist/components.d.ts +1 -0
- package/dist/components.d.ts.map +1 -1
- package/dist/components.js +1 -1
- package/dist/connections/ConnectionPicker.cjs +6 -2
- package/dist/connections/ConnectionPicker.cjs.map +1 -1
- package/dist/connections/ConnectionPicker.d.ts.map +1 -1
- package/dist/connections/ConnectionPicker.js +6 -2
- package/dist/connections/ConnectionPicker.js.map +1 -1
- package/dist/connections/CreateConnectionDialog.cjs +8 -21
- package/dist/connections/CreateConnectionDialog.cjs.map +1 -1
- package/dist/connections/CreateConnectionDialog.d.ts +2 -1
- package/dist/connections/CreateConnectionDialog.d.ts.map +1 -1
- package/dist/connections/CreateConnectionDialog.js +8 -21
- package/dist/connections/CreateConnectionDialog.js.map +1 -1
- package/dist/data/ExpandableMarkdown.cjs +59 -0
- package/dist/data/ExpandableMarkdown.cjs.map +1 -0
- package/dist/data/ExpandableMarkdown.d.ts +17 -0
- package/dist/data/ExpandableMarkdown.d.ts.map +1 -0
- package/dist/data/ExpandableMarkdown.js +59 -0
- package/dist/data/ExpandableMarkdown.js.map +1 -0
- package/dist/data/MultiGaugeBar.cjs +49 -21
- package/dist/data/MultiGaugeBar.cjs.map +1 -1
- package/dist/data/MultiGaugeBar.d.ts +5 -2
- package/dist/data/MultiGaugeBar.d.ts.map +1 -1
- package/dist/data/MultiGaugeBar.js +49 -21
- package/dist/data/MultiGaugeBar.js.map +1 -1
- package/dist/data/PromptDialog.cjs +19 -5
- package/dist/data/PromptDialog.cjs.map +1 -1
- package/dist/data/PromptDialog.d.ts +15 -1
- package/dist/data/PromptDialog.d.ts.map +1 -1
- package/dist/data/PromptDialog.js +19 -5
- package/dist/data/PromptDialog.js.map +1 -1
- package/dist/data/PromptIndicator.cjs +3 -2
- package/dist/data/PromptIndicator.cjs.map +1 -1
- package/dist/data/PromptIndicator.d.ts +4 -1
- package/dist/data/PromptIndicator.d.ts.map +1 -1
- package/dist/data/PromptIndicator.js +3 -2
- package/dist/data/PromptIndicator.js.map +1 -1
- package/dist/data/diagnostics/ErrorDetails.cjs +155 -110
- package/dist/data/diagnostics/ErrorDetails.cjs.map +1 -1
- package/dist/data/diagnostics/ErrorDetails.d.ts.map +1 -1
- package/dist/data/diagnostics/ErrorDetails.js +155 -110
- package/dist/data/diagnostics/ErrorDetails.js.map +1 -1
- package/dist/data/flow-node/BoxNode.cjs +45 -0
- package/dist/data/flow-node/BoxNode.cjs.map +1 -0
- package/dist/data/flow-node/BoxNode.d.ts +28 -0
- package/dist/data/flow-node/BoxNode.d.ts.map +1 -0
- package/dist/data/flow-node/BoxNode.js +45 -0
- package/dist/data/flow-node/BoxNode.js.map +1 -0
- package/dist/data/flow-node/FlowMetrics.cjs +208 -0
- package/dist/data/flow-node/FlowMetrics.cjs.map +1 -0
- package/dist/data/flow-node/FlowMetrics.d.ts +60 -0
- package/dist/data/flow-node/FlowMetrics.d.ts.map +1 -0
- package/dist/data/flow-node/FlowMetrics.js +206 -0
- package/dist/data/flow-node/FlowMetrics.js.map +1 -0
- package/dist/data/flow-node/WorkloadNode.cjs +63 -0
- package/dist/data/flow-node/WorkloadNode.cjs.map +1 -0
- package/dist/data/flow-node/WorkloadNode.d.ts +42 -0
- package/dist/data/flow-node/WorkloadNode.d.ts.map +1 -0
- package/dist/data/flow-node/WorkloadNode.js +63 -0
- package/dist/data/flow-node/WorkloadNode.js.map +1 -0
- package/dist/data/flow-node/index.d.ts +5 -0
- package/dist/data/flow-node/index.d.ts.map +1 -0
- package/dist/data/flow-node/latency.cjs +37 -0
- package/dist/data/flow-node/latency.cjs.map +1 -0
- package/dist/data/flow-node/latency.d.ts +13 -0
- package/dist/data/flow-node/latency.d.ts.map +1 -0
- package/dist/data/flow-node/latency.js +35 -0
- package/dist/data/flow-node/latency.js.map +1 -0
- package/dist/data/test-runner/TestDetailPanel.cjs +109 -46
- package/dist/data/test-runner/TestDetailPanel.cjs.map +1 -1
- package/dist/data/test-runner/TestDetailPanel.d.ts.map +1 -1
- package/dist/data/test-runner/TestDetailPanel.js +110 -47
- package/dist/data/test-runner/TestDetailPanel.js.map +1 -1
- package/dist/data/test-runner/TestTreeNode.cjs +84 -63
- package/dist/data/test-runner/TestTreeNode.cjs.map +1 -1
- package/dist/data/test-runner/TestTreeNode.d.ts.map +1 -1
- package/dist/data/test-runner/TestTreeNode.js +84 -63
- package/dist/data/test-runner/TestTreeNode.js.map +1 -1
- package/dist/data/test-runner/adapter.cjs.map +1 -1
- package/dist/data/test-runner/adapter.d.ts +2 -2
- package/dist/data/test-runner/adapter.d.ts.map +1 -1
- package/dist/data/test-runner/adapter.js.map +1 -1
- package/dist/data/test-runner/copy.cjs +62 -10
- package/dist/data/test-runner/copy.cjs.map +1 -1
- package/dist/data/test-runner/copy.d.ts +52 -9
- package/dist/data/test-runner/copy.d.ts.map +1 -1
- package/dist/data/test-runner/copy.js +60 -11
- package/dist/data/test-runner/copy.js.map +1 -1
- package/dist/data/test-runner/index.d.ts +1 -1
- package/dist/data/test-runner/index.d.ts.map +1 -1
- package/dist/data/traces/index.d.ts +1 -0
- package/dist/data/traces/index.d.ts.map +1 -1
- package/dist/data/traces/otel/OtelTraceDetail.cjs +4 -7
- package/dist/data/traces/otel/OtelTraceDetail.cjs.map +1 -1
- package/dist/data/traces/otel/OtelTraceDetail.js +4 -7
- package/dist/data/traces/otel/OtelTraceDetail.js.map +1 -1
- package/dist/data/traces/otel/OtelTraceSearch.cjs +90 -56
- package/dist/data/traces/otel/OtelTraceSearch.cjs.map +1 -1
- package/dist/data/traces/otel/OtelTraceSearch.d.ts.map +1 -1
- package/dist/data/traces/otel/OtelTraceSearch.js +91 -57
- package/dist/data/traces/otel/OtelTraceSearch.js.map +1 -1
- package/dist/data/traces/otel/QueryBar.cjs +83 -10
- package/dist/data/traces/otel/QueryBar.cjs.map +1 -1
- package/dist/data/traces/otel/QueryBar.d.ts.map +1 -1
- package/dist/data/traces/otel/QueryBar.js +83 -10
- package/dist/data/traces/otel/QueryBar.js.map +1 -1
- package/dist/data/traces/otel/TraceResults.cjs +81 -13
- package/dist/data/traces/otel/TraceResults.cjs.map +1 -1
- package/dist/data/traces/otel/TraceResults.d.ts +11 -3
- package/dist/data/traces/otel/TraceResults.d.ts.map +1 -1
- package/dist/data/traces/otel/TraceResults.js +81 -13
- package/dist/data/traces/otel/TraceResults.js.map +1 -1
- package/dist/data/traces/otel/api.cjs.map +1 -1
- package/dist/data/traces/otel/api.d.ts +14 -0
- package/dist/data/traces/otel/api.d.ts.map +1 -1
- package/dist/data/traces/otel/api.js.map +1 -1
- package/dist/data/traces/otel/query.cjs +2 -2
- package/dist/data/traces/otel/query.cjs.map +1 -1
- package/dist/data/traces/otel/query.d.ts +1 -1
- package/dist/data/traces/otel/query.d.ts.map +1 -1
- package/dist/data/traces/otel/query.js +2 -2
- package/dist/data/traces/otel/query.js.map +1 -1
- package/dist/data/verification/StepFilesView.cjs +90 -0
- package/dist/data/verification/StepFilesView.cjs.map +1 -0
- package/dist/data/verification/StepFilesView.d.ts +9 -0
- package/dist/data/verification/StepFilesView.d.ts.map +1 -0
- package/dist/data/verification/StepFilesView.js +90 -0
- package/dist/data/verification/StepFilesView.js.map +1 -0
- package/dist/data/verification/adapterViews.cjs +129 -69
- package/dist/data/verification/adapterViews.cjs.map +1 -1
- package/dist/data/verification/adapterViews.d.ts +3 -1
- package/dist/data/verification/adapterViews.d.ts.map +1 -1
- package/dist/data/verification/adapterViews.js +130 -70
- package/dist/data/verification/adapterViews.js.map +1 -1
- package/dist/data/verification/adapters.cjs +9 -0
- package/dist/data/verification/adapters.cjs.map +1 -1
- package/dist/data/verification/adapters.d.ts +2 -0
- package/dist/data/verification/adapters.d.ts.map +1 -1
- package/dist/data/verification/adapters.js +11 -2
- package/dist/data/verification/adapters.js.map +1 -1
- package/dist/data/verification/index.d.ts +2 -1
- package/dist/data/verification/index.d.ts.map +1 -1
- package/dist/data/verification/stepKind.cjs +63 -7
- package/dist/data/verification/stepKind.cjs.map +1 -1
- package/dist/data/verification/stepKind.d.ts +55 -6
- package/dist/data/verification/stepKind.d.ts.map +1 -1
- package/dist/data/verification/stepKind.js +62 -8
- package/dist/data/verification/stepKind.js.map +1 -1
- package/dist/data/verification/stepKindViews.cjs +318 -106
- package/dist/data/verification/stepKindViews.cjs.map +1 -1
- package/dist/data/verification/stepKindViews.d.ts +17 -6
- package/dist/data/verification/stepKindViews.d.ts.map +1 -1
- package/dist/data/verification/stepKindViews.js +319 -108
- package/dist/data/verification/stepKindViews.js.map +1 -1
- package/dist/data/version-info.cjs +3 -3
- package/dist/data/version-info.cjs.map +1 -1
- package/dist/data/version-info.js +3 -3
- package/dist/data/version-info.js.map +1 -1
- package/dist/data/workload-panel/MemoryStack.cjs +38 -1
- package/dist/data/workload-panel/MemoryStack.cjs.map +1 -1
- package/dist/data/workload-panel/MemoryStack.d.ts.map +1 -1
- package/dist/data/workload-panel/MemoryStack.js +38 -1
- package/dist/data/workload-panel/MemoryStack.js.map +1 -1
- package/dist/data.cjs +22 -1
- package/dist/data.d.ts +3 -1
- package/dist/data.d.ts.map +1 -1
- package/dist/data.js +10 -3
- package/dist/file-findings/AnnotatedCode.cjs +18 -2
- package/dist/file-findings/AnnotatedCode.cjs.map +1 -1
- package/dist/file-findings/AnnotatedCode.d.ts +2 -0
- package/dist/file-findings/AnnotatedCode.d.ts.map +1 -1
- package/dist/file-findings/AnnotatedCode.js +18 -2
- package/dist/file-findings/AnnotatedCode.js.map +1 -1
- package/dist/file-findings/FileFindingsView.cjs.map +1 -1
- package/dist/file-findings/FileFindingsView.d.ts +2 -0
- package/dist/file-findings/FileFindingsView.d.ts.map +1 -1
- package/dist/file-findings/FileFindingsView.js.map +1 -1
- package/dist/file-findings/file-review/FileReview.cjs +2 -1
- package/dist/file-findings/file-review/FileReview.cjs.map +1 -1
- package/dist/file-findings/file-review/FileReview.d.ts +3 -1
- package/dist/file-findings/file-review/FileReview.d.ts.map +1 -1
- package/dist/file-findings/file-review/FileReview.js +2 -1
- package/dist/file-findings/file-review/FileReview.js.map +1 -1
- package/dist/hooks/use-prompts.cjs +52 -30
- package/dist/hooks/use-prompts.cjs.map +1 -1
- package/dist/hooks/use-prompts.d.ts +6 -0
- package/dist/hooks/use-prompts.d.ts.map +1 -1
- package/dist/hooks/use-prompts.js +52 -30
- package/dist/hooks/use-prompts.js.map +1 -1
- package/dist/index.cjs +23 -2
- package/dist/index.js +11 -4
- package/dist/profiles/editor/profileEditor.cjs +29 -30
- package/dist/profiles/editor/profileEditor.cjs.map +1 -1
- package/dist/profiles/editor/profileEditor.d.ts.map +1 -1
- package/dist/profiles/editor/profileEditor.js +29 -30
- package/dist/profiles/editor/profileEditor.js.map +1 -1
- package/dist/profiles/editor/profileEditorPreview.cjs +44 -43
- package/dist/profiles/editor/profileEditorPreview.cjs.map +1 -1
- package/dist/profiles/editor/profileEditorPreview.d.ts +10 -5
- package/dist/profiles/editor/profileEditorPreview.d.ts.map +1 -1
- package/dist/profiles/editor/profileEditorPreview.js +44 -43
- package/dist/profiles/editor/profileEditorPreview.js.map +1 -1
- package/dist/profiles/editor/profileMappingPreview.cjs +153 -48
- package/dist/profiles/editor/profileMappingPreview.cjs.map +1 -1
- package/dist/profiles/editor/profileMappingPreview.d.ts +16 -2
- package/dist/profiles/editor/profileMappingPreview.d.ts.map +1 -1
- package/dist/profiles/editor/profileMappingPreview.js +155 -50
- package/dist/profiles/editor/profileMappingPreview.js.map +1 -1
- package/dist/profiles/editor/sampleError.cjs +29 -0
- package/dist/profiles/editor/sampleError.cjs.map +1 -0
- package/dist/profiles/editor/sampleError.d.ts +16 -0
- package/dist/profiles/editor/sampleError.d.ts.map +1 -0
- package/dist/profiles/editor/sampleError.js +27 -0
- package/dist/profiles/editor/sampleError.js.map +1 -0
- package/dist/profiles/query/profileSampleResult.cjs.map +1 -1
- package/dist/profiles/query/profileSampleResult.d.ts +2 -0
- package/dist/profiles/query/profileSampleResult.d.ts.map +1 -1
- package/dist/profiles/query/profileSampleResult.js.map +1 -1
- package/dist/profiles/wizard/profileWizardQueryStep.cjs +1 -0
- package/dist/profiles/wizard/profileWizardQueryStep.cjs.map +1 -1
- package/dist/profiles/wizard/profileWizardQueryStep.d.ts +2 -0
- package/dist/profiles/wizard/profileWizardQueryStep.d.ts.map +1 -1
- package/dist/profiles/wizard/profileWizardQueryStep.js +1 -0
- package/dist/profiles/wizard/profileWizardQueryStep.js.map +1 -1
- package/dist/react-grab/core/index.js +1 -1
- package/dist/react-grab/{core-BERtFDWh.js → core-BK5CU6Lb.js} +2 -2
- package/dist/react-grab/index.js +1 -1
- package/dist/react-grab/{renderer-KT3FY3K2.js → renderer-DcHrsQ8k.js} +1 -1
- package/dist/rpc/apiClient.cjs +12 -15
- package/dist/rpc/apiClient.cjs.map +1 -1
- package/dist/rpc/apiClient.js +12 -15
- package/dist/rpc/apiClient.js.map +1 -1
- package/dist/runtime/barrels.json +6507 -6460
- package/dist/runtime/importmap.json +2198 -2185
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
const require_result_model = require("./result-model.cjs");
|
|
2
2
|
const require_Badge = require("../../Badge.cjs");
|
|
3
3
|
const require_DataTable = require("../../DataTable.cjs");
|
|
4
|
+
const require_UiFileSpreadsheet = require("../../../icons/components/UiFileSpreadsheet.cjs");
|
|
5
|
+
const require_UiJson = require("../../../icons/components/UiJson.cjs");
|
|
6
|
+
const require_download_text = require("../../../jvm/threads/download-text.cjs");
|
|
7
|
+
const require_TagList = require("../../cells/TagList.cjs");
|
|
8
|
+
const require_tag_utils = require("../../cells/tag-utils.cjs");
|
|
4
9
|
const require_api = require("./api.cjs");
|
|
5
10
|
const require_query = require("./query.cjs");
|
|
6
11
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -92,8 +97,45 @@ function Scatter({ traces, onOpen }) {
|
|
|
92
97
|
]
|
|
93
98
|
});
|
|
94
99
|
}
|
|
95
|
-
|
|
96
|
-
|
|
100
|
+
var CSV_COLUMNS = [
|
|
101
|
+
"traceId",
|
|
102
|
+
"operation",
|
|
103
|
+
"service",
|
|
104
|
+
"scope",
|
|
105
|
+
"startedAt",
|
|
106
|
+
"durationMs",
|
|
107
|
+
"spanCount",
|
|
108
|
+
"errors",
|
|
109
|
+
"services",
|
|
110
|
+
"tags",
|
|
111
|
+
"processTags"
|
|
112
|
+
];
|
|
113
|
+
/** RFC 4180 CSV of the traces; a list cell joins its entries with `;`, a tag cell as `key=value`. */
|
|
114
|
+
function tracesCsv(traces) {
|
|
115
|
+
const cell = (value) => {
|
|
116
|
+
const text = Array.isArray(value) ? value.join(";") : value && typeof value === "object" ? Object.entries(value).map(([key, entry]) => `${key}=${entry}`).join(";") : value === void 0 ? "" : String(value);
|
|
117
|
+
return /[",\n\r]/.test(text) ? `"${text.replaceAll("\"", "\"\"")}"` : text;
|
|
118
|
+
};
|
|
119
|
+
return [CSV_COLUMNS.join(","), ...traces.map((trace) => CSV_COLUMNS.map((column) => cell(trace[column])).join(","))].join("\n");
|
|
120
|
+
}
|
|
121
|
+
/** The column menu's downloads of the listed traces. */
|
|
122
|
+
var downloadActions = (traces) => [{
|
|
123
|
+
id: "download-json",
|
|
124
|
+
label: "JSON",
|
|
125
|
+
icon: require_UiJson.UiJson,
|
|
126
|
+
onSelect: () => require_download_text.downloadText("traces.json", JSON.stringify(traces, null, 2))
|
|
127
|
+
}, {
|
|
128
|
+
id: "download-csv",
|
|
129
|
+
label: "CSV",
|
|
130
|
+
icon: require_UiFileSpreadsheet.UiFileSpreadsheet,
|
|
131
|
+
onSelect: () => require_download_text.downloadText("traces.csv", tracesCsv(traces))
|
|
132
|
+
}];
|
|
133
|
+
/**
|
|
134
|
+
* The traces, newest first: what ran, in which service and scope, its root span's tags, when, how long against the
|
|
135
|
+
* slowest, and its span count. The root's process tags are a column the menu reveals. Given `attributeFilter`, including
|
|
136
|
+
* or excluding a tag filters the search by that `key=value`, beside the attributes it already filters by.
|
|
137
|
+
*/
|
|
138
|
+
function ResultTable({ traces, href, onOpen, now, attributeFilter, tableProps = {} }) {
|
|
97
139
|
const slowest = Math.max(1, ...traces.map((trace) => trace.durationMs));
|
|
98
140
|
const columns = [
|
|
99
141
|
{
|
|
@@ -130,6 +172,26 @@ function ResultTable({ traces, href, onOpen, now, tableProps = {} }) {
|
|
|
130
172
|
]
|
|
131
173
|
})
|
|
132
174
|
},
|
|
175
|
+
{
|
|
176
|
+
key: "service",
|
|
177
|
+
label: "Service"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
key: "scope",
|
|
181
|
+
label: "Scope"
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
key: "tags",
|
|
185
|
+
label: "Tags",
|
|
186
|
+
kind: "tags",
|
|
187
|
+
minWidth: 240
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
key: "processTags",
|
|
191
|
+
label: "Process tags",
|
|
192
|
+
kind: "tags",
|
|
193
|
+
minWidth: 240
|
|
194
|
+
},
|
|
133
195
|
{
|
|
134
196
|
key: "startedAt",
|
|
135
197
|
label: "Started",
|
|
@@ -168,18 +230,24 @@ function ResultTable({ traces, href, onOpen, now, tableProps = {} }) {
|
|
|
168
230
|
align: "right"
|
|
169
231
|
}
|
|
170
232
|
];
|
|
233
|
+
const table = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_DataTable.DataTable, {
|
|
234
|
+
...tableProps,
|
|
235
|
+
data: traces,
|
|
236
|
+
columns,
|
|
237
|
+
defaultHiddenColumns: ["processTags"],
|
|
238
|
+
menuActions: downloadActions(traces),
|
|
239
|
+
getRowId: (trace) => trace.traceId,
|
|
240
|
+
autoFilter: false,
|
|
241
|
+
getRowHref: (trace) => href(trace.traceId),
|
|
242
|
+
onRowClick: (trace) => onOpen(trace.traceId),
|
|
243
|
+
emptyMessage: "No traces match. Widen the time range, clear the duration or attribute filters, or show single-span traces."
|
|
244
|
+
});
|
|
171
245
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
172
|
-
className: "flex h-[28rem] min-
|
|
173
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
getRowId: (trace) => trace.traceId,
|
|
178
|
-
autoFilter: false,
|
|
179
|
-
getRowHref: (trace) => href(trace.traceId),
|
|
180
|
-
onRowClick: (trace) => onOpen(trace.traceId),
|
|
181
|
-
emptyMessage: "No traces match. Widen the time range, clear the duration or attribute filters, or show single-span traces."
|
|
182
|
-
})
|
|
246
|
+
className: "flex min-h-[28rem] min-w-0 flex-1 flex-col",
|
|
247
|
+
children: attributeFilter ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_TagList.TagActionsProvider, {
|
|
248
|
+
value: require_tag_utils.tagActionsFromRecord(attributeFilter.attributes, attributeFilter.onChange),
|
|
249
|
+
children: table
|
|
250
|
+
}) : table
|
|
183
251
|
});
|
|
184
252
|
}
|
|
185
253
|
exports.ResultSummary = ResultSummary;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TraceResults.cjs","names":["niceStep","duration","shortOperation","Badge","ago","DataTable"],"sources":["../../../../src/data/traces/otel/TraceResults.tsx"],"sourcesContent":["import { ago, niceStep } from \"./result-model\";\nimport { Badge } from \"../../Badge\";\nimport { DataTable, type DataTableColumn, type DataTableProps } from \"../../DataTable\";\nimport { duration, type SearchResult, type Summary } from \"./api\";\nimport { shortOperation } from \"./query\";\n\nconst startMs = (trace: Summary) => Date.parse(trace.startedAt);\nconst clock = (ms: number) => new Date(ms).toLocaleTimeString([], { hour: \"2-digit\", minute: \"2-digit\", second: \"2-digit\" });\n\n/** How many traces match, newest first; the table pages through them. */\nexport function ResultSummary({ result }: { result: SearchResult }) {\n return (\n <p className=\"text-sm text-muted-foreground\">\n <span className=\"font-medium text-foreground\">{result.total.toLocaleString()}</span> {result.total === 1 ? \"trace matches\" : \"traces match\"} · newest first\n </p>\n );\n}\n\n/** Each trace by when it started and how long it took, dot size by span count. */\nexport function Scatter({ traces, onOpen }: { traces: Summary[]; onOpen: (id: string) => void }) {\n const starts = traces.map(startMs);\n const t0 = Math.min(...starts);\n const span = Math.max(...starts) - t0;\n const slowest = Math.max(...traces.map(trace => trace.durationMs)) || 1;\n const step = niceStep(slowest, 4);\n const top = Math.ceil((slowest * 1.05) / step) * step;\n const yTicks = Array.from({ length: Math.round(top / step) + 1 }, (_, i) => i * step);\n // Traces that all started together sit mid-axis under one tick.\n const xTicks = span === 0 ? [0.5] : [0, 0.25, 0.5, 0.75, 1];\n const x = (ms: number) => (span === 0 ? 0.5 : (ms - t0) / span);\n return (\n <figure className=\"rounded-lg border border-border p-density-2\" aria-label=\"Duration over time\">\n <figcaption className=\"mb-1 flex items-center gap-3 text-xs text-muted-foreground\">\n <span className=\"font-medium text-foreground\">Duration over time</span>\n <span>dot size = span count · click to open</span>\n </figcaption>\n <div className=\"relative ml-[4.5rem] mr-2 mt-3.5 h-[180px]\">\n {yTicks.map(y => (\n <div key={y} className=\"absolute inset-x-0 border-t border-border/60\" style={{ bottom: `${(y / top) * 100}%` }}>\n <span className=\"absolute right-full -translate-y-1/2 whitespace-nowrap pr-1.5 text-xs tabular-nums text-muted-foreground\">{y === 0 ? \"0\" : duration(y)}</span>\n </div>\n ))}\n {traces.map(trace => {\n const size = 6 + Math.log2(trace.spanCount) * 1.6;\n const label = `${shortOperation(trace.operation)}, ${duration(trace.durationMs)}, ${trace.spanCount} spans at ${clock(startMs(trace))}`;\n return (\n <button\n key={trace.traceId}\n type=\"button\"\n aria-label={label}\n title={label}\n onClick={() => onOpen(trace.traceId)}\n className={`absolute -translate-x-1/2 translate-y-1/2 rounded-full opacity-75 hover:ring-2 hover:ring-ring ${trace.errors > 0 ? \"bg-destructive\" : trace.spanCount > 1 ? \"bg-primary\" : \"bg-muted-foreground\"}`}\n style={{ left: `${x(startMs(trace)) * 100}%`, bottom: `${(trace.durationMs / top) * 100}%`, width: size, height: size }}\n />\n );\n })}\n </div>\n <div className=\"relative ml-[4.5rem] mr-2 mt-1 h-4 text-xs tabular-nums text-muted-foreground\">\n {xTicks.map((fraction, i) => (\n <span key={fraction} className={`absolute whitespace-nowrap ${xTicks.length > 1 && i === 0 ? \"\" : xTicks.length > 1 && i === xTicks.length - 1 ? \"-translate-x-full\" : \"-translate-x-1/2\"}`} style={{ left: `${fraction * 100}%` }}>\n {clock(t0 + fraction * span)}\n </span>\n ))}\n </div>\n </figure>\n );\n}\n\n/** The traces, newest first: what ran, when, how long against the slowest, and its span count. */\nexport function ResultTable({ traces, href, onOpen, now, tableProps = {} }: { traces: Summary[]; href: (id: string) => string; onOpen: (id: string) => void; now: number; tableProps?: Pick<DataTableProps<Summary>, \"externalFilters\" | \"externalSearch\" | \"externalTimeRange\" | \"pagination\" | \"infinite\" | \"loading\"> }) {\n const slowest = Math.max(1, ...traces.map(trace => trace.durationMs));\n const columns: DataTableColumn<Summary>[] = [\n {\n key: \"operation\",\n label: \"Trace\",\n grow: true,\n minWidth: 320,\n render: (_, trace) => (\n <span className=\"flex min-w-0 items-center gap-2\" title={trace.operation}>\n <span className=\"shrink-0 font-medium\">{shortOperation(trace.operation) || trace.traceId}</span>\n <code className=\"text-xs text-muted-foreground\">{trace.traceId.slice(0, 8)}</code>\n {trace.services.length > 1 && <span className=\"truncate text-xs text-muted-foreground\">{trace.services.join(\" → \")}</span>}\n {trace.errors > 0 && <Badge size=\"sm\" tone=\"danger\" variant=\"soft\">{trace.errors} {trace.errors === 1 ? \"error\" : \"errors\"}</Badge>}\n </span>\n ),\n },\n {\n key: \"startedAt\",\n label: \"Started\",\n render: (_, trace) => <span className=\"whitespace-nowrap tabular-nums\">{clock(startMs(trace))} <span className=\"text-muted-foreground\">{ago(now - startMs(trace))}</span></span>,\n },\n {\n key: \"durationMs\",\n label: \"Duration\",\n render: (_, trace) => (\n <span className=\"flex items-center gap-2\">\n <span className=\"relative h-1.5 w-24 rounded-full bg-muted\">\n <span className=\"absolute inset-y-0 left-0 rounded-full bg-primary\" style={{ width: `${(trace.durationMs / slowest) * 100}%` }} />\n </span>\n <span className=\"tabular-nums\">{duration(trace.durationMs)}</span>\n </span>\n ),\n },\n { key: \"spanCount\", label: \"Spans\", align: \"right\" },\n ];\n return (\n <div className=\"flex h-[28rem] min-h-0 flex-col\">\n <DataTable\n {...tableProps}\n data={traces}\n columns={columns}\n getRowId={trace => trace.traceId}\n autoFilter={false}\n getRowHref={trace => href(trace.traceId)}\n onRowClick={trace => onOpen(trace.traceId)}\n emptyMessage=\"No traces match. Widen the time range, clear the duration or attribute filters, or show single-span traces.\"\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;AAM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,CAAC;KAAE;KAAC,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;MAAM,WAAU;MAAyB,UAAAC,qBAAAA,IAAI,MAAM,QAAQ,KAAK,CAAC;KAAQ,CAAA;IAAO;;EACjL;EACA;GACE,KAAK;GACL,OAAO;GACP,SAAS,GAAG,UACV,iBAAA,GAAA,kBAAA,KAAA,CAAC,QAAD;IAAM,WAAU;IAAhB,UAAA,CACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;KAAM,WAAU;KACd,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;MAAM,WAAU;MAAoD,OAAO,EAAE,OAAO,GAAI,MAAM,aAAa,UAAW,IAAI,GAAG;KAAI,CAAA;IAC7H,CAAA,GACN,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;KAAM,WAAU;KAAgB,UAAAH,YAAAA,SAAS,MAAM,UAAU;IAAQ,CAAA,CAC7D;;EAEV;EACA;GAAE,KAAK;GAAa,OAAO;GAAS,OAAO;EAAQ;CACrD;CACA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EAAK,WAAU;EACb,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACI,kBAAAA,WAAD;GACE,GAAI;GACJ,MAAM;GACG;GACT,WAAU,UAAS,MAAM;GACzB,YAAY;GACZ,aAAY,UAAS,KAAK,MAAM,OAAO;GACvC,aAAY,UAAS,OAAO,MAAM,OAAO;GACzC,cAAa;EACd,CAAA;CACE,CAAA;AAET"}
|
|
1
|
+
{"version":3,"file":"TraceResults.cjs","names":["niceStep","duration","shortOperation","UiJson","downloadText","UiFileSpreadsheet","Badge","ago","DataTable","TagActionsProvider","tagActionsFromRecord"],"sources":["../../../../src/data/traces/otel/TraceResults.tsx"],"sourcesContent":["import { ago, niceStep } from \"./result-model\";\nimport { Badge } from \"../../Badge\";\nimport { DataTable, type DataTableColumn, type DataTableMenuAction, type DataTableProps } from \"../../DataTable\";\nimport { UiFileSpreadsheet, UiJson } from \"../../../icons\";\nimport { downloadText } from \"../../../jvm/threads/download-text\";\nimport { TagActionsProvider } from \"../../cells/TagList\";\nimport { tagActionsFromRecord } from \"../../cells/tag-utils\";\nimport { duration, type Modes, type SearchResult, type Summary } from \"./api\";\nimport { shortOperation } from \"./query\";\n\nconst startMs = (trace: Summary) => Date.parse(trace.startedAt);\nconst clock = (ms: number) => new Date(ms).toLocaleTimeString([], { hour: \"2-digit\", minute: \"2-digit\", second: \"2-digit\" });\n\n/** How many traces match, newest first; the table pages through them. */\nexport function ResultSummary({ result }: { result: SearchResult }) {\n return (\n <p className=\"text-sm text-muted-foreground\">\n <span className=\"font-medium text-foreground\">{result.total.toLocaleString()}</span> {result.total === 1 ? \"trace matches\" : \"traces match\"} · newest first\n </p>\n );\n}\n\n/** Each trace by when it started and how long it took, dot size by span count. */\nexport function Scatter({ traces, onOpen }: { traces: Summary[]; onOpen: (id: string) => void }) {\n const starts = traces.map(startMs);\n const t0 = Math.min(...starts);\n const span = Math.max(...starts) - t0;\n const slowest = Math.max(...traces.map(trace => trace.durationMs)) || 1;\n const step = niceStep(slowest, 4);\n const top = Math.ceil((slowest * 1.05) / step) * step;\n const yTicks = Array.from({ length: Math.round(top / step) + 1 }, (_, i) => i * step);\n // Traces that all started together sit mid-axis under one tick.\n const xTicks = span === 0 ? [0.5] : [0, 0.25, 0.5, 0.75, 1];\n const x = (ms: number) => (span === 0 ? 0.5 : (ms - t0) / span);\n return (\n <figure className=\"rounded-lg border border-border p-density-2\" aria-label=\"Duration over time\">\n <figcaption className=\"mb-1 flex items-center gap-3 text-xs text-muted-foreground\">\n <span className=\"font-medium text-foreground\">Duration over time</span>\n <span>dot size = span count · click to open</span>\n </figcaption>\n <div className=\"relative ml-[4.5rem] mr-2 mt-3.5 h-[180px]\">\n {yTicks.map(y => (\n <div key={y} className=\"absolute inset-x-0 border-t border-border/60\" style={{ bottom: `${(y / top) * 100}%` }}>\n <span className=\"absolute right-full -translate-y-1/2 whitespace-nowrap pr-1.5 text-xs tabular-nums text-muted-foreground\">{y === 0 ? \"0\" : duration(y)}</span>\n </div>\n ))}\n {traces.map(trace => {\n const size = 6 + Math.log2(trace.spanCount) * 1.6;\n const label = `${shortOperation(trace.operation)}, ${duration(trace.durationMs)}, ${trace.spanCount} spans at ${clock(startMs(trace))}`;\n return (\n <button\n key={trace.traceId}\n type=\"button\"\n aria-label={label}\n title={label}\n onClick={() => onOpen(trace.traceId)}\n className={`absolute -translate-x-1/2 translate-y-1/2 rounded-full opacity-75 hover:ring-2 hover:ring-ring ${trace.errors > 0 ? \"bg-destructive\" : trace.spanCount > 1 ? \"bg-primary\" : \"bg-muted-foreground\"}`}\n style={{ left: `${x(startMs(trace)) * 100}%`, bottom: `${(trace.durationMs / top) * 100}%`, width: size, height: size }}\n />\n );\n })}\n </div>\n <div className=\"relative ml-[4.5rem] mr-2 mt-1 h-4 text-xs tabular-nums text-muted-foreground\">\n {xTicks.map((fraction, i) => (\n <span key={fraction} className={`absolute whitespace-nowrap ${xTicks.length > 1 && i === 0 ? \"\" : xTicks.length > 1 && i === xTicks.length - 1 ? \"-translate-x-full\" : \"-translate-x-1/2\"}`} style={{ left: `${fraction * 100}%` }}>\n {clock(t0 + fraction * span)}\n </span>\n ))}\n </div>\n </figure>\n );\n}\n\nconst CSV_COLUMNS = [\"traceId\", \"operation\", \"service\", \"scope\", \"startedAt\", \"durationMs\", \"spanCount\", \"errors\", \"services\", \"tags\", \"processTags\"] as const;\n\n/** RFC 4180 CSV of the traces; a list cell joins its entries with `;`, a tag cell as `key=value`. */\nfunction tracesCsv(traces: Summary[]): string {\n const cell = (value: unknown) => {\n const text = Array.isArray(value) ? value.join(\";\")\n : value && typeof value === \"object\" ? Object.entries(value).map(([key, entry]) => `${key}=${entry}`).join(\";\")\n : value === undefined ? \"\" : String(value);\n return /[\",\\n\\r]/.test(text) ? `\"${text.replaceAll('\"', '\"\"')}\"` : text;\n };\n return [CSV_COLUMNS.join(\",\"), ...traces.map(trace => CSV_COLUMNS.map(column => cell(trace[column])).join(\",\"))].join(\"\\n\");\n}\n\n/** The column menu's downloads of the listed traces. */\nconst downloadActions = (traces: Summary[]): DataTableMenuAction[] => [\n { id: \"download-json\", label: \"JSON\", icon: UiJson, onSelect: () => downloadText(\"traces.json\", JSON.stringify(traces, null, 2)) },\n { id: \"download-csv\", label: \"CSV\", icon: UiFileSpreadsheet, onSelect: () => downloadText(\"traces.csv\", tracesCsv(traces)) },\n];\n\n/**\n * The traces, newest first: what ran, in which service and scope, its root span's tags, when, how long against the\n * slowest, and its span count. The root's process tags are a column the menu reveals. Given `attributeFilter`, including\n * or excluding a tag filters the search by that `key=value`, beside the attributes it already filters by.\n */\nexport function ResultTable({ traces, href, onOpen, now, attributeFilter, tableProps = {} }: {\n traces: Summary[]; href: (id: string) => string; onOpen: (id: string) => void; now: number;\n attributeFilter?: { attributes: Modes; onChange: (attributes: Modes) => void };\n tableProps?: Pick<DataTableProps<Summary>, \"externalFilters\" | \"externalSearch\" | \"externalTimeRange\" | \"pagination\" | \"infinite\" | \"loading\">;\n}) {\n const slowest = Math.max(1, ...traces.map(trace => trace.durationMs));\n const columns: DataTableColumn<Summary>[] = [\n {\n key: \"operation\",\n label: \"Trace\",\n grow: true,\n minWidth: 320,\n render: (_, trace) => (\n <span className=\"flex min-w-0 items-center gap-2\" title={trace.operation}>\n <span className=\"shrink-0 font-medium\">{shortOperation(trace.operation) || trace.traceId}</span>\n <code className=\"text-xs text-muted-foreground\">{trace.traceId.slice(0, 8)}</code>\n {trace.services.length > 1 && <span className=\"truncate text-xs text-muted-foreground\">{trace.services.join(\" → \")}</span>}\n {trace.errors > 0 && <Badge size=\"sm\" tone=\"danger\" variant=\"soft\">{trace.errors} {trace.errors === 1 ? \"error\" : \"errors\"}</Badge>}\n </span>\n ),\n },\n { key: \"service\", label: \"Service\" },\n { key: \"scope\", label: \"Scope\" },\n { key: \"tags\", label: \"Tags\", kind: \"tags\", minWidth: 240 },\n { key: \"processTags\", label: \"Process tags\", kind: \"tags\", minWidth: 240 },\n {\n key: \"startedAt\",\n label: \"Started\",\n render: (_, trace) => <span className=\"whitespace-nowrap tabular-nums\">{clock(startMs(trace))} <span className=\"text-muted-foreground\">{ago(now - startMs(trace))}</span></span>,\n },\n {\n key: \"durationMs\",\n label: \"Duration\",\n render: (_, trace) => (\n <span className=\"flex items-center gap-2\">\n <span className=\"relative h-1.5 w-24 rounded-full bg-muted\">\n <span className=\"absolute inset-y-0 left-0 rounded-full bg-primary\" style={{ width: `${(trace.durationMs / slowest) * 100}%` }} />\n </span>\n <span className=\"tabular-nums\">{duration(trace.durationMs)}</span>\n </span>\n ),\n },\n { key: \"spanCount\", label: \"Spans\", align: \"right\" },\n ];\n const table = (\n <DataTable\n {...tableProps}\n data={traces}\n columns={columns}\n defaultHiddenColumns={[\"processTags\"]}\n menuActions={downloadActions(traces)}\n getRowId={trace => trace.traceId}\n autoFilter={false}\n getRowHref={trace => href(trace.traceId)}\n onRowClick={trace => onOpen(trace.traceId)}\n emptyMessage=\"No traces match. Widen the time range, clear the duration or attribute filters, or show single-span traces.\"\n />\n );\n return (\n <div className=\"flex min-h-[28rem] min-w-0 flex-1 flex-col\">\n {attributeFilter\n ? <TagActionsProvider value={tagActionsFromRecord(attributeFilter.attributes, attributeFilter.onChange)}>{table}</TagActionsProvider>\n : table}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAUA,IAAM,WAAW,UAAmB,KAAK,MAAM,MAAM,SAAS;AAC9D,IAAM,SAAS,OAAe,IAAI,KAAK,EAAE,CAAC,CAAC,mBAAmB,CAAC,GAAG;CAAE,MAAM;CAAW,QAAQ;CAAW,QAAQ;AAAU,CAAC;;AAG3H,SAAgB,cAAc,EAAE,UAAoC;CAClE,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,KAAD;EAAG,WAAU;EAAb,UAAA;GACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;IAAM,WAAU;IAA+B,UAAA,OAAO,MAAM,eAAe;GA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H,CAAA,GACN,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;KAAM,WAAU;KAAgB,UAAAN,YAAAA,SAAS,MAAM,UAAU;IAAQ,CAAA,CAC7D;;EAEV;EACA;GAAE,KAAK;GAAa,OAAO;GAAS,OAAO;EAAQ;CACrD;CACA,MAAM,QACF,iBAAA,GAAA,kBAAA,IAAA,CAACO,kBAAAA,WAAD;EACE,GAAI;EACJ,MAAM;EACG;EACT,sBAAsB,CAAC,aAAa;EACpC,aAAa,gBAAgB,MAAM;EACnC,WAAU,UAAS,MAAM;EACzB,YAAY;EACZ,aAAY,UAAS,KAAK,MAAM,OAAO;EACvC,aAAY,UAAS,OAAO,MAAM,OAAO;EACzC,cAAa;CACd,CAAA;CAEL,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EAAK,WAAU;EACZ,UAAA,kBACG,iBAAA,GAAA,kBAAA,IAAA,CAACC,gBAAAA,oBAAD;GAAoB,OAAOC,kBAAAA,qBAAqB,gBAAgB,YAAY,gBAAgB,QAAQ;GAAI,UAAA;EAA0B,CAAA,IAClI;CACD,CAAA;AAET"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DataTableProps } from '../../DataTable.js';
|
|
2
|
-
import { SearchResult, Summary } from './api.js';
|
|
2
|
+
import { Modes, SearchResult, Summary } from './api.js';
|
|
3
3
|
/** How many traces match, newest first; the table pages through them. */
|
|
4
4
|
export declare function ResultSummary({ result }: {
|
|
5
5
|
result: SearchResult;
|
|
@@ -9,12 +9,20 @@ export declare function Scatter({ traces, onOpen }: {
|
|
|
9
9
|
traces: Summary[];
|
|
10
10
|
onOpen: (id: string) => void;
|
|
11
11
|
}): import("react").JSX.Element;
|
|
12
|
-
/**
|
|
13
|
-
|
|
12
|
+
/**
|
|
13
|
+
* The traces, newest first: what ran, in which service and scope, its root span's tags, when, how long against the
|
|
14
|
+
* slowest, and its span count. The root's process tags are a column the menu reveals. Given `attributeFilter`, including
|
|
15
|
+
* or excluding a tag filters the search by that `key=value`, beside the attributes it already filters by.
|
|
16
|
+
*/
|
|
17
|
+
export declare function ResultTable({ traces, href, onOpen, now, attributeFilter, tableProps }: {
|
|
14
18
|
traces: Summary[];
|
|
15
19
|
href: (id: string) => string;
|
|
16
20
|
onOpen: (id: string) => void;
|
|
17
21
|
now: number;
|
|
22
|
+
attributeFilter?: {
|
|
23
|
+
attributes: Modes;
|
|
24
|
+
onChange: (attributes: Modes) => void;
|
|
25
|
+
};
|
|
18
26
|
tableProps?: Pick<DataTableProps<Summary>, "externalFilters" | "externalSearch" | "externalTimeRange" | "pagination" | "infinite" | "loading">;
|
|
19
27
|
}): import("react").JSX.Element;
|
|
20
28
|
//# sourceMappingURL=TraceResults.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TraceResults.d.ts","sourceRoot":"","sources":["../../../../src/data/traces/otel/TraceResults.tsx"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"TraceResults.d.ts","sourceRoot":"","sources":["../../../../src/data/traces/otel/TraceResults.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA6D,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAKjH,OAAO,EAAY,KAAK,KAAK,EAAE,KAAK,YAAY,EAAE,KAAK,OAAO,EAAE,MAAM,OAAO,CAAC;AAM9E,yEAAyE;AACzE,wBAAgB,aAAa,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,YAAY,CAAA;CAAE,+BAMjE;AAED,kFAAkF;AAClF,wBAAgB,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,OAAO,EAAE,CAAC;IAAC,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;CAAE,+BAgD9F;AAqBD;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,eAAe,EAAE,UAAe,EAAE,EAAE;IAC3F,MAAM,EAAE,OAAO,EAAE,CAAC;IAAC,IAAI,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,CAAC;IAAC,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAC3F,eAAe,CAAC,EAAE;QAAE,UAAU,EAAE,KAAK,CAAC;QAAC,QAAQ,EAAE,CAAC,UAAU,EAAE,KAAK,KAAK,IAAI,CAAA;KAAE,CAAC;IAC/E,UAAU,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,gBAAgB,GAAG,mBAAmB,GAAG,YAAY,GAAG,UAAU,GAAG,SAAS,CAAC,CAAC;CAChJ,+BA6DA"}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { ago, niceStep } from "./result-model.js";
|
|
2
2
|
import { Badge } from "../../Badge.js";
|
|
3
3
|
import { DataTable } from "../../DataTable.js";
|
|
4
|
+
import { UiFileSpreadsheet } from "../../../icons/components/UiFileSpreadsheet.js";
|
|
5
|
+
import { UiJson } from "../../../icons/components/UiJson.js";
|
|
6
|
+
import { downloadText } from "../../../jvm/threads/download-text.js";
|
|
7
|
+
import { TagActionsProvider } from "../../cells/TagList.js";
|
|
8
|
+
import { tagActionsFromRecord } from "../../cells/tag-utils.js";
|
|
4
9
|
import { duration } from "./api.js";
|
|
5
10
|
import { shortOperation } from "./query.js";
|
|
6
11
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -92,8 +97,45 @@ function Scatter({ traces, onOpen }) {
|
|
|
92
97
|
]
|
|
93
98
|
});
|
|
94
99
|
}
|
|
95
|
-
|
|
96
|
-
|
|
100
|
+
var CSV_COLUMNS = [
|
|
101
|
+
"traceId",
|
|
102
|
+
"operation",
|
|
103
|
+
"service",
|
|
104
|
+
"scope",
|
|
105
|
+
"startedAt",
|
|
106
|
+
"durationMs",
|
|
107
|
+
"spanCount",
|
|
108
|
+
"errors",
|
|
109
|
+
"services",
|
|
110
|
+
"tags",
|
|
111
|
+
"processTags"
|
|
112
|
+
];
|
|
113
|
+
/** RFC 4180 CSV of the traces; a list cell joins its entries with `;`, a tag cell as `key=value`. */
|
|
114
|
+
function tracesCsv(traces) {
|
|
115
|
+
const cell = (value) => {
|
|
116
|
+
const text = Array.isArray(value) ? value.join(";") : value && typeof value === "object" ? Object.entries(value).map(([key, entry]) => `${key}=${entry}`).join(";") : value === void 0 ? "" : String(value);
|
|
117
|
+
return /[",\n\r]/.test(text) ? `"${text.replaceAll("\"", "\"\"")}"` : text;
|
|
118
|
+
};
|
|
119
|
+
return [CSV_COLUMNS.join(","), ...traces.map((trace) => CSV_COLUMNS.map((column) => cell(trace[column])).join(","))].join("\n");
|
|
120
|
+
}
|
|
121
|
+
/** The column menu's downloads of the listed traces. */
|
|
122
|
+
var downloadActions = (traces) => [{
|
|
123
|
+
id: "download-json",
|
|
124
|
+
label: "JSON",
|
|
125
|
+
icon: UiJson,
|
|
126
|
+
onSelect: () => downloadText("traces.json", JSON.stringify(traces, null, 2))
|
|
127
|
+
}, {
|
|
128
|
+
id: "download-csv",
|
|
129
|
+
label: "CSV",
|
|
130
|
+
icon: UiFileSpreadsheet,
|
|
131
|
+
onSelect: () => downloadText("traces.csv", tracesCsv(traces))
|
|
132
|
+
}];
|
|
133
|
+
/**
|
|
134
|
+
* The traces, newest first: what ran, in which service and scope, its root span's tags, when, how long against the
|
|
135
|
+
* slowest, and its span count. The root's process tags are a column the menu reveals. Given `attributeFilter`, including
|
|
136
|
+
* or excluding a tag filters the search by that `key=value`, beside the attributes it already filters by.
|
|
137
|
+
*/
|
|
138
|
+
function ResultTable({ traces, href, onOpen, now, attributeFilter, tableProps = {} }) {
|
|
97
139
|
const slowest = Math.max(1, ...traces.map((trace) => trace.durationMs));
|
|
98
140
|
const columns = [
|
|
99
141
|
{
|
|
@@ -130,6 +172,26 @@ function ResultTable({ traces, href, onOpen, now, tableProps = {} }) {
|
|
|
130
172
|
]
|
|
131
173
|
})
|
|
132
174
|
},
|
|
175
|
+
{
|
|
176
|
+
key: "service",
|
|
177
|
+
label: "Service"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
key: "scope",
|
|
181
|
+
label: "Scope"
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
key: "tags",
|
|
185
|
+
label: "Tags",
|
|
186
|
+
kind: "tags",
|
|
187
|
+
minWidth: 240
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
key: "processTags",
|
|
191
|
+
label: "Process tags",
|
|
192
|
+
kind: "tags",
|
|
193
|
+
minWidth: 240
|
|
194
|
+
},
|
|
133
195
|
{
|
|
134
196
|
key: "startedAt",
|
|
135
197
|
label: "Started",
|
|
@@ -168,18 +230,24 @@ function ResultTable({ traces, href, onOpen, now, tableProps = {} }) {
|
|
|
168
230
|
align: "right"
|
|
169
231
|
}
|
|
170
232
|
];
|
|
233
|
+
const table = /* @__PURE__ */ jsx(DataTable, {
|
|
234
|
+
...tableProps,
|
|
235
|
+
data: traces,
|
|
236
|
+
columns,
|
|
237
|
+
defaultHiddenColumns: ["processTags"],
|
|
238
|
+
menuActions: downloadActions(traces),
|
|
239
|
+
getRowId: (trace) => trace.traceId,
|
|
240
|
+
autoFilter: false,
|
|
241
|
+
getRowHref: (trace) => href(trace.traceId),
|
|
242
|
+
onRowClick: (trace) => onOpen(trace.traceId),
|
|
243
|
+
emptyMessage: "No traces match. Widen the time range, clear the duration or attribute filters, or show single-span traces."
|
|
244
|
+
});
|
|
171
245
|
return /* @__PURE__ */ jsx("div", {
|
|
172
|
-
className: "flex h-[28rem] min-
|
|
173
|
-
children: /* @__PURE__ */ jsx(
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
getRowId: (trace) => trace.traceId,
|
|
178
|
-
autoFilter: false,
|
|
179
|
-
getRowHref: (trace) => href(trace.traceId),
|
|
180
|
-
onRowClick: (trace) => onOpen(trace.traceId),
|
|
181
|
-
emptyMessage: "No traces match. Widen the time range, clear the duration or attribute filters, or show single-span traces."
|
|
182
|
-
})
|
|
246
|
+
className: "flex min-h-[28rem] min-w-0 flex-1 flex-col",
|
|
247
|
+
children: attributeFilter ? /* @__PURE__ */ jsx(TagActionsProvider, {
|
|
248
|
+
value: tagActionsFromRecord(attributeFilter.attributes, attributeFilter.onChange),
|
|
249
|
+
children: table
|
|
250
|
+
}) : table
|
|
183
251
|
});
|
|
184
252
|
}
|
|
185
253
|
export { ResultSummary, ResultTable, Scatter };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TraceResults.js","names":[],"sources":["../../../../src/data/traces/otel/TraceResults.tsx"],"sourcesContent":["import { ago, niceStep } from \"./result-model\";\nimport { Badge } from \"../../Badge\";\nimport { DataTable, type DataTableColumn, type DataTableProps } from \"../../DataTable\";\nimport { duration, type SearchResult, type Summary } from \"./api\";\nimport { shortOperation } from \"./query\";\n\nconst startMs = (trace: Summary) => Date.parse(trace.startedAt);\nconst clock = (ms: number) => new Date(ms).toLocaleTimeString([], { hour: \"2-digit\", minute: \"2-digit\", second: \"2-digit\" });\n\n/** How many traces match, newest first; the table pages through them. */\nexport function ResultSummary({ result }: { result: SearchResult }) {\n return (\n <p className=\"text-sm text-muted-foreground\">\n <span className=\"font-medium text-foreground\">{result.total.toLocaleString()}</span> {result.total === 1 ? \"trace matches\" : \"traces match\"} · newest first\n </p>\n );\n}\n\n/** Each trace by when it started and how long it took, dot size by span count. */\nexport function Scatter({ traces, onOpen }: { traces: Summary[]; onOpen: (id: string) => void }) {\n const starts = traces.map(startMs);\n const t0 = Math.min(...starts);\n const span = Math.max(...starts) - t0;\n const slowest = Math.max(...traces.map(trace => trace.durationMs)) || 1;\n const step = niceStep(slowest, 4);\n const top = Math.ceil((slowest * 1.05) / step) * step;\n const yTicks = Array.from({ length: Math.round(top / step) + 1 }, (_, i) => i * step);\n // Traces that all started together sit mid-axis under one tick.\n const xTicks = span === 0 ? [0.5] : [0, 0.25, 0.5, 0.75, 1];\n const x = (ms: number) => (span === 0 ? 0.5 : (ms - t0) / span);\n return (\n <figure className=\"rounded-lg border border-border p-density-2\" aria-label=\"Duration over time\">\n <figcaption className=\"mb-1 flex items-center gap-3 text-xs text-muted-foreground\">\n <span className=\"font-medium text-foreground\">Duration over time</span>\n <span>dot size = span count · click to open</span>\n </figcaption>\n <div className=\"relative ml-[4.5rem] mr-2 mt-3.5 h-[180px]\">\n {yTicks.map(y => (\n <div key={y} className=\"absolute inset-x-0 border-t border-border/60\" style={{ bottom: `${(y / top) * 100}%` }}>\n <span className=\"absolute right-full -translate-y-1/2 whitespace-nowrap pr-1.5 text-xs tabular-nums text-muted-foreground\">{y === 0 ? \"0\" : duration(y)}</span>\n </div>\n ))}\n {traces.map(trace => {\n const size = 6 + Math.log2(trace.spanCount) * 1.6;\n const label = `${shortOperation(trace.operation)}, ${duration(trace.durationMs)}, ${trace.spanCount} spans at ${clock(startMs(trace))}`;\n return (\n <button\n key={trace.traceId}\n type=\"button\"\n aria-label={label}\n title={label}\n onClick={() => onOpen(trace.traceId)}\n className={`absolute -translate-x-1/2 translate-y-1/2 rounded-full opacity-75 hover:ring-2 hover:ring-ring ${trace.errors > 0 ? \"bg-destructive\" : trace.spanCount > 1 ? \"bg-primary\" : \"bg-muted-foreground\"}`}\n style={{ left: `${x(startMs(trace)) * 100}%`, bottom: `${(trace.durationMs / top) * 100}%`, width: size, height: size }}\n />\n );\n })}\n </div>\n <div className=\"relative ml-[4.5rem] mr-2 mt-1 h-4 text-xs tabular-nums text-muted-foreground\">\n {xTicks.map((fraction, i) => (\n <span key={fraction} className={`absolute whitespace-nowrap ${xTicks.length > 1 && i === 0 ? \"\" : xTicks.length > 1 && i === xTicks.length - 1 ? \"-translate-x-full\" : \"-translate-x-1/2\"}`} style={{ left: `${fraction * 100}%` }}>\n {clock(t0 + fraction * span)}\n </span>\n ))}\n </div>\n </figure>\n );\n}\n\n/** The traces, newest first: what ran, when, how long against the slowest, and its span count. */\nexport function ResultTable({ traces, href, onOpen, now, tableProps = {} }: { traces: Summary[]; href: (id: string) => string; onOpen: (id: string) => void; now: number; tableProps?: Pick<DataTableProps<Summary>, \"externalFilters\" | \"externalSearch\" | \"externalTimeRange\" | \"pagination\" | \"infinite\" | \"loading\"> }) {\n const slowest = Math.max(1, ...traces.map(trace => trace.durationMs));\n const columns: DataTableColumn<Summary>[] = [\n {\n key: \"operation\",\n label: \"Trace\",\n grow: true,\n minWidth: 320,\n render: (_, trace) => (\n <span className=\"flex min-w-0 items-center gap-2\" title={trace.operation}>\n <span className=\"shrink-0 font-medium\">{shortOperation(trace.operation) || trace.traceId}</span>\n <code className=\"text-xs text-muted-foreground\">{trace.traceId.slice(0, 8)}</code>\n {trace.services.length > 1 && <span className=\"truncate text-xs text-muted-foreground\">{trace.services.join(\" → \")}</span>}\n {trace.errors > 0 && <Badge size=\"sm\" tone=\"danger\" variant=\"soft\">{trace.errors} {trace.errors === 1 ? \"error\" : \"errors\"}</Badge>}\n </span>\n ),\n },\n {\n key: \"startedAt\",\n label: \"Started\",\n render: (_, trace) => <span className=\"whitespace-nowrap tabular-nums\">{clock(startMs(trace))} <span className=\"text-muted-foreground\">{ago(now - startMs(trace))}</span></span>,\n },\n {\n key: \"durationMs\",\n label: \"Duration\",\n render: (_, trace) => (\n <span className=\"flex items-center gap-2\">\n <span className=\"relative h-1.5 w-24 rounded-full bg-muted\">\n <span className=\"absolute inset-y-0 left-0 rounded-full bg-primary\" style={{ width: `${(trace.durationMs / slowest) * 100}%` }} />\n </span>\n <span className=\"tabular-nums\">{duration(trace.durationMs)}</span>\n </span>\n ),\n },\n { key: \"spanCount\", label: \"Spans\", align: \"right\" },\n ];\n return (\n <div className=\"flex h-[28rem] min-h-0 flex-col\">\n <DataTable\n {...tableProps}\n data={traces}\n columns={columns}\n getRowId={trace => trace.traceId}\n autoFilter={false}\n getRowHref={trace => href(trace.traceId)}\n onRowClick={trace => onOpen(trace.traceId)}\n emptyMessage=\"No traces match. Widen the time range, clear the duration or attribute filters, or show single-span traces.\"\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;AAMA,IAAM,WAAW,UAAmB,KAAK,MAAM,MAAM,SAAS;AAC9D,IAAM,SAAS,OAAe,IAAI,KAAK,EAAE,CAAC,CAAC,mBAAmB,CAAC,GAAG;CAAE,MAAM;CAAW,QAAQ;CAAW,QAAQ;AAAU,CAAC;;AAG3H,SAAgB,cAAc,EAAE,UAAoC;CAClE,OACE,qBAAC,KAAD;EAAG,WAAU;EAAb,UAAA;GACE,oBAAC,QAAD;IAAM,WAAU;IAA+B,UAAA,OAAO,MAAM,eAAe;GAAQ,CAAA;GAAC;GAAE,OAAO,UAAU,IAAI,kBAAkB;GAAe;EAC3I;;AAEP;;AAGA,SAAgB,QAAQ,EAAE,QAAQ,UAA+D;CAC/F,MAAM,SAAS,OAAO,IAAI,OAAO;CACjC,MAAM,KAAK,KAAK,IAAI,GAAG,MAAM;CAC7B,MAAM,OAAO,KAAK,IAAI,GAAG,MAAM,IAAI;CACnC,MAAM,UAAU,KAAK,IAAI,GAAG,OAAO,KAAI,UAAS,MAAM,UAAU,CAAC,KAAK;CACtE,MAAM,OAAO,SAAS,SAAS,CAAC;CAChC,MAAM,MAAM,KAAK,KAAM,UAAU,OAAQ,IAAI,IAAI;CACjD,MAAM,SAAS,MAAM,KAAK,EAAE,QAAQ,KAAK,MAAM,MAAM,IAAI,IAAI,EAAE,IAAI,GAAG,MAAM,IAAI,IAAI;CAEpF,MAAM,SAAS,SAAS,IAAI,CAAC,EAAG,IAAI;EAAC;EAAG;EAAM;EAAK;EAAM;CAAC;CAC1D,MAAM,KAAK,OAAgB,SAAS,IAAI,MAAO,KAAK,MAAM;CAC1D,OACE,qBAAC,UAAD;EAAQ,WAAU;EAA8C,cAAW;EAA3E,UAAA;GACE,qBAAC,cAAD;IAAY,WAAU;IAAtB,UAAA,CACE,oBAAC,QAAD;KAAM,WAAU;K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UAAA,SAAS,MAAM,UAAU;IAAQ,CAAA,CAC7D;;EAEV;EACA;GAAE,KAAK;GAAa,OAAO;GAAS,OAAO;EAAQ;CACrD;CACA,OACE,oBAAC,OAAD;EAAK,WAAU;EACb,UAAA,oBAAC,WAAD;GACE,GAAI;GACJ,MAAM;GACG;GACT,WAAU,UAAS,MAAM;GACzB,YAAY;GACZ,aAAY,UAAS,KAAK,MAAM,OAAO;GACvC,aAAY,UAAS,OAAO,MAAM,OAAO;GACzC,cAAa;EACd,CAAA;CACE,CAAA;AAET"}
|
|
1
|
+
{"version":3,"file":"TraceResults.js","names":[],"sources":["../../../../src/data/traces/otel/TraceResults.tsx"],"sourcesContent":["import { ago, niceStep } from \"./result-model\";\nimport { Badge } from \"../../Badge\";\nimport { DataTable, type DataTableColumn, type DataTableMenuAction, type DataTableProps } from \"../../DataTable\";\nimport { UiFileSpreadsheet, UiJson } from \"../../../icons\";\nimport { downloadText } from \"../../../jvm/threads/download-text\";\nimport { TagActionsProvider } from \"../../cells/TagList\";\nimport { tagActionsFromRecord } from \"../../cells/tag-utils\";\nimport { duration, type Modes, type SearchResult, type Summary } from \"./api\";\nimport { shortOperation } from \"./query\";\n\nconst startMs = (trace: Summary) => Date.parse(trace.startedAt);\nconst clock = (ms: number) => new Date(ms).toLocaleTimeString([], { hour: \"2-digit\", minute: \"2-digit\", second: \"2-digit\" });\n\n/** How many traces match, newest first; the table pages through them. */\nexport function ResultSummary({ result }: { result: SearchResult }) {\n return (\n <p className=\"text-sm text-muted-foreground\">\n <span className=\"font-medium text-foreground\">{result.total.toLocaleString()}</span> {result.total === 1 ? \"trace matches\" : \"traces match\"} · newest first\n </p>\n );\n}\n\n/** Each trace by when it started and how long it took, dot size by span count. */\nexport function Scatter({ traces, onOpen }: { traces: Summary[]; onOpen: (id: string) => void }) {\n const starts = traces.map(startMs);\n const t0 = Math.min(...starts);\n const span = Math.max(...starts) - t0;\n const slowest = Math.max(...traces.map(trace => trace.durationMs)) || 1;\n const step = niceStep(slowest, 4);\n const top = Math.ceil((slowest * 1.05) / step) * step;\n const yTicks = Array.from({ length: Math.round(top / step) + 1 }, (_, i) => i * step);\n // Traces that all started together sit mid-axis under one tick.\n const xTicks = span === 0 ? [0.5] : [0, 0.25, 0.5, 0.75, 1];\n const x = (ms: number) => (span === 0 ? 0.5 : (ms - t0) / span);\n return (\n <figure className=\"rounded-lg border border-border p-density-2\" aria-label=\"Duration over time\">\n <figcaption className=\"mb-1 flex items-center gap-3 text-xs text-muted-foreground\">\n <span className=\"font-medium text-foreground\">Duration over time</span>\n <span>dot size = span count · click to open</span>\n </figcaption>\n <div className=\"relative ml-[4.5rem] mr-2 mt-3.5 h-[180px]\">\n {yTicks.map(y => (\n <div key={y} className=\"absolute inset-x-0 border-t border-border/60\" style={{ bottom: `${(y / top) * 100}%` }}>\n <span className=\"absolute right-full -translate-y-1/2 whitespace-nowrap pr-1.5 text-xs tabular-nums text-muted-foreground\">{y === 0 ? \"0\" : duration(y)}</span>\n </div>\n ))}\n {traces.map(trace => {\n const size = 6 + Math.log2(trace.spanCount) * 1.6;\n const label = `${shortOperation(trace.operation)}, ${duration(trace.durationMs)}, ${trace.spanCount} spans at ${clock(startMs(trace))}`;\n return (\n <button\n key={trace.traceId}\n type=\"button\"\n aria-label={label}\n title={label}\n onClick={() => onOpen(trace.traceId)}\n className={`absolute -translate-x-1/2 translate-y-1/2 rounded-full opacity-75 hover:ring-2 hover:ring-ring ${trace.errors > 0 ? \"bg-destructive\" : trace.spanCount > 1 ? \"bg-primary\" : \"bg-muted-foreground\"}`}\n style={{ left: `${x(startMs(trace)) * 100}%`, bottom: `${(trace.durationMs / top) * 100}%`, width: size, height: size }}\n />\n );\n })}\n </div>\n <div className=\"relative ml-[4.5rem] mr-2 mt-1 h-4 text-xs tabular-nums text-muted-foreground\">\n {xTicks.map((fraction, i) => (\n <span key={fraction} className={`absolute whitespace-nowrap ${xTicks.length > 1 && i === 0 ? \"\" : xTicks.length > 1 && i === xTicks.length - 1 ? \"-translate-x-full\" : \"-translate-x-1/2\"}`} style={{ left: `${fraction * 100}%` }}>\n {clock(t0 + fraction * span)}\n </span>\n ))}\n </div>\n </figure>\n );\n}\n\nconst CSV_COLUMNS = [\"traceId\", \"operation\", \"service\", \"scope\", \"startedAt\", \"durationMs\", \"spanCount\", \"errors\", \"services\", \"tags\", \"processTags\"] as const;\n\n/** RFC 4180 CSV of the traces; a list cell joins its entries with `;`, a tag cell as `key=value`. */\nfunction tracesCsv(traces: Summary[]): string {\n const cell = (value: unknown) => {\n const text = Array.isArray(value) ? value.join(\";\")\n : value && typeof value === \"object\" ? Object.entries(value).map(([key, entry]) => `${key}=${entry}`).join(\";\")\n : value === undefined ? \"\" : String(value);\n return /[\",\\n\\r]/.test(text) ? `\"${text.replaceAll('\"', '\"\"')}\"` : text;\n };\n return [CSV_COLUMNS.join(\",\"), ...traces.map(trace => CSV_COLUMNS.map(column => cell(trace[column])).join(\",\"))].join(\"\\n\");\n}\n\n/** The column menu's downloads of the listed traces. */\nconst downloadActions = (traces: Summary[]): DataTableMenuAction[] => [\n { id: \"download-json\", label: \"JSON\", icon: UiJson, onSelect: () => downloadText(\"traces.json\", JSON.stringify(traces, null, 2)) },\n { id: \"download-csv\", label: \"CSV\", icon: UiFileSpreadsheet, onSelect: () => downloadText(\"traces.csv\", tracesCsv(traces)) },\n];\n\n/**\n * The traces, newest first: what ran, in which service and scope, its root span's tags, when, how long against the\n * slowest, and its span count. The root's process tags are a column the menu reveals. Given `attributeFilter`, including\n * or excluding a tag filters the search by that `key=value`, beside the attributes it already filters by.\n */\nexport function ResultTable({ traces, href, onOpen, now, attributeFilter, tableProps = {} }: {\n traces: Summary[]; href: (id: string) => string; onOpen: (id: string) => void; now: number;\n attributeFilter?: { attributes: Modes; onChange: (attributes: Modes) => void };\n tableProps?: Pick<DataTableProps<Summary>, \"externalFilters\" | \"externalSearch\" | \"externalTimeRange\" | \"pagination\" | \"infinite\" | \"loading\">;\n}) {\n const slowest = Math.max(1, ...traces.map(trace => trace.durationMs));\n const columns: DataTableColumn<Summary>[] = [\n {\n key: \"operation\",\n label: \"Trace\",\n grow: true,\n minWidth: 320,\n render: (_, trace) => (\n <span className=\"flex min-w-0 items-center gap-2\" title={trace.operation}>\n <span className=\"shrink-0 font-medium\">{shortOperation(trace.operation) || trace.traceId}</span>\n <code className=\"text-xs text-muted-foreground\">{trace.traceId.slice(0, 8)}</code>\n {trace.services.length > 1 && <span className=\"truncate text-xs text-muted-foreground\">{trace.services.join(\" → \")}</span>}\n {trace.errors > 0 && <Badge size=\"sm\" tone=\"danger\" variant=\"soft\">{trace.errors} {trace.errors === 1 ? \"error\" : \"errors\"}</Badge>}\n </span>\n ),\n },\n { key: \"service\", label: \"Service\" },\n { key: \"scope\", label: \"Scope\" },\n { key: \"tags\", label: \"Tags\", kind: \"tags\", minWidth: 240 },\n { key: \"processTags\", label: \"Process tags\", kind: \"tags\", minWidth: 240 },\n {\n key: \"startedAt\",\n label: \"Started\",\n render: (_, trace) => <span className=\"whitespace-nowrap tabular-nums\">{clock(startMs(trace))} <span className=\"text-muted-foreground\">{ago(now - startMs(trace))}</span></span>,\n },\n {\n key: \"durationMs\",\n label: \"Duration\",\n render: (_, trace) => (\n <span className=\"flex items-center gap-2\">\n <span className=\"relative h-1.5 w-24 rounded-full bg-muted\">\n <span className=\"absolute inset-y-0 left-0 rounded-full bg-primary\" style={{ width: `${(trace.durationMs / slowest) * 100}%` }} />\n </span>\n <span className=\"tabular-nums\">{duration(trace.durationMs)}</span>\n </span>\n ),\n },\n { key: \"spanCount\", label: \"Spans\", align: \"right\" },\n ];\n const table = (\n <DataTable\n {...tableProps}\n data={traces}\n columns={columns}\n defaultHiddenColumns={[\"processTags\"]}\n menuActions={downloadActions(traces)}\n getRowId={trace => trace.traceId}\n autoFilter={false}\n getRowHref={trace => href(trace.traceId)}\n onRowClick={trace => onOpen(trace.traceId)}\n emptyMessage=\"No traces match. Widen the time range, clear the duration or attribute filters, or show single-span traces.\"\n />\n );\n return (\n <div className=\"flex min-h-[28rem] min-w-0 flex-1 flex-col\">\n {attributeFilter\n ? <TagActionsProvider value={tagActionsFromRecord(attributeFilter.attributes, attributeFilter.onChange)}>{table}</TagActionsProvider>\n : table}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAUA,IAAM,WAAW,UAAmB,KAAK,MAAM,MAAM,SAAS;AAC9D,IAAM,SAAS,OAAe,IAAI,KAAK,EAAE,CAAC,CAAC,mBAAmB,CAAC,GAAG;CAAE,MAAM;CAAW,QAAQ;CAAW,QAAQ;AAAU,CAAC;;AAG3H,SAAgB,cAAc,EAAE,UAAoC;CAClE,OACE,qBAAC,KAAD;EAAG,WAAU;EAAb,UAAA;GACE,oBAAC,QAAD;IAAM,WAAU;IAA+B,UAAA,OAAO,MAAM,eAAe;GAAQ,CAAA;GAAC;GAAE,OAAO,UAAU,IAAI,kBAAkB;GAAe;EAC3I;;AAEP;;AAGA,SAAgB,QAAQ,EAAE,QAAQ,UAA+D;CAC/F,MAAM,SAAS,OAAO,IAAI,OAAO;CACjC,MAAM,KAAK,KAAK,IAAI,GAAG,MAAM;CAC7B,MAAM,OAAO,KAAK,IAAI,GAAG,MAAM,IAAI;CACnC,MAAM,UAAU,KAAK,IAAI,GAAG,OAAO,KAAI,UAAS,MAAM,UAAU,CAAC,KAAK;CACtE,MAAM,OAAO,SAAS,SAAS,CAAC;CAChC,MAAM,MAAM,KAAK,KAAM,UAAU,OAAQ,IAAI,IAAI;CACjD,MAAM,SAAS,MAAM,KAAK,EAAE,QAAQ,KAAK,MAAM,MAAM,IAAI,IAAI,EAAE,IAAI,GAAG,MAAM,IAAI,IAAI;CAEpF,MAAM,SAAS,SAAS,IAAI,CAAC,EAAG,IAAI;EAAC;EAAG;EAAM;EAAK;EAAM;CAAC;CAC1D,MAAM,KAAK,OAAgB,SAAS,IAAI,MAAO,KAAK,MAAM;CAC1D,OACE,qBAAC,UAAD;EAAQ,WAAU;EAA8C,cAAW;EAA3E,UAAA;GACE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ACA;GAAE,KAAK;GAAa,OAAO;GAAS,OAAO;EAAQ;CACrD;CACA,MAAM,QACF,oBAAC,WAAD;EACE,GAAI;EACJ,MAAM;EACG;EACT,sBAAsB,CAAC,aAAa;EACpC,aAAa,gBAAgB,MAAM;EACnC,WAAU,UAAS,MAAM;EACzB,YAAY;EACZ,aAAY,UAAS,KAAK,MAAM,OAAO;EACvC,aAAY,UAAS,OAAO,MAAM,OAAO;EACzC,cAAa;CACd,CAAA;CAEL,OACE,oBAAC,OAAD;EAAK,WAAU;EACZ,UAAA,kBACG,oBAAC,oBAAD;GAAoB,OAAO,qBAAqB,gBAAgB,YAAY,gBAAgB,QAAQ;GAAI,UAAA;EAA0B,CAAA,IAClI;CACD,CAAA;AAET"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.cjs","names":[],"sources":["../../../../src/data/traces/otel/api.ts"],"sourcesContent":["import type { JsonSchemaObject } from \"../../../components\";\n\nexport type Span = {\n traceId: string;\n spanId: string;\n parentId?: string;\n service: string;\n operation: string;\n kind?: string;\n startedAt: string;\n durationMs: number;\n status: string;\n attributes?: Record<string, unknown>;\n resource?: Record<string, unknown>;\n otlp?: Record<string, unknown>;\n};\nexport type Summary = {\n traceId: string;\n service: string;\n operation: string;\n startedAt: string;\n durationMs: number;\n spanCount: number;\n errors: number;\n services: string[];\n};\nexport interface Trace {\n summary: Summary;\n spans: Span[];\n missingParents: string[];\n}\n/** The traces of one root operation in the window (tracequery.OperationStats). */\nexport interface OperationStats {\n operation: string;\n count: number;\n singleSpan?: boolean;\n p50Ms: number;\n p95Ms: number;\n}\nexport interface SearchResult {\n traces: Summary[];\n total: number;\n services: string[];\n /** Every filter but the operation and span-count ones applied, by root operation: the root-operation filter's options. */\n rootOperations: OperationStats[];\n /** key=value suggestions from those traces' root spans, most frequent first. */\n attributes: { value: string; count: number }[];\n}\nexport interface Source {\n id: string;\n name: string;\n type: string;\n}\n/** A filter's values, each included or excluded (tracequery.Modes). */\nexport type Modes = Record<string, \"include\" | \"exclude\">;\nexport const MODE_FILTERS = [\"services\", \"operations\", \"statuses\", \"attributes\"] as const;\nexport type ModeFilter = (typeof MODE_FILTERS)[number];\nexport type SearchValues = Record<string, unknown> & {\n source?: string | undefined;\n run?: string | undefined;\n index?: string | undefined;\n format?: string | undefined;\n services?: Modes | undefined;\n /** Root operations. */\n operations?: Modes | undefined;\n statuses?: Modes | undefined;\n /** key, key=value or key=prefix* expressions. */\n attributes?: Modes | undefined;\n minSpans?: number | undefined;\n traceId?: string | undefined;\n lookback?: string | undefined;\n from?: string | undefined;\n until?: string | undefined;\n minDuration?: string | undefined;\n maxDuration?: string | undefined;\n limit?: number | undefined;\n /** Matching traces to skip, newest first: the page's start. */\n offset?: number | undefined;\n};\nexport interface SearchForm {\n schema: JsonSchemaObject;\n defaults: SearchValues;\n}\nexport function searchParams(value: SearchValues): URLSearchParams {\n const params = new URLSearchParams();\n for (const [key, item] of Object.entries(value))\n if (\n item !== undefined && item !== null && item !== \"\" &&\n !(typeof item === \"object\" && Object.keys(item).length === 0)\n )\n params.set(\n key,\n typeof item === \"object\" ? JSON.stringify(item) : String(item),\n );\n return params;\n}\n\nfunction parseModes(key: string, text: string): Modes {\n const value: unknown = JSON.parse(text);\n if (!value || typeof value !== \"object\" || Array.isArray(value) || Object.values(value).some(mode => mode !== \"include\" && mode !== \"exclude\"))\n throw new Error(`${key} must be a JSON object of values to include or exclude`);\n return value as Modes;\n}\n\nexport function readSearchValues(params: URLSearchParams = new URLSearchParams(window.location.search)): SearchValues {\n const result: SearchValues = {};\n for (const [key, value] of params) {\n if (key === \"span\") continue;\n if ((MODE_FILTERS as readonly string[]).includes(key)) result[key] = parseModes(key, value);\n else if (key === \"limit\" || key === \"offset\" || key === \"minSpans\") {\n if (!/^\\d+$/.test(value)) throw new Error(`${key} must be a whole number, not ${JSON.stringify(value)}`);\n result[key] = Number(value);\n } else result[key] = value;\n }\n return result;\n}\n\nexport const duration = (ms: number) =>\n ms >= 1000\n ? `${(ms / 1000).toFixed(2)} s`\n : ms >= 10\n ? `${ms.toFixed(0)} ms`\n : ms >= 1\n ? `${ms.toFixed(1)} ms`\n : `${(ms * 1000).toFixed(0)} µs`;\n"],"mappings":";
|
|
1
|
+
{"version":3,"file":"api.cjs","names":[],"sources":["../../../../src/data/traces/otel/api.ts"],"sourcesContent":["import type { JsonSchemaObject } from \"../../../components\";\n\nexport type Span = {\n traceId: string;\n spanId: string;\n parentId?: string;\n service: string;\n operation: string;\n kind?: string;\n startedAt: string;\n durationMs: number;\n status: string;\n attributes?: Record<string, unknown>;\n resource?: Record<string, unknown>;\n otlp?: Record<string, unknown>;\n};\nexport type Summary = {\n traceId: string;\n service: string;\n operation: string;\n startedAt: string;\n durationMs: number;\n spanCount: number;\n errors: number;\n services: string[];\n /** The AI conversation (gen_ai.conversation.id) the trace runs in, if any. */\n session?: string;\n /** The root span's instrumentation scope. */\n scope?: string;\n /** The root span's scalar span attributes, as text. */\n tags?: Record<string, string>;\n /** The root span's scalar resource (process) attributes, as text. */\n processTags?: Record<string, string>;\n};\nexport interface Trace {\n summary: Summary;\n spans: Span[];\n missingParents: string[];\n}\n/** The traces of one root operation in the window (tracequery.OperationStats). */\nexport interface OperationStats {\n operation: string;\n count: number;\n singleSpan?: boolean;\n p50Ms: number;\n p95Ms: number;\n}\nexport interface SearchResult {\n traces: Summary[];\n total: number;\n services: string[];\n /** Every filter but the operation and span-count ones applied, by root operation: the root-operation filter's options. */\n rootOperations: OperationStats[];\n /** key=value suggestions from those traces' root spans, most frequent first. */\n attributes: { value: string; count: number }[];\n /** Set when the attribute filter stopped at its span limit: only the newest `checkedTraces` of `candidateTraces` were checked. */\n truncated?: { spanLimit: number; checkedTraces: number; candidateTraces: number };\n}\nexport interface Source {\n id: string;\n name: string;\n type: string;\n}\n/** A filter's values, each included or excluded (tracequery.Modes). */\nexport type Modes = Record<string, \"include\" | \"exclude\">;\nexport const MODE_FILTERS = [\"services\", \"operations\", \"statuses\", \"attributes\"] as const;\nexport type ModeFilter = (typeof MODE_FILTERS)[number];\nexport type SearchValues = Record<string, unknown> & {\n source?: string | undefined;\n run?: string | undefined;\n index?: string | undefined;\n format?: string | undefined;\n services?: Modes | undefined;\n /** Root operations. */\n operations?: Modes | undefined;\n statuses?: Modes | undefined;\n /** key, key=value or key=prefix* expressions. */\n attributes?: Modes | undefined;\n minSpans?: number | undefined;\n traceId?: string | undefined;\n lookback?: string | undefined;\n from?: string | undefined;\n until?: string | undefined;\n minDuration?: string | undefined;\n maxDuration?: string | undefined;\n limit?: number | undefined;\n /** Matching traces to skip, newest first: the page's start. */\n offset?: number | undefined;\n};\nexport interface SearchForm {\n schema: JsonSchemaObject;\n defaults: SearchValues;\n}\nexport function searchParams(value: SearchValues): URLSearchParams {\n const params = new URLSearchParams();\n for (const [key, item] of Object.entries(value))\n if (\n item !== undefined && item !== null && item !== \"\" &&\n !(typeof item === \"object\" && Object.keys(item).length === 0)\n )\n params.set(\n key,\n typeof item === \"object\" ? JSON.stringify(item) : String(item),\n );\n return params;\n}\n\nfunction parseModes(key: string, text: string): Modes {\n const value: unknown = JSON.parse(text);\n if (!value || typeof value !== \"object\" || Array.isArray(value) || Object.values(value).some(mode => mode !== \"include\" && mode !== \"exclude\"))\n throw new Error(`${key} must be a JSON object of values to include or exclude`);\n return value as Modes;\n}\n\nexport function readSearchValues(params: URLSearchParams = new URLSearchParams(window.location.search)): SearchValues {\n const result: SearchValues = {};\n for (const [key, value] of params) {\n if (key === \"span\") continue;\n if ((MODE_FILTERS as readonly string[]).includes(key)) result[key] = parseModes(key, value);\n else if (key === \"limit\" || key === \"offset\" || key === \"minSpans\") {\n if (!/^\\d+$/.test(value)) throw new Error(`${key} must be a whole number, not ${JSON.stringify(value)}`);\n result[key] = Number(value);\n } else result[key] = value;\n }\n return result;\n}\n\nexport const duration = (ms: number) =>\n ms >= 1000\n ? `${(ms / 1000).toFixed(2)} s`\n : ms >= 10\n ? `${ms.toFixed(0)} ms`\n : ms >= 1\n ? `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M,QAAQ,CAAC,EAAE,MAC1B,MAAM,KACJ,GAAG,GAAG,QAAQ,CAAC,EAAE,OACjB,MAAM,IACJ,GAAG,GAAG,QAAQ,CAAC,EAAE,OACjB,IAAI,KAAK,IAAA,CAAM,QAAQ,CAAC,EAAE"}
|
|
@@ -22,6 +22,14 @@ export type Summary = {
|
|
|
22
22
|
spanCount: number;
|
|
23
23
|
errors: number;
|
|
24
24
|
services: string[];
|
|
25
|
+
/** The AI conversation (gen_ai.conversation.id) the trace runs in, if any. */
|
|
26
|
+
session?: string;
|
|
27
|
+
/** The root span's instrumentation scope. */
|
|
28
|
+
scope?: string;
|
|
29
|
+
/** The root span's scalar span attributes, as text. */
|
|
30
|
+
tags?: Record<string, string>;
|
|
31
|
+
/** The root span's scalar resource (process) attributes, as text. */
|
|
32
|
+
processTags?: Record<string, string>;
|
|
25
33
|
};
|
|
26
34
|
export interface Trace {
|
|
27
35
|
summary: Summary;
|
|
@@ -47,6 +55,12 @@ export interface SearchResult {
|
|
|
47
55
|
value: string;
|
|
48
56
|
count: number;
|
|
49
57
|
}[];
|
|
58
|
+
/** Set when the attribute filter stopped at its span limit: only the newest `checkedTraces` of `candidateTraces` were checked. */
|
|
59
|
+
truncated?: {
|
|
60
|
+
spanLimit: number;
|
|
61
|
+
checkedTraces: number;
|
|
62
|
+
candidateTraces: number;
|
|
63
|
+
};
|
|
50
64
|
}
|
|
51
65
|
export interface Source {
|
|
52
66
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../src/data/traces/otel/api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,MAAM,MAAM,IAAI,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,SA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IAC3B,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,+DAA+D;IAC/D,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B,CAAC;AACF,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,gBAAgB,CAAC;IACzB,QAAQ,EAAE,YAAY,CAAC;CACxB;AACD,wBAAgB,YAAY,CAAC,KAAK,EAAE,YAAY,GAAG,eAAe,CAYjE;AASD,wBAAgB,gBAAgB,CAAC,MAAM,GAAE,eAA6D,GAAG,YAAY,CAWpH;AAED,eAAO,MAAM,QAAQ,GAAI,IAAI,MAAM,WAOK,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","names":[],"sources":["../../../../src/data/traces/otel/api.ts"],"sourcesContent":["import type { JsonSchemaObject } from \"../../../components\";\n\nexport type Span = {\n traceId: string;\n spanId: string;\n parentId?: string;\n service: string;\n operation: string;\n kind?: string;\n startedAt: string;\n durationMs: number;\n status: string;\n attributes?: Record<string, unknown>;\n resource?: Record<string, unknown>;\n otlp?: Record<string, unknown>;\n};\nexport type Summary = {\n traceId: string;\n service: string;\n operation: string;\n startedAt: string;\n durationMs: number;\n spanCount: number;\n errors: number;\n services: string[];\n};\nexport interface Trace {\n summary: Summary;\n spans: Span[];\n missingParents: string[];\n}\n/** The traces of one root operation in the window (tracequery.OperationStats). */\nexport interface OperationStats {\n operation: string;\n count: number;\n singleSpan?: boolean;\n p50Ms: number;\n p95Ms: number;\n}\nexport interface SearchResult {\n traces: Summary[];\n total: number;\n services: string[];\n /** Every filter but the operation and span-count ones applied, by root operation: the root-operation filter's options. */\n rootOperations: OperationStats[];\n /** key=value suggestions from those traces' root spans, most frequent first. */\n attributes: { value: string; count: number }[];\n}\nexport interface Source {\n id: string;\n name: string;\n type: string;\n}\n/** A filter's values, each included or excluded (tracequery.Modes). */\nexport type Modes = Record<string, \"include\" | \"exclude\">;\nexport const MODE_FILTERS = [\"services\", \"operations\", \"statuses\", \"attributes\"] as const;\nexport type ModeFilter = (typeof MODE_FILTERS)[number];\nexport type SearchValues = Record<string, unknown> & {\n source?: string | undefined;\n run?: string | undefined;\n index?: string | undefined;\n format?: string | undefined;\n services?: Modes | undefined;\n /** Root operations. */\n operations?: Modes | undefined;\n statuses?: Modes | undefined;\n /** key, key=value or key=prefix* expressions. */\n attributes?: Modes | undefined;\n minSpans?: number | undefined;\n traceId?: string | undefined;\n lookback?: string | undefined;\n from?: string | undefined;\n until?: string | undefined;\n minDuration?: string | undefined;\n maxDuration?: string | undefined;\n limit?: number | undefined;\n /** Matching traces to skip, newest first: the page's start. */\n offset?: number | undefined;\n};\nexport interface SearchForm {\n schema: JsonSchemaObject;\n defaults: SearchValues;\n}\nexport function searchParams(value: SearchValues): URLSearchParams {\n const params = new URLSearchParams();\n for (const [key, item] of Object.entries(value))\n if (\n item !== undefined && item !== null && item !== \"\" &&\n !(typeof item === \"object\" && Object.keys(item).length === 0)\n )\n params.set(\n key,\n typeof item === \"object\" ? JSON.stringify(item) : String(item),\n );\n return params;\n}\n\nfunction parseModes(key: string, text: string): Modes {\n const value: unknown = JSON.parse(text);\n if (!value || typeof value !== \"object\" || Array.isArray(value) || Object.values(value).some(mode => mode !== \"include\" && mode !== \"exclude\"))\n throw new Error(`${key} must be a JSON object of values to include or exclude`);\n return value as Modes;\n}\n\nexport function readSearchValues(params: URLSearchParams = new URLSearchParams(window.location.search)): SearchValues {\n const result: SearchValues = {};\n for (const [key, value] of params) {\n if (key === \"span\") continue;\n if ((MODE_FILTERS as readonly string[]).includes(key)) result[key] = parseModes(key, value);\n else if (key === \"limit\" || key === \"offset\" || key === \"minSpans\") {\n if (!/^\\d+$/.test(value)) throw new Error(`${key} must be a whole number, not ${JSON.stringify(value)}`);\n result[key] = Number(value);\n } else result[key] = value;\n }\n return result;\n}\n\nexport const duration = (ms: number) =>\n ms >= 1000\n ? `${(ms / 1000).toFixed(2)} s`\n : ms >= 10\n ? `${ms.toFixed(0)} ms`\n : ms >= 1\n ? `${ms.toFixed(1)} ms`\n : `${(ms * 1000).toFixed(0)} µs`;\n"],"mappings":";
|
|
1
|
+
{"version":3,"file":"api.js","names":[],"sources":["../../../../src/data/traces/otel/api.ts"],"sourcesContent":["import type { JsonSchemaObject } from \"../../../components\";\n\nexport type Span = {\n traceId: string;\n spanId: string;\n parentId?: string;\n service: string;\n operation: string;\n kind?: string;\n startedAt: string;\n durationMs: number;\n status: string;\n attributes?: Record<string, unknown>;\n resource?: Record<string, unknown>;\n otlp?: Record<string, unknown>;\n};\nexport type Summary = {\n traceId: string;\n service: string;\n operation: string;\n startedAt: string;\n durationMs: number;\n spanCount: number;\n errors: number;\n services: string[];\n /** The AI conversation (gen_ai.conversation.id) the trace runs in, if any. */\n session?: string;\n /** The root span's instrumentation scope. */\n scope?: string;\n /** The root span's scalar span attributes, as text. */\n tags?: Record<string, string>;\n /** The root span's scalar resource (process) attributes, as text. */\n processTags?: Record<string, string>;\n};\nexport interface Trace {\n summary: Summary;\n spans: Span[];\n missingParents: string[];\n}\n/** The traces of one root operation in the window (tracequery.OperationStats). */\nexport interface OperationStats {\n operation: string;\n count: number;\n singleSpan?: boolean;\n p50Ms: number;\n p95Ms: number;\n}\nexport interface SearchResult {\n traces: Summary[];\n total: number;\n services: string[];\n /** Every filter but the operation and span-count ones applied, by root operation: the root-operation filter's options. */\n rootOperations: OperationStats[];\n /** key=value suggestions from those traces' root spans, most frequent first. */\n attributes: { value: string; count: number }[];\n /** Set when the attribute filter stopped at its span limit: only the newest `checkedTraces` of `candidateTraces` were checked. */\n truncated?: { spanLimit: number; checkedTraces: number; candidateTraces: number };\n}\nexport interface Source {\n id: string;\n name: string;\n type: string;\n}\n/** A filter's values, each included or excluded (tracequery.Modes). */\nexport type Modes = Record<string, \"include\" | \"exclude\">;\nexport const MODE_FILTERS = [\"services\", \"operations\", \"statuses\", \"attributes\"] as const;\nexport type ModeFilter = (typeof MODE_FILTERS)[number];\nexport type SearchValues = Record<string, unknown> & {\n source?: string | undefined;\n run?: string | undefined;\n index?: string | undefined;\n format?: string | undefined;\n services?: Modes | undefined;\n /** Root operations. */\n operations?: Modes | undefined;\n statuses?: Modes | undefined;\n /** key, key=value or key=prefix* expressions. */\n attributes?: Modes | undefined;\n minSpans?: number | undefined;\n traceId?: string | undefined;\n lookback?: string | undefined;\n from?: string | undefined;\n until?: string | undefined;\n minDuration?: string | undefined;\n maxDuration?: string | undefined;\n limit?: number | undefined;\n /** Matching traces to skip, newest first: the page's start. */\n offset?: number | undefined;\n};\nexport interface SearchForm {\n schema: JsonSchemaObject;\n defaults: SearchValues;\n}\nexport function searchParams(value: SearchValues): URLSearchParams {\n const params = new URLSearchParams();\n for (const [key, item] of Object.entries(value))\n if (\n item !== undefined && item !== null && item !== \"\" &&\n !(typeof item === \"object\" && Object.keys(item).length === 0)\n )\n params.set(\n key,\n typeof item === \"object\" ? JSON.stringify(item) : String(item),\n );\n return params;\n}\n\nfunction parseModes(key: string, text: string): Modes {\n const value: unknown = JSON.parse(text);\n if (!value || typeof value !== \"object\" || Array.isArray(value) || Object.values(value).some(mode => mode !== \"include\" && mode !== \"exclude\"))\n throw new Error(`${key} must be a JSON object of values to include or exclude`);\n return value as Modes;\n}\n\nexport function readSearchValues(params: URLSearchParams = new URLSearchParams(window.location.search)): SearchValues {\n const result: SearchValues = {};\n for (const [key, value] of params) {\n if (key === \"span\") continue;\n if ((MODE_FILTERS as readonly string[]).includes(key)) result[key] = parseModes(key, value);\n else if (key === \"limit\" || key === \"offset\" || key === \"minSpans\") {\n if (!/^\\d+$/.test(value)) throw new Error(`${key} must be a whole number, not ${JSON.stringify(value)}`);\n result[key] = Number(value);\n } else result[key] = value;\n }\n return result;\n}\n\nexport const duration = (ms: number) =>\n ms >= 1000\n ? `${(ms / 1000).toFixed(2)} s`\n : ms >= 10\n ? `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B,MAAM,MACF,IAAI,KAAK,IAAA,CAAM,QAAQ,CAAC,EAAE,MAC1B,MAAM,KACJ,GAAG,GAAG,QAAQ,CAAC,EAAE,OACjB,MAAM,IACJ,GAAG,GAAG,QAAQ,CAAC,EAAE,OACjB,IAAI,KAAK,IAAA,CAAM,QAAQ,CAAC,EAAE"}
|
|
@@ -71,9 +71,9 @@ function durationOf(value) {
|
|
|
71
71
|
...bound(value.maxDuration, "max")
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
|
-
/** The request's minDuration and maxDuration for the duration control, a bare bound in
|
|
74
|
+
/** The request's minDuration and maxDuration for the duration control, a bare bound in milliseconds. */
|
|
75
75
|
function durationRequest(value) {
|
|
76
|
-
const edge = (amount, unit) => amount?.trim() ? `${amount.trim()}${unit ?? "
|
|
76
|
+
const edge = (amount, unit) => amount?.trim() ? `${amount.trim()}${unit ?? "ms"}` : void 0;
|
|
77
77
|
return {
|
|
78
78
|
minDuration: edge(value.min, value.minUnit),
|
|
79
79
|
maxDuration: edge(value.max, value.maxUnit)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.cjs","names":[],"sources":["../../../../src/data/traces/otel/query.ts"],"sourcesContent":["import type { FilterBarDurationUnit, FilterBarDurationValue } from \"../../../components\";\nimport type { SearchValues } from \"./api\";\n\n// The pure side of the trace search bar: how its time range and duration\n// controls map onto the server's request (lookback, from/until and\n// minDuration/maxDuration), and how operations read.\n\n/** The server's minSpans that \"Hide single-span traces\" sets. */\nexport const MULTI_SPAN = 2;\n\nconst RELATIVE = /^now(?:-(\\d+)([smhdwMy]))?$/;\nconst UNIT_HOURS: Record<string, number> = { d: 24, w: 168, M: 720, y: 8760 };\nconst UNIT_MS: Record<string, number> = { s: 1e3, m: 6e4, h: 36e5, d: 864e5, w: 6048e5, M: 2592e6, y: 31536e6 };\n\n/** A relative offset as a Go duration: s, m and h as they are, longer units in hours. */\nfunction goDuration(count: number, unit: string): string {\n return unit in UNIT_HOURS ? `${count * UNIT_HOURS[unit]!}h` : `${count}${unit}`;\n}\n\n/** The time range control's value for a request: its lookback as now-<lookback>, or its from/until as they are. */\nexport function rangeOf(value: SearchValues): { from: string; to: string } {\n if (value.from || value.until) return { from: value.from ?? \"\", to: value.until ?? \"now\" };\n return { from: value.lookback ? `now-${value.lookback}` : \"\", to: \"now\" };\n}\n\n/** An instant of the range control as RFC3339: now-relative against now, or a date-time the browser reads. */\nfunction instant(text: string, now: number): string {\n const relative = RELATIVE.exec(text);\n if (relative) return new Date(now - (relative[1] ? Number(relative[1]) * UNIT_MS[relative[2]!]! : 0)).toISOString();\n const parsed = Date.parse(text);\n if (Number.isNaN(parsed)) throw new Error(`Could not read the time ${JSON.stringify(text)}: use now, an offset such as now-1h, or a date-time`);\n return new Date(parsed).toISOString();\n}\n\n/** The request's window for a range: a lookback when it ends now and starts now-relative, otherwise from/until as instants. */\nexport function windowOf(from: string, to: string, now: number): Pick<SearchValues, \"lookback\" | \"from\" | \"until\"> {\n const start = from.trim();\n const end = to.trim() || \"now\";\n const relative = RELATIVE.exec(start);\n if (end === \"now\" && (!start || (relative && relative[1]))) return { lookback: relative ? goDuration(Number(relative[1]), relative[2]!) : undefined, from: undefined, until: undefined };\n return { lookback: undefined, from: start ? instant(start, now) : undefined, until: end === \"now\" ? undefined : instant(end, now) };\n}\n\nconst DURATION = /^(\\d+(?:\\.\\d+)?)(ms|s|m|h)$/;\n\nfunction bound(text: string | undefined, edge: \"min\" | \"max\"): FilterBarDurationValue {\n if (!text) return {};\n const match = DURATION.exec(text);\n if (!match) throw new Error(`${edge}Duration must be a number of ms, s, m or h, not ${JSON.stringify(text)}`);\n return { [edge]: match[1], [`${edge}Unit`]: match[2] as FilterBarDurationUnit };\n}\n\n/** The duration control's value for a request's minDuration and maxDuration. */\nexport function durationOf(value: SearchValues): FilterBarDurationValue {\n return { ...bound(value.minDuration, \"min\"), ...bound(value.maxDuration, \"max\") };\n}\n\n/** The request's minDuration and maxDuration for the duration control, a bare bound in
|
|
1
|
+
{"version":3,"file":"query.cjs","names":[],"sources":["../../../../src/data/traces/otel/query.ts"],"sourcesContent":["import type { FilterBarDurationUnit, FilterBarDurationValue } from \"../../../components\";\nimport type { SearchValues } from \"./api\";\n\n// The pure side of the trace search bar: how its time range and duration\n// controls map onto the server's request (lookback, from/until and\n// minDuration/maxDuration), and how operations read.\n\n/** The server's minSpans that \"Hide single-span traces\" sets. */\nexport const MULTI_SPAN = 2;\n\nconst RELATIVE = /^now(?:-(\\d+)([smhdwMy]))?$/;\nconst UNIT_HOURS: Record<string, number> = { d: 24, w: 168, M: 720, y: 8760 };\nconst UNIT_MS: Record<string, number> = { s: 1e3, m: 6e4, h: 36e5, d: 864e5, w: 6048e5, M: 2592e6, y: 31536e6 };\n\n/** A relative offset as a Go duration: s, m and h as they are, longer units in hours. */\nfunction goDuration(count: number, unit: string): string {\n return unit in UNIT_HOURS ? `${count * UNIT_HOURS[unit]!}h` : `${count}${unit}`;\n}\n\n/** The time range control's value for a request: its lookback as now-<lookback>, or its from/until as they are. */\nexport function rangeOf(value: SearchValues): { from: string; to: string } {\n if (value.from || value.until) return { from: value.from ?? \"\", to: value.until ?? \"now\" };\n return { from: value.lookback ? `now-${value.lookback}` : \"\", to: \"now\" };\n}\n\n/** An instant of the range control as RFC3339: now-relative against now, or a date-time the browser reads. */\nfunction instant(text: string, now: number): string {\n const relative = RELATIVE.exec(text);\n if (relative) return new Date(now - (relative[1] ? Number(relative[1]) * UNIT_MS[relative[2]!]! : 0)).toISOString();\n const parsed = Date.parse(text);\n if (Number.isNaN(parsed)) throw new Error(`Could not read the time ${JSON.stringify(text)}: use now, an offset such as now-1h, or a date-time`);\n return new Date(parsed).toISOString();\n}\n\n/** The request's window for a range: a lookback when it ends now and starts now-relative, otherwise from/until as instants. */\nexport function windowOf(from: string, to: string, now: number): Pick<SearchValues, \"lookback\" | \"from\" | \"until\"> {\n const start = from.trim();\n const end = to.trim() || \"now\";\n const relative = RELATIVE.exec(start);\n if (end === \"now\" && (!start || (relative && relative[1]))) return { lookback: relative ? goDuration(Number(relative[1]), relative[2]!) : undefined, from: undefined, until: undefined };\n return { lookback: undefined, from: start ? instant(start, now) : undefined, until: end === \"now\" ? undefined : instant(end, now) };\n}\n\nconst DURATION = /^(\\d+(?:\\.\\d+)?)(ms|s|m|h)$/;\n\nfunction bound(text: string | undefined, edge: \"min\" | \"max\"): FilterBarDurationValue {\n if (!text) return {};\n const match = DURATION.exec(text);\n if (!match) throw new Error(`${edge}Duration must be a number of ms, s, m or h, not ${JSON.stringify(text)}`);\n return { [edge]: match[1], [`${edge}Unit`]: match[2] as FilterBarDurationUnit };\n}\n\n/** The duration control's value for a request's minDuration and maxDuration. */\nexport function durationOf(value: SearchValues): FilterBarDurationValue {\n return { ...bound(value.minDuration, \"min\"), ...bound(value.maxDuration, \"max\") };\n}\n\n/** The request's minDuration and maxDuration for the duration control, a bare bound in milliseconds. */\nexport function durationRequest(value: FilterBarDurationValue): Pick<SearchValues, \"minDuration\" | \"maxDuration\"> {\n const edge = (amount: string | undefined, unit: FilterBarDurationUnit | undefined) => (amount?.trim() ? `${amount.trim()}${unit ?? \"ms\"}` : undefined);\n return { minDuration: edge(value.min, value.minUnit), maxDuration: edge(value.max, value.maxUnit) };\n}\n\n/** `invoke_agent /abs/path/.captain/prompts/jira/x.prompt` reads `invoke_agent jira/x.prompt`. */\nexport const shortOperation = (operation: string) => operation.replace(/ \\/\\S*\\/prompts\\//, \" \");\n\n/** A W3C (32 hex) or Jaeger 64-bit (16 hex) trace ID. */\nexport const isTraceId = (text: string) => /^[0-9a-f]{16}([0-9a-f]{16})?$/i.test(text.trim());\n"],"mappings":";AAUA,IAAM,WAAW;AACjB,IAAM,aAAqC;CAAE,GAAG;CAAI,GAAG;CAAK,GAAG;CAAK,GAAG;AAAK;AAC5E,IAAM,UAAkC;CAAE,GAAG;CAAK,GAAG;CAAK,GAAG;CAAM,GAAG;CAAO,GAAG;CAAQ,GAAG;CAAQ,GAAG;AAAQ;;AAG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MAAM,OAAO,CAAC;CACnB,MAAM,QAAQ,SAAS,KAAK,IAAI;CAChC,IAAI,CAAC,OAAO,MAAM,IAAI,MAAM,GAAG,KAAK,kDAAkD,KAAK,UAAU,IAAI,GAAG;CAC5G,OAAO;GAAG,OAAO,MAAM;GAAK,GAAG,KAAK,QAAQ,MAAM;CAA4B;AAChF;;AAGA,SAAgB,WAAW,OAA6C;CACtE,OAAO;EAAE,GAAG,MAAM,MAAM,aAAa,KAAK;EAAG,GAAG,MAAM,MAAM,aAAa,KAAK;CAAE;AAClF;;AAGA,SAAgB,gBAAgB,OAAkF;CAChH,MAAM,QAAQ,QAA4B,SAA6C,QAAQ,KAAK,IAAI,GAAG,OAAO,KAAK,IAAI,QAAQ,SAAS,KAAA;CAC5I,OAAO;EAAE,aAAa,KAAK,MAAM,KAAK,MAAM,OAAO;EAAG,aAAa,KAAK,MAAM,KAAK,MAAM,OAAO;CAAE;AACpG;;AAGA,IAAa,kBAAkB,cAAsB,UAAU,QAAQ,qBAAqB,GAAG"}
|
|
@@ -11,7 +11,7 @@ export declare function rangeOf(value: SearchValues): {
|
|
|
11
11
|
export declare function windowOf(from: string, to: string, now: number): Pick<SearchValues, "lookback" | "from" | "until">;
|
|
12
12
|
/** The duration control's value for a request's minDuration and maxDuration. */
|
|
13
13
|
export declare function durationOf(value: SearchValues): FilterBarDurationValue;
|
|
14
|
-
/** The request's minDuration and maxDuration for the duration control, a bare bound in
|
|
14
|
+
/** The request's minDuration and maxDuration for the duration control, a bare bound in milliseconds. */
|
|
15
15
|
export declare function durationRequest(value: FilterBarDurationValue): Pick<SearchValues, "minDuration" | "maxDuration">;
|
|
16
16
|
/** `invoke_agent /abs/path/.captain/prompts/jira/x.prompt` reads `invoke_agent jira/x.prompt`. */
|
|
17
17
|
export declare const shortOperation: (operation: string) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../../src/data/traces/otel/query.ts"],"names":[],"mappings":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AED,wGAAwG;AACxG,wBAAgB,eAAe,CAAC,KAAK,EAAE,sBAAsB,GAAG,IAAI,CAAC,YAAY,EAAE,aAAa,GAAG,aAAa,CAAC,CAGhH;AAED,kGAAkG;AAClG,eAAO,MAAM,cAAc,GAAI,WAAW,MAAM,WAAgD,CAAC;AAEjG,yDAAyD;AACzD,eAAO,MAAM,SAAS,GAAI,MAAM,MAAM,YAAuD,CAAC"}
|
|
@@ -71,9 +71,9 @@ function durationOf(value) {
|
|
|
71
71
|
...bound(value.maxDuration, "max")
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
|
-
/** The request's minDuration and maxDuration for the duration control, a bare bound in
|
|
74
|
+
/** The request's minDuration and maxDuration for the duration control, a bare bound in milliseconds. */
|
|
75
75
|
function durationRequest(value) {
|
|
76
|
-
const edge = (amount, unit) => amount?.trim() ? `${amount.trim()}${unit ?? "
|
|
76
|
+
const edge = (amount, unit) => amount?.trim() ? `${amount.trim()}${unit ?? "ms"}` : void 0;
|
|
77
77
|
return {
|
|
78
78
|
minDuration: edge(value.min, value.minUnit),
|
|
79
79
|
maxDuration: edge(value.max, value.maxUnit)
|