@localstack/appinspector-ui 1.0.0-dev-3f04a06e → 1.0.0-dev-f55daae2
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/index.cjs +530 -170
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +511 -151
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -36,8 +36,8 @@ __export(index_exports, {
|
|
|
36
36
|
module.exports = __toCommonJS(index_exports);
|
|
37
37
|
|
|
38
38
|
// src/pages/spans-list-page.tsx
|
|
39
|
-
var
|
|
40
|
-
var
|
|
39
|
+
var import_material7 = require("@mui/material");
|
|
40
|
+
var import_react7 = require("react");
|
|
41
41
|
var import_react_router_dom = require("react-router-dom");
|
|
42
42
|
|
|
43
43
|
// src/api/use-api.tsx
|
|
@@ -2882,24 +2882,298 @@ var SpansList = (props) => {
|
|
|
2882
2882
|
] });
|
|
2883
2883
|
};
|
|
2884
2884
|
|
|
2885
|
-
// src/
|
|
2886
|
-
var
|
|
2887
|
-
var
|
|
2885
|
+
// src/components/status-message/status-message.tsx
|
|
2886
|
+
var import_ErrorOutline = __toESM(require("@mui/icons-material/ErrorOutline"), 1);
|
|
2887
|
+
var import_InfoOutlined = __toESM(require("@mui/icons-material/InfoOutlined"), 1);
|
|
2888
|
+
var import_material6 = require("@mui/material");
|
|
2889
|
+
|
|
2890
|
+
// src/api/errors.ts
|
|
2891
|
+
var AppInspectorNotFoundError = class extends Error {
|
|
2892
|
+
constructor(message, cause) {
|
|
2893
|
+
super(message);
|
|
2894
|
+
this.name = "AppInspectorNotFoundError";
|
|
2895
|
+
this.cause = cause;
|
|
2896
|
+
}
|
|
2897
|
+
};
|
|
2898
|
+
var ConnectionError = class extends Error {
|
|
2899
|
+
constructor(message, cause) {
|
|
2900
|
+
super(message);
|
|
2901
|
+
this.name = "ConnectionError";
|
|
2902
|
+
this.cause = cause;
|
|
2903
|
+
}
|
|
2904
|
+
};
|
|
2888
2905
|
|
|
2889
2906
|
// src/config.ts
|
|
2890
2907
|
var APPINSPECTOR_API_PREFIX = "/_localstack/appinspector";
|
|
2891
2908
|
var API_VERSION = "v1";
|
|
2892
2909
|
var API_ENDPOINTS = {
|
|
2910
|
+
ROOT: "/",
|
|
2893
2911
|
SPANS: "/traces/*/spans",
|
|
2912
|
+
STATUS: "/status",
|
|
2894
2913
|
TRACES: "/traces"
|
|
2895
2914
|
};
|
|
2896
|
-
var
|
|
2915
|
+
var getApiV1Endpoint = (endpoint) => {
|
|
2897
2916
|
return `/${API_VERSION}${endpoint}`;
|
|
2898
2917
|
};
|
|
2918
|
+
var getApiEndpoint = (endpoint) => {
|
|
2919
|
+
if (endpoint === API_ENDPOINTS.ROOT || endpoint === API_ENDPOINTS.STATUS) {
|
|
2920
|
+
return endpoint;
|
|
2921
|
+
}
|
|
2922
|
+
return getApiV1Endpoint(endpoint);
|
|
2923
|
+
};
|
|
2899
2924
|
var getAppInspectorApiUrl = (localstackEndpoint, endpoint) => {
|
|
2900
2925
|
return `${localstackEndpoint}${APPINSPECTOR_API_PREFIX}${getApiEndpoint(endpoint)}`;
|
|
2901
2926
|
};
|
|
2902
2927
|
|
|
2928
|
+
// src/components/status-message/status-message.tsx
|
|
2929
|
+
var import_jsx_runtime126 = require("react/jsx-runtime");
|
|
2930
|
+
var StatusMessage = ({
|
|
2931
|
+
error,
|
|
2932
|
+
onRetry,
|
|
2933
|
+
status
|
|
2934
|
+
}) => {
|
|
2935
|
+
if (error instanceof AppInspectorNotFoundError) {
|
|
2936
|
+
return /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
2937
|
+
import_material6.Box,
|
|
2938
|
+
{
|
|
2939
|
+
sx: {
|
|
2940
|
+
alignItems: "center",
|
|
2941
|
+
display: "flex",
|
|
2942
|
+
flexDirection: "column",
|
|
2943
|
+
gap: 2,
|
|
2944
|
+
justifyContent: "center",
|
|
2945
|
+
p: 4
|
|
2946
|
+
},
|
|
2947
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)(
|
|
2948
|
+
import_material6.Alert,
|
|
2949
|
+
{
|
|
2950
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_ErrorOutline.default, { fontSize: "large" }),
|
|
2951
|
+
severity: "error",
|
|
2952
|
+
sx: { maxWidth: 600, width: "100%" },
|
|
2953
|
+
children: [
|
|
2954
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_material6.AlertTitle, { sx: { fontWeight: "bold" }, children: "App Inspector Not Available" }),
|
|
2955
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_material6.Typography, { sx: { mb: 2 }, variant: "body2", children: "The App Inspector extension is not licensed or not enabled in LocalStack." }),
|
|
2956
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_material6.Typography, { sx: { mb: 1 }, variant: "body2", children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)("strong", { children: "To enable App Inspector:" }) }),
|
|
2957
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_material6.Typography, { sx: { mb: 1 }, variant: "body2", children: "Set the environment variable and restart LocalStack:" }),
|
|
2958
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
2959
|
+
import_material6.Box,
|
|
2960
|
+
{
|
|
2961
|
+
component: "pre",
|
|
2962
|
+
sx: {
|
|
2963
|
+
backgroundColor: "rgba(0, 0, 0, 0.05)",
|
|
2964
|
+
borderRadius: 1,
|
|
2965
|
+
fontSize: "0.875rem",
|
|
2966
|
+
p: 1
|
|
2967
|
+
},
|
|
2968
|
+
children: "APPINSPECTOR=1"
|
|
2969
|
+
}
|
|
2970
|
+
),
|
|
2971
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsxs)(import_material6.Typography, { sx: { fontStyle: "italic", mb: 1, mt: 2 }, variant: "body2", children: [
|
|
2972
|
+
"Runtime changes can be made via endpoint",
|
|
2973
|
+
" ",
|
|
2974
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("code", { children: [
|
|
2975
|
+
APPINSPECTOR_API_PREFIX,
|
|
2976
|
+
"/status"
|
|
2977
|
+
] }),
|
|
2978
|
+
". For persistent default state across restarts, adjust the",
|
|
2979
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)("code", { children: "APPINSPECTOR" }),
|
|
2980
|
+
" ",
|
|
2981
|
+
"environment variable."
|
|
2982
|
+
] }),
|
|
2983
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_material6.Typography, { sx: { mb: 1, mt: 2 }, variant: "body2", children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)("strong", { children: "For more information:" }) }),
|
|
2984
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
2985
|
+
import_material6.Link,
|
|
2986
|
+
{
|
|
2987
|
+
href: "https://docs.localstack.cloud/user-guide/tools/application-inspector/",
|
|
2988
|
+
rel: "noopener noreferrer",
|
|
2989
|
+
target: "_blank",
|
|
2990
|
+
children: "App Inspector Documentation"
|
|
2991
|
+
}
|
|
2992
|
+
),
|
|
2993
|
+
onRetry && /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_material6.Box, { sx: { display: "flex", justifyContent: "flex-start", mt: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
2994
|
+
import_material6.Button,
|
|
2995
|
+
{
|
|
2996
|
+
"aria-label": "Check App Inspector status again",
|
|
2997
|
+
onClick: onRetry,
|
|
2998
|
+
variant: "outlined",
|
|
2999
|
+
children: "Check Again"
|
|
3000
|
+
}
|
|
3001
|
+
) })
|
|
3002
|
+
]
|
|
3003
|
+
}
|
|
3004
|
+
)
|
|
3005
|
+
}
|
|
3006
|
+
);
|
|
3007
|
+
}
|
|
3008
|
+
if (error instanceof ConnectionError) {
|
|
3009
|
+
return /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
3010
|
+
import_material6.Box,
|
|
3011
|
+
{
|
|
3012
|
+
sx: {
|
|
3013
|
+
alignItems: "center",
|
|
3014
|
+
display: "flex",
|
|
3015
|
+
flexDirection: "column",
|
|
3016
|
+
gap: 2,
|
|
3017
|
+
justifyContent: "center",
|
|
3018
|
+
p: 4
|
|
3019
|
+
},
|
|
3020
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)(
|
|
3021
|
+
import_material6.Alert,
|
|
3022
|
+
{
|
|
3023
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_ErrorOutline.default, { fontSize: "large" }),
|
|
3024
|
+
severity: "error",
|
|
3025
|
+
sx: { maxWidth: 600, width: "100%" },
|
|
3026
|
+
children: [
|
|
3027
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_material6.AlertTitle, { sx: { fontWeight: "bold" }, children: "Connection Error" }),
|
|
3028
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_material6.Typography, { sx: { mb: 2 }, variant: "body2", children: "Failed to connect to LocalStack. Please ensure LocalStack is running and accessible." }),
|
|
3029
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_material6.Typography, { sx: { mb: 1 }, variant: "body2", children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)("strong", { children: "To start LocalStack:" }) }),
|
|
3030
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
3031
|
+
import_material6.Box,
|
|
3032
|
+
{
|
|
3033
|
+
component: "pre",
|
|
3034
|
+
sx: {
|
|
3035
|
+
backgroundColor: "rgba(0, 0, 0, 0.05)",
|
|
3036
|
+
borderRadius: 1,
|
|
3037
|
+
fontSize: "0.875rem",
|
|
3038
|
+
p: 1
|
|
3039
|
+
},
|
|
3040
|
+
children: "localstack start"
|
|
3041
|
+
}
|
|
3042
|
+
),
|
|
3043
|
+
onRetry && /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_material6.Box, { sx: { display: "flex", justifyContent: "flex-start", mt: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
3044
|
+
import_material6.Button,
|
|
3045
|
+
{
|
|
3046
|
+
"aria-label": "Retry connection to LocalStack",
|
|
3047
|
+
onClick: onRetry,
|
|
3048
|
+
variant: "outlined",
|
|
3049
|
+
children: "Retry Connection"
|
|
3050
|
+
}
|
|
3051
|
+
) })
|
|
3052
|
+
]
|
|
3053
|
+
}
|
|
3054
|
+
)
|
|
3055
|
+
}
|
|
3056
|
+
);
|
|
3057
|
+
}
|
|
3058
|
+
if (status?.status === "DISABLED") {
|
|
3059
|
+
return /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
3060
|
+
import_material6.Box,
|
|
3061
|
+
{
|
|
3062
|
+
sx: {
|
|
3063
|
+
alignItems: "center",
|
|
3064
|
+
display: "flex",
|
|
3065
|
+
flexDirection: "column",
|
|
3066
|
+
gap: 2,
|
|
3067
|
+
justifyContent: "center",
|
|
3068
|
+
p: 4
|
|
3069
|
+
},
|
|
3070
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)(
|
|
3071
|
+
import_material6.Alert,
|
|
3072
|
+
{
|
|
3073
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_InfoOutlined.default, { fontSize: "large" }),
|
|
3074
|
+
severity: "warning",
|
|
3075
|
+
sx: { maxWidth: 600, width: "100%" },
|
|
3076
|
+
children: [
|
|
3077
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_material6.AlertTitle, { sx: { fontWeight: "bold" }, children: "App Inspector is Disabled" }),
|
|
3078
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_material6.Typography, { sx: { mb: 2 }, variant: "body2", children: "App Inspector is currently disabled. Please enable it to view traces and spans." }),
|
|
3079
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_material6.Typography, { sx: { mb: 1 }, variant: "body2", children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)("strong", { children: "To enable App Inspector at runtime:" }) }),
|
|
3080
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
3081
|
+
import_material6.Box,
|
|
3082
|
+
{
|
|
3083
|
+
component: "pre",
|
|
3084
|
+
sx: {
|
|
3085
|
+
backgroundColor: "rgba(0, 0, 0, 0.05)",
|
|
3086
|
+
borderRadius: 1,
|
|
3087
|
+
fontSize: "0.875rem",
|
|
3088
|
+
overflowX: "auto",
|
|
3089
|
+
p: 1
|
|
3090
|
+
},
|
|
3091
|
+
children: `curl -X PUT http://localhost:4566${APPINSPECTOR_API_PREFIX}/status \\
|
|
3092
|
+
-H "Content-Type: application/json" \\
|
|
3093
|
+
-d '{"status": "ENABLED"}'`
|
|
3094
|
+
}
|
|
3095
|
+
),
|
|
3096
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_material6.Typography, { sx: { mb: 1, mt: 2 }, variant: "body2", children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)("strong", { children: "To enable App Inspector persistently across restarts:" }) }),
|
|
3097
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_material6.Typography, { sx: { mb: 1 }, variant: "body2", children: "Set the environment variable:" }),
|
|
3098
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
3099
|
+
import_material6.Box,
|
|
3100
|
+
{
|
|
3101
|
+
component: "pre",
|
|
3102
|
+
sx: {
|
|
3103
|
+
backgroundColor: "rgba(0, 0, 0, 0.05)",
|
|
3104
|
+
borderRadius: 1,
|
|
3105
|
+
fontSize: "0.875rem",
|
|
3106
|
+
p: 1
|
|
3107
|
+
},
|
|
3108
|
+
children: "APPINSPECTOR=1"
|
|
3109
|
+
}
|
|
3110
|
+
),
|
|
3111
|
+
Boolean(status.note) && /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_material6.Typography, { sx: { display: "block", fontStyle: "italic", mt: 2 }, variant: "caption", children: status.note }),
|
|
3112
|
+
onRetry && /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_material6.Box, { sx: { display: "flex", justifyContent: "flex-start", mt: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
3113
|
+
import_material6.Button,
|
|
3114
|
+
{
|
|
3115
|
+
"aria-label": "Check if App Inspector is enabled",
|
|
3116
|
+
onClick: onRetry,
|
|
3117
|
+
variant: "outlined",
|
|
3118
|
+
children: "Check Status Again"
|
|
3119
|
+
}
|
|
3120
|
+
) })
|
|
3121
|
+
]
|
|
3122
|
+
}
|
|
3123
|
+
)
|
|
3124
|
+
}
|
|
3125
|
+
);
|
|
3126
|
+
}
|
|
3127
|
+
if (error) {
|
|
3128
|
+
return /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
3129
|
+
import_material6.Box,
|
|
3130
|
+
{
|
|
3131
|
+
sx: {
|
|
3132
|
+
alignItems: "center",
|
|
3133
|
+
display: "flex",
|
|
3134
|
+
flexDirection: "column",
|
|
3135
|
+
gap: 2,
|
|
3136
|
+
justifyContent: "center",
|
|
3137
|
+
p: 4
|
|
3138
|
+
},
|
|
3139
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)(
|
|
3140
|
+
import_material6.Alert,
|
|
3141
|
+
{
|
|
3142
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_ErrorOutline.default, { fontSize: "large" }),
|
|
3143
|
+
severity: "error",
|
|
3144
|
+
sx: { maxWidth: 600, width: "100%" },
|
|
3145
|
+
children: [
|
|
3146
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_material6.AlertTitle, { sx: { fontWeight: "bold" }, children: "Error" }),
|
|
3147
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_material6.Typography, { sx: { mb: 2 }, variant: "body2", children: error.message }),
|
|
3148
|
+
onRetry && /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_material6.Box, { sx: { display: "flex", justifyContent: "flex-start", mt: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
3149
|
+
import_material6.Button,
|
|
3150
|
+
{
|
|
3151
|
+
"aria-label": "Retry operation",
|
|
3152
|
+
onClick: onRetry,
|
|
3153
|
+
variant: "outlined",
|
|
3154
|
+
children: "Retry"
|
|
3155
|
+
}
|
|
3156
|
+
) })
|
|
3157
|
+
]
|
|
3158
|
+
}
|
|
3159
|
+
)
|
|
3160
|
+
}
|
|
3161
|
+
);
|
|
3162
|
+
}
|
|
3163
|
+
return;
|
|
3164
|
+
};
|
|
3165
|
+
|
|
3166
|
+
// src/context.tsx
|
|
3167
|
+
var import_react4 = require("react");
|
|
3168
|
+
var import_react5 = require("react");
|
|
3169
|
+
|
|
3170
|
+
// src/constants/error-messages.ts
|
|
3171
|
+
var ERROR_MESSAGES = {
|
|
3172
|
+
APP_INSPECTOR_DISABLED: "App Inspector is currently disabled.",
|
|
3173
|
+
APP_INSPECTOR_NOT_FOUND: "App Inspector extension not found. Please ensure App Inspector is licensed and enabled.",
|
|
3174
|
+
CONNECTION_FAILED: "Failed to connect to LocalStack. Please ensure LocalStack is running and accessible."
|
|
3175
|
+
};
|
|
3176
|
+
|
|
2903
3177
|
// src/api/client.ts
|
|
2904
3178
|
var apiLogger = createScopedLogger("API");
|
|
2905
3179
|
var makeRequest = async (options) => {
|
|
@@ -2913,10 +3187,23 @@ var makeRequest = async (options) => {
|
|
|
2913
3187
|
headers
|
|
2914
3188
|
});
|
|
2915
3189
|
if (!response.ok) {
|
|
3190
|
+
if (response.status === 404) {
|
|
3191
|
+
throw new AppInspectorNotFoundError(
|
|
3192
|
+
ERROR_MESSAGES.APP_INSPECTOR_NOT_FOUND,
|
|
3193
|
+
new Error(`404 from ${url}: ${response.statusText}`)
|
|
3194
|
+
);
|
|
3195
|
+
}
|
|
2916
3196
|
throw new Error(`API request failed: ${response.status.toString()} ${response.statusText}`);
|
|
2917
3197
|
}
|
|
2918
3198
|
return await response.json();
|
|
2919
3199
|
} catch (error) {
|
|
3200
|
+
if (error instanceof TypeError) {
|
|
3201
|
+
const message = error.message.toLowerCase();
|
|
3202
|
+
const isNetworkError = message.includes("fetch") || message.includes("network") || message.includes("failed to fetch");
|
|
3203
|
+
if (isNetworkError) {
|
|
3204
|
+
throw new ConnectionError(ERROR_MESSAGES.CONNECTION_FAILED, error);
|
|
3205
|
+
}
|
|
3206
|
+
}
|
|
2920
3207
|
if (error instanceof Error) {
|
|
2921
3208
|
throw error;
|
|
2922
3209
|
}
|
|
@@ -2956,12 +3243,18 @@ var createApiClient = ({ localstackEndpoint }) => {
|
|
|
2956
3243
|
getSpans: async (request) => {
|
|
2957
3244
|
const endpoint = buildSpansEndpoint(request);
|
|
2958
3245
|
return makeRequest({ endpoint, localstackEndpoint });
|
|
3246
|
+
},
|
|
3247
|
+
getStatus: async () => {
|
|
3248
|
+
return makeRequest({
|
|
3249
|
+
endpoint: API_ENDPOINTS.STATUS,
|
|
3250
|
+
localstackEndpoint
|
|
3251
|
+
});
|
|
2959
3252
|
}
|
|
2960
3253
|
};
|
|
2961
3254
|
};
|
|
2962
3255
|
|
|
2963
3256
|
// src/context.tsx
|
|
2964
|
-
var
|
|
3257
|
+
var import_jsx_runtime127 = require("react/jsx-runtime");
|
|
2965
3258
|
var AppInspectorContext = (0, import_react4.createContext)(void 0);
|
|
2966
3259
|
var useAppInspector = () => {
|
|
2967
3260
|
const context = (0, import_react4.useContext)(AppInspectorContext);
|
|
@@ -2974,7 +3267,7 @@ var AppInspectorContextProvider = (props) => {
|
|
|
2974
3267
|
const api = (0, import_react5.useMemo)(() => {
|
|
2975
3268
|
return false ? createApiClientMock() : createApiClient({ localstackEndpoint: props.localstackEndpoint });
|
|
2976
3269
|
}, [props.localstackEndpoint]);
|
|
2977
|
-
return /* @__PURE__ */ (0,
|
|
3270
|
+
return /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(ApiProvider, { api, children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
2978
3271
|
AppInspectorContext.Provider,
|
|
2979
3272
|
{
|
|
2980
3273
|
value: {
|
|
@@ -2998,17 +3291,60 @@ var AppInspectorContextProvider = (props) => {
|
|
|
2998
3291
|
) });
|
|
2999
3292
|
};
|
|
3000
3293
|
|
|
3294
|
+
// src/hooks/use-status.tsx
|
|
3295
|
+
var import_react6 = require("react");
|
|
3296
|
+
var useStatus = () => {
|
|
3297
|
+
const api = useAppInspectorApi();
|
|
3298
|
+
const [checking, setChecking] = (0, import_react6.useState)(true);
|
|
3299
|
+
const [status, setStatus] = (0, import_react6.useState)();
|
|
3300
|
+
const [error, setError] = (0, import_react6.useState)();
|
|
3301
|
+
const hasFetchedReference = (0, import_react6.useRef)(false);
|
|
3302
|
+
const abortControllerReference = (0, import_react6.useRef)(null);
|
|
3303
|
+
const checkStatus = (0, import_react6.useCallback)(async () => {
|
|
3304
|
+
if (abortControllerReference.current) {
|
|
3305
|
+
abortControllerReference.current.abort();
|
|
3306
|
+
}
|
|
3307
|
+
const abortController = new AbortController();
|
|
3308
|
+
abortControllerReference.current = abortController;
|
|
3309
|
+
setChecking(true);
|
|
3310
|
+
try {
|
|
3311
|
+
const response = await api.getStatus();
|
|
3312
|
+
if (!abortController.signal.aborted) {
|
|
3313
|
+
setStatus(response);
|
|
3314
|
+
setError(void 0);
|
|
3315
|
+
}
|
|
3316
|
+
} catch (error_) {
|
|
3317
|
+
if (!abortController.signal.aborted) {
|
|
3318
|
+
setError(error_ instanceof Error ? error_ : new Error("Unknown error"));
|
|
3319
|
+
setStatus(void 0);
|
|
3320
|
+
}
|
|
3321
|
+
} finally {
|
|
3322
|
+
if (!abortController.signal.aborted) {
|
|
3323
|
+
setChecking(false);
|
|
3324
|
+
}
|
|
3325
|
+
}
|
|
3326
|
+
}, [api]);
|
|
3327
|
+
(0, import_react6.useEffect)(() => {
|
|
3328
|
+
if (!hasFetchedReference.current) {
|
|
3329
|
+
hasFetchedReference.current = true;
|
|
3330
|
+
void checkStatus();
|
|
3331
|
+
}
|
|
3332
|
+
}, [checkStatus]);
|
|
3333
|
+
return { checking, checkStatus, error, status };
|
|
3334
|
+
};
|
|
3335
|
+
|
|
3001
3336
|
// src/pages/spans-list-page.tsx
|
|
3002
|
-
var
|
|
3337
|
+
var import_jsx_runtime128 = require("react/jsx-runtime");
|
|
3003
3338
|
var MAX_WIDTH = 1400;
|
|
3004
3339
|
var SpansListPage = () => {
|
|
3005
3340
|
const api = useAppInspectorApi();
|
|
3006
|
-
const [spans, setSpans] = (0,
|
|
3007
|
-
const [loading, setLoading] = (0,
|
|
3008
|
-
const hasFetched = (0,
|
|
3009
|
-
const [filterWriteOperations, setFilterWriteOperations] = (0,
|
|
3010
|
-
const [fetchError, setFetchError] = (0,
|
|
3011
|
-
const
|
|
3341
|
+
const [spans, setSpans] = (0, import_react7.useState)();
|
|
3342
|
+
const [loading, setLoading] = (0, import_react7.useState)(false);
|
|
3343
|
+
const hasFetched = (0, import_react7.useRef)(false);
|
|
3344
|
+
const [filterWriteOperations, setFilterWriteOperations] = (0, import_react7.useState)(true);
|
|
3345
|
+
const [fetchError, setFetchError] = (0, import_react7.useState)();
|
|
3346
|
+
const { checkStatus, error: statusError, status } = useStatus();
|
|
3347
|
+
const fetchSpans = (0, import_react7.useCallback)(async () => {
|
|
3012
3348
|
setLoading(true);
|
|
3013
3349
|
try {
|
|
3014
3350
|
const response = await api.getSpans({
|
|
@@ -3024,25 +3360,26 @@ var SpansListPage = () => {
|
|
|
3024
3360
|
setLoading(false);
|
|
3025
3361
|
}
|
|
3026
3362
|
}, [api, filterWriteOperations]);
|
|
3027
|
-
const fetchSpansSync = (0,
|
|
3363
|
+
const fetchSpansSync = (0, import_react7.useCallback)(() => {
|
|
3028
3364
|
void fetchSpans();
|
|
3029
3365
|
}, [fetchSpans]);
|
|
3030
|
-
(0,
|
|
3366
|
+
(0, import_react7.useEffect)(() => {
|
|
3031
3367
|
if (hasFetched.current) return;
|
|
3368
|
+
if (status?.status !== "ENABLED") return;
|
|
3032
3369
|
hasFetched.current = true;
|
|
3033
3370
|
void fetchSpans();
|
|
3034
|
-
}, [fetchSpans]);
|
|
3035
|
-
(0,
|
|
3371
|
+
}, [fetchSpans, status]);
|
|
3372
|
+
(0, import_react7.useEffect)(() => {
|
|
3036
3373
|
if (!hasFetched.current) return;
|
|
3037
3374
|
void fetchSpans();
|
|
3038
3375
|
}, [fetchSpans]);
|
|
3039
3376
|
const navigate = (0, import_react_router_dom.useNavigate)();
|
|
3040
3377
|
const { resolveLink } = useAppInspector();
|
|
3041
|
-
const navigateToSpan = (0,
|
|
3378
|
+
const navigateToSpan = (0, import_react7.useCallback)((span) => {
|
|
3042
3379
|
const url = resolveLink({ to: "trace-graph", traceId: span.trace_id });
|
|
3043
3380
|
navigate(`${url}?spanId=${span.span_id}`);
|
|
3044
3381
|
}, [navigate, resolveLink]);
|
|
3045
|
-
const clearSpans = (0,
|
|
3382
|
+
const clearSpans = (0, import_react7.useCallback)(async () => {
|
|
3046
3383
|
setLoading(true);
|
|
3047
3384
|
try {
|
|
3048
3385
|
await api.deleteSpans();
|
|
@@ -3056,8 +3393,12 @@ var SpansListPage = () => {
|
|
|
3056
3393
|
setLoading(false);
|
|
3057
3394
|
}
|
|
3058
3395
|
}, [api, fetchSpans]);
|
|
3059
|
-
|
|
3060
|
-
|
|
3396
|
+
const handleRetry = (0, import_react7.useCallback)(() => {
|
|
3397
|
+
void checkStatus();
|
|
3398
|
+
}, [checkStatus]);
|
|
3399
|
+
const shouldShowStatusMessage = Boolean(statusError) || status?.status === "DISABLED";
|
|
3400
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
3401
|
+
import_material7.Box,
|
|
3061
3402
|
{
|
|
3062
3403
|
"data-testid": "spans-list-page",
|
|
3063
3404
|
sx: {
|
|
@@ -3067,8 +3408,8 @@ var SpansListPage = () => {
|
|
|
3067
3408
|
height: "100vh",
|
|
3068
3409
|
width: "100%"
|
|
3069
3410
|
},
|
|
3070
|
-
children: /* @__PURE__ */ (0,
|
|
3071
|
-
|
|
3411
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
3412
|
+
import_material7.Box,
|
|
3072
3413
|
{
|
|
3073
3414
|
sx: {
|
|
3074
3415
|
display: "flex",
|
|
@@ -3077,7 +3418,14 @@ var SpansListPage = () => {
|
|
|
3077
3418
|
maxWidth: MAX_WIDTH,
|
|
3078
3419
|
width: "100%"
|
|
3079
3420
|
},
|
|
3080
|
-
children: /* @__PURE__ */ (0,
|
|
3421
|
+
children: shouldShowStatusMessage ? /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
3422
|
+
StatusMessage,
|
|
3423
|
+
{
|
|
3424
|
+
error: statusError,
|
|
3425
|
+
onRetry: handleRetry,
|
|
3426
|
+
status
|
|
3427
|
+
}
|
|
3428
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
3081
3429
|
SpansList,
|
|
3082
3430
|
{
|
|
3083
3431
|
filterWriteOperations,
|
|
@@ -3107,22 +3455,22 @@ var SpansListPage = () => {
|
|
|
3107
3455
|
};
|
|
3108
3456
|
|
|
3109
3457
|
// src/pages/trace-graph.tsx
|
|
3110
|
-
var
|
|
3458
|
+
var import_material14 = require("@mui/material");
|
|
3111
3459
|
var import_styles = require("@mui/material/styles");
|
|
3112
|
-
var
|
|
3113
|
-
var
|
|
3460
|
+
var import_react15 = require("@xyflow/react");
|
|
3461
|
+
var import_react16 = require("react");
|
|
3114
3462
|
var import_react_router_dom2 = require("react-router-dom");
|
|
3115
3463
|
|
|
3116
3464
|
// src/components/event-details/event-details.tsx
|
|
3117
|
-
var
|
|
3465
|
+
var import_material10 = require("@mui/material");
|
|
3118
3466
|
|
|
3119
3467
|
// src/components/event-details/event-details-header.tsx
|
|
3120
3468
|
var import_icons_material2 = require("@mui/icons-material");
|
|
3121
|
-
var
|
|
3122
|
-
var
|
|
3469
|
+
var import_material8 = require("@mui/material");
|
|
3470
|
+
var import_jsx_runtime129 = require("react/jsx-runtime");
|
|
3123
3471
|
var EventDetailsHeader = ({ event, onClose }) => {
|
|
3124
|
-
return /* @__PURE__ */ (0,
|
|
3125
|
-
|
|
3472
|
+
return /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(
|
|
3473
|
+
import_material8.Box,
|
|
3126
3474
|
{
|
|
3127
3475
|
sx: {
|
|
3128
3476
|
alignItems: "center",
|
|
@@ -3133,16 +3481,16 @@ var EventDetailsHeader = ({ event, onClose }) => {
|
|
|
3133
3481
|
p: 2
|
|
3134
3482
|
},
|
|
3135
3483
|
children: [
|
|
3136
|
-
/* @__PURE__ */ (0,
|
|
3137
|
-
/* @__PURE__ */ (0,
|
|
3138
|
-
/* @__PURE__ */ (0,
|
|
3484
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(import_material8.Box, { children: [
|
|
3485
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(import_material8.Typography, { sx: { fontWeight: 600 }, variant: "h6", children: "Event Details" }),
|
|
3486
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(import_material8.Typography, { color: "text.secondary", variant: "body2", children: [
|
|
3139
3487
|
event.service_name,
|
|
3140
3488
|
" ",
|
|
3141
3489
|
"-",
|
|
3142
3490
|
event.operation_name
|
|
3143
3491
|
] })
|
|
3144
3492
|
] }),
|
|
3145
|
-
onClose && /* @__PURE__ */ (0,
|
|
3493
|
+
onClose && /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(import_material8.IconButton, { onClick: onClose, size: "small", children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(import_icons_material2.Close, {}) })
|
|
3146
3494
|
]
|
|
3147
3495
|
}
|
|
3148
3496
|
);
|
|
@@ -3150,14 +3498,14 @@ var EventDetailsHeader = ({ event, onClose }) => {
|
|
|
3150
3498
|
|
|
3151
3499
|
// src/components/event-details/toggle-section.tsx
|
|
3152
3500
|
var import_icons_material3 = require("@mui/icons-material");
|
|
3153
|
-
var
|
|
3154
|
-
var
|
|
3155
|
-
var
|
|
3501
|
+
var import_material9 = require("@mui/material");
|
|
3502
|
+
var import_react8 = require("react");
|
|
3503
|
+
var import_jsx_runtime130 = require("react/jsx-runtime");
|
|
3156
3504
|
var ToggleSection = ({ children, headline, initialOpen = true }) => {
|
|
3157
|
-
const [isOpen, setIsOpen] = (0,
|
|
3158
|
-
return /* @__PURE__ */ (0,
|
|
3159
|
-
/* @__PURE__ */ (0,
|
|
3160
|
-
|
|
3505
|
+
const [isOpen, setIsOpen] = (0, import_react8.useState)(initialOpen);
|
|
3506
|
+
return /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(import_material9.Box, { sx: { mt: 4 }, children: [
|
|
3507
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
3508
|
+
import_material9.Box,
|
|
3161
3509
|
{
|
|
3162
3510
|
onClick: () => {
|
|
3163
3511
|
setIsOpen(!isOpen);
|
|
@@ -3166,8 +3514,8 @@ var ToggleSection = ({ children, headline, initialOpen = true }) => {
|
|
|
3166
3514
|
cursor: "pointer",
|
|
3167
3515
|
mb: 1
|
|
3168
3516
|
},
|
|
3169
|
-
children: /* @__PURE__ */ (0,
|
|
3170
|
-
|
|
3517
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(
|
|
3518
|
+
import_material9.Box,
|
|
3171
3519
|
{
|
|
3172
3520
|
role: "button",
|
|
3173
3521
|
sx: {
|
|
@@ -3176,85 +3524,85 @@ var ToggleSection = ({ children, headline, initialOpen = true }) => {
|
|
|
3176
3524
|
gap: 1
|
|
3177
3525
|
},
|
|
3178
3526
|
children: [
|
|
3179
|
-
/* @__PURE__ */ (0,
|
|
3180
|
-
isOpen ? /* @__PURE__ */ (0,
|
|
3527
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_material9.Typography, { sx: { fontWeight: 600 }, variant: "subtitle2", children: headline }),
|
|
3528
|
+
isOpen ? /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_icons_material3.KeyboardArrowDown, { sx: { color: "text.secondary", height: 20, width: 20 } }) : /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_icons_material3.KeyboardArrowRight, { sx: { color: "text.secondary", height: 20, width: 20 } })
|
|
3181
3529
|
]
|
|
3182
3530
|
}
|
|
3183
3531
|
)
|
|
3184
3532
|
}
|
|
3185
3533
|
),
|
|
3186
|
-
isOpen && /* @__PURE__ */ (0,
|
|
3534
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_material9.Box, { children })
|
|
3187
3535
|
] });
|
|
3188
3536
|
};
|
|
3189
3537
|
|
|
3190
3538
|
// src/components/event-details/event-details.tsx
|
|
3191
|
-
var
|
|
3539
|
+
var import_jsx_runtime131 = require("react/jsx-runtime");
|
|
3192
3540
|
var EventDetails = ({ selectedEvent }) => {
|
|
3193
3541
|
if (!selectedEvent) {
|
|
3194
|
-
return /* @__PURE__ */ (0,
|
|
3542
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_material10.Box, { sx: { p: 3, textAlign: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_material10.Typography, { color: "text.secondary", variant: "body2", children: "Select an event to view details" }) });
|
|
3195
3543
|
}
|
|
3196
|
-
return /* @__PURE__ */ (0,
|
|
3197
|
-
/* @__PURE__ */ (0,
|
|
3198
|
-
/* @__PURE__ */ (0,
|
|
3199
|
-
/* @__PURE__ */ (0,
|
|
3200
|
-
/* @__PURE__ */ (0,
|
|
3201
|
-
/* @__PURE__ */ (0,
|
|
3202
|
-
/* @__PURE__ */ (0,
|
|
3544
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(import_material10.Box, { "data-testid": "event-details", sx: { display: "flex", flexDirection: "column", height: "100%" }, children: [
|
|
3545
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(EventDetailsHeader, { event: selectedEvent }),
|
|
3546
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_material10.Box, { sx: { flexGrow: 1, overflow: "auto", p: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(import_material10.Stack, { spacing: 2, children: [
|
|
3547
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(ToggleSection, { headline: "Basic Information", children: /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(import_material10.Stack, { spacing: 1, children: [
|
|
3548
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(import_material10.Box, { children: [
|
|
3549
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_material10.Typography, { color: "text.secondary", variant: "caption", children: "Span ID" }),
|
|
3550
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_material10.Typography, { variant: "body2", children: selectedEvent.span_id })
|
|
3203
3551
|
] }),
|
|
3204
|
-
/* @__PURE__ */ (0,
|
|
3205
|
-
/* @__PURE__ */ (0,
|
|
3206
|
-
/* @__PURE__ */ (0,
|
|
3552
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(import_material10.Box, { children: [
|
|
3553
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_material10.Typography, { color: "text.secondary", variant: "caption", children: "Trace ID" }),
|
|
3554
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_material10.Typography, { sx: { fontFamily: "monospace", fontSize: "0.85rem" }, variant: "body2", children: selectedEvent.trace_id })
|
|
3207
3555
|
] }),
|
|
3208
|
-
/* @__PURE__ */ (0,
|
|
3209
|
-
/* @__PURE__ */ (0,
|
|
3210
|
-
/* @__PURE__ */ (0,
|
|
3556
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(import_material10.Box, { children: [
|
|
3557
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_material10.Typography, { color: "text.secondary", variant: "caption", children: "Operation" }),
|
|
3558
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_material10.Typography, { variant: "body2", children: selectedEvent.operation_name })
|
|
3211
3559
|
] })
|
|
3212
3560
|
] }) }),
|
|
3213
|
-
/* @__PURE__ */ (0,
|
|
3214
|
-
/* @__PURE__ */ (0,
|
|
3215
|
-
/* @__PURE__ */ (0,
|
|
3216
|
-
/* @__PURE__ */ (0,
|
|
3217
|
-
/* @__PURE__ */ (0,
|
|
3561
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_material10.Divider, {}),
|
|
3562
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(ToggleSection, { headline: "Service Information", children: /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(import_material10.Stack, { spacing: 1, children: [
|
|
3563
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(import_material10.Box, { children: [
|
|
3564
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_material10.Typography, { color: "text.secondary", variant: "caption", children: "Service" }),
|
|
3565
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_material10.Typography, { variant: "body2", children: selectedEvent.service_name })
|
|
3218
3566
|
] }),
|
|
3219
|
-
/* @__PURE__ */ (0,
|
|
3220
|
-
/* @__PURE__ */ (0,
|
|
3221
|
-
/* @__PURE__ */ (0,
|
|
3567
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(import_material10.Box, { children: [
|
|
3568
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_material10.Typography, { color: "text.secondary", variant: "caption", children: "Resource" }),
|
|
3569
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_material10.Typography, { variant: "body2", children: selectedEvent.resource_name })
|
|
3222
3570
|
] }),
|
|
3223
|
-
selectedEvent.region && /* @__PURE__ */ (0,
|
|
3224
|
-
/* @__PURE__ */ (0,
|
|
3225
|
-
/* @__PURE__ */ (0,
|
|
3571
|
+
selectedEvent.region && /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(import_material10.Box, { children: [
|
|
3572
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_material10.Typography, { color: "text.secondary", variant: "caption", children: "Region" }),
|
|
3573
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_material10.Typography, { variant: "body2", children: selectedEvent.region })
|
|
3226
3574
|
] })
|
|
3227
3575
|
] }) }),
|
|
3228
|
-
/* @__PURE__ */ (0,
|
|
3229
|
-
/* @__PURE__ */ (0,
|
|
3230
|
-
/* @__PURE__ */ (0,
|
|
3231
|
-
/* @__PURE__ */ (0,
|
|
3232
|
-
/* @__PURE__ */ (0,
|
|
3576
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_material10.Divider, {}),
|
|
3577
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(ToggleSection, { headline: "Timing", children: /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(import_material10.Stack, { spacing: 1, children: [
|
|
3578
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(import_material10.Box, { children: [
|
|
3579
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_material10.Typography, { color: "text.secondary", variant: "caption", children: "Start Time" }),
|
|
3580
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_material10.Typography, { variant: "body2", children: unixNanoToDate(selectedEvent.start_time_unix_nano)?.toISOString() })
|
|
3233
3581
|
] }),
|
|
3234
|
-
selectedEvent.end_time_unix_nano && /* @__PURE__ */ (0,
|
|
3235
|
-
/* @__PURE__ */ (0,
|
|
3236
|
-
/* @__PURE__ */ (0,
|
|
3582
|
+
selectedEvent.end_time_unix_nano && /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(import_material10.Box, { children: [
|
|
3583
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_material10.Typography, { color: "text.secondary", variant: "caption", children: "Duration" }),
|
|
3584
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(import_material10.Typography, { variant: "body2", children: [
|
|
3237
3585
|
((BigInt(selectedEvent.end_time_unix_nano) - BigInt(selectedEvent.start_time_unix_nano)) / BigInt("1000000")).toString(),
|
|
3238
3586
|
" ",
|
|
3239
3587
|
"ms"
|
|
3240
3588
|
] })
|
|
3241
3589
|
] })
|
|
3242
3590
|
] }) }),
|
|
3243
|
-
/* @__PURE__ */ (0,
|
|
3244
|
-
/* @__PURE__ */ (0,
|
|
3245
|
-
/* @__PURE__ */ (0,
|
|
3246
|
-
|
|
3591
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_material10.Divider, {}),
|
|
3592
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(ToggleSection, { headline: "Status", children: /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(import_material10.Stack, { direction: "row", spacing: 1, children: [
|
|
3593
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
3594
|
+
import_material10.Chip,
|
|
3247
3595
|
{
|
|
3248
3596
|
color: selectedEvent.status_code === 0 ? "success" : "error",
|
|
3249
3597
|
label: selectedEvent.status_code === 0 ? "Success" : "Error",
|
|
3250
3598
|
size: "small"
|
|
3251
3599
|
}
|
|
3252
3600
|
),
|
|
3253
|
-
selectedEvent.status_message && /* @__PURE__ */ (0,
|
|
3601
|
+
selectedEvent.status_message && /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_material10.Typography, { variant: "body2", children: selectedEvent.status_message })
|
|
3254
3602
|
] }) }),
|
|
3255
|
-
selectedEvent.attributes && Object.keys(selectedEvent.attributes).length > 0 && /* @__PURE__ */ (0,
|
|
3256
|
-
/* @__PURE__ */ (0,
|
|
3257
|
-
/* @__PURE__ */ (0,
|
|
3603
|
+
selectedEvent.attributes && Object.keys(selectedEvent.attributes).length > 0 && /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(import_jsx_runtime131.Fragment, { children: [
|
|
3604
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_material10.Divider, {}),
|
|
3605
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(ToggleSection, { headline: "Attributes", children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_material10.Box, { sx: { backgroundColor: "#f5f5f5", borderRadius: 1, p: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("pre", { style: { fontSize: "0.85rem", margin: 0, overflow: "auto" }, children: JSON.stringify(selectedEvent.attributes, void 0, 2) }) }) })
|
|
3258
3606
|
] })
|
|
3259
3607
|
] }) })
|
|
3260
3608
|
] });
|
|
@@ -3262,36 +3610,36 @@ var EventDetails = ({ selectedEvent }) => {
|
|
|
3262
3610
|
|
|
3263
3611
|
// src/components/trace-graph/trace-graph.tsx
|
|
3264
3612
|
var import_base = require("@xyflow/react/dist/base.css");
|
|
3265
|
-
var
|
|
3266
|
-
var
|
|
3267
|
-
var
|
|
3613
|
+
var import_material13 = require("@mui/material");
|
|
3614
|
+
var import_react13 = require("@xyflow/react");
|
|
3615
|
+
var import_react14 = require("react");
|
|
3268
3616
|
|
|
3269
3617
|
// src/components/trace-graph/service-node.tsx
|
|
3270
|
-
var
|
|
3618
|
+
var import_material12 = require("@mui/material");
|
|
3271
3619
|
var import_style = require("@xyflow/react/dist/style.css");
|
|
3272
|
-
var
|
|
3273
|
-
var
|
|
3620
|
+
var import_react10 = require("@xyflow/react");
|
|
3621
|
+
var import_react11 = require("react");
|
|
3274
3622
|
|
|
3275
3623
|
// src/components/trace-graph/problem-indicator.tsx
|
|
3276
3624
|
var import_icons_material4 = require("@mui/icons-material");
|
|
3277
|
-
var
|
|
3278
|
-
var
|
|
3279
|
-
var
|
|
3625
|
+
var import_material11 = require("@mui/material");
|
|
3626
|
+
var import_react9 = require("react");
|
|
3627
|
+
var import_jsx_runtime132 = require("react/jsx-runtime");
|
|
3280
3628
|
var ProblemIndicator = ({ error }) => {
|
|
3281
|
-
const icon = (0,
|
|
3629
|
+
const icon = (0, import_react9.useMemo)(() => {
|
|
3282
3630
|
switch (error.level) {
|
|
3283
3631
|
case "error": {
|
|
3284
|
-
return /* @__PURE__ */ (0,
|
|
3632
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_icons_material4.Error, { sx: { color: "#d32f2f", fontSize: "14px" } });
|
|
3285
3633
|
}
|
|
3286
3634
|
case "warning": {
|
|
3287
|
-
return /* @__PURE__ */ (0,
|
|
3635
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_icons_material4.Warning, { sx: { color: "#ff9800", fontSize: "14px" } });
|
|
3288
3636
|
}
|
|
3289
3637
|
default: {
|
|
3290
|
-
return /* @__PURE__ */ (0,
|
|
3638
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_icons_material4.Info, { sx: { color: "#2196f3", fontSize: "14px" } });
|
|
3291
3639
|
}
|
|
3292
3640
|
}
|
|
3293
3641
|
}, [error.level]);
|
|
3294
|
-
const color = (0,
|
|
3642
|
+
const color = (0, import_react9.useMemo)(() => {
|
|
3295
3643
|
switch (error.level) {
|
|
3296
3644
|
case "error": {
|
|
3297
3645
|
return "#d32f2f";
|
|
@@ -3304,8 +3652,8 @@ var ProblemIndicator = ({ error }) => {
|
|
|
3304
3652
|
}
|
|
3305
3653
|
}
|
|
3306
3654
|
}, [error.level]);
|
|
3307
|
-
return /* @__PURE__ */ (0,
|
|
3308
|
-
|
|
3655
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_material11.Tooltip, { arrow: true, title: error.message ?? "Issue detected", children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
3656
|
+
import_material11.Box,
|
|
3309
3657
|
{
|
|
3310
3658
|
sx: {
|
|
3311
3659
|
alignItems: "center",
|
|
@@ -3324,17 +3672,17 @@ var ProblemIndicator = ({ error }) => {
|
|
|
3324
3672
|
};
|
|
3325
3673
|
|
|
3326
3674
|
// src/components/trace-graph/service-node.tsx
|
|
3327
|
-
var
|
|
3675
|
+
var import_jsx_runtime133 = require("react/jsx-runtime");
|
|
3328
3676
|
var handleStyle = {
|
|
3329
3677
|
backgroundColor: "white",
|
|
3330
3678
|
borderColor: "lightgray",
|
|
3331
3679
|
opacity: 0
|
|
3332
3680
|
};
|
|
3333
|
-
var ServiceNode = (0,
|
|
3334
|
-
const handleClick = (0,
|
|
3681
|
+
var ServiceNode = (0, import_react11.memo)(function ServiceNode2({ data, selected }) {
|
|
3682
|
+
const handleClick = (0, import_react11.useCallback)(() => {
|
|
3335
3683
|
data.onEventSelect(data.event);
|
|
3336
3684
|
}, [data]);
|
|
3337
|
-
const handleKeyPress = (0,
|
|
3685
|
+
const handleKeyPress = (0, import_react11.useCallback)(
|
|
3338
3686
|
(event) => {
|
|
3339
3687
|
if (event.key === "Enter" || event.key === " ") {
|
|
3340
3688
|
handleClick();
|
|
@@ -3343,9 +3691,9 @@ var ServiceNode = (0, import_react10.memo)(function ServiceNode2({ data, selecte
|
|
|
3343
3691
|
[handleClick]
|
|
3344
3692
|
);
|
|
3345
3693
|
const hasErrors = (data.event.errors && data.event.errors.length > 0) ?? false;
|
|
3346
|
-
return /* @__PURE__ */ (0,
|
|
3347
|
-
/* @__PURE__ */ (0,
|
|
3348
|
-
|
|
3694
|
+
return /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)(import_material12.Box, { sx: { maxWidth: 200 }, children: [
|
|
3695
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsxs)(
|
|
3696
|
+
import_material12.Box,
|
|
3349
3697
|
{
|
|
3350
3698
|
onClick: handleClick,
|
|
3351
3699
|
onKeyPress: handleKeyPress,
|
|
@@ -3367,9 +3715,9 @@ var ServiceNode = (0, import_react10.memo)(function ServiceNode2({ data, selecte
|
|
|
3367
3715
|
},
|
|
3368
3716
|
tabIndex: 0,
|
|
3369
3717
|
children: [
|
|
3370
|
-
/* @__PURE__ */ (0,
|
|
3371
|
-
/* @__PURE__ */ (0,
|
|
3372
|
-
/* @__PURE__ */ (0,
|
|
3718
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_react10.Handle, { position: import_react10.Position.Left, style: handleStyle, type: "target" }),
|
|
3719
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_react10.Handle, { position: import_react10.Position.Right, style: handleStyle, type: "source" }),
|
|
3720
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
3373
3721
|
ServiceCell,
|
|
3374
3722
|
{
|
|
3375
3723
|
borderColor: selected ? "black" : "lightgray",
|
|
@@ -3383,8 +3731,8 @@ var ServiceNode = (0, import_react10.memo)(function ServiceNode2({ data, selecte
|
|
|
3383
3731
|
]
|
|
3384
3732
|
}
|
|
3385
3733
|
),
|
|
3386
|
-
/* @__PURE__ */ (0,
|
|
3387
|
-
|
|
3734
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsxs)(
|
|
3735
|
+
import_material12.Stack,
|
|
3388
3736
|
{
|
|
3389
3737
|
alignItems: "center",
|
|
3390
3738
|
direction: "row",
|
|
@@ -3394,8 +3742,8 @@ var ServiceNode = (0, import_react10.memo)(function ServiceNode2({ data, selecte
|
|
|
3394
3742
|
mt: 0.5
|
|
3395
3743
|
},
|
|
3396
3744
|
children: [
|
|
3397
|
-
hasErrors && /* @__PURE__ */ (0,
|
|
3398
|
-
|
|
3745
|
+
hasErrors && /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
3746
|
+
import_material12.Stack,
|
|
3399
3747
|
{
|
|
3400
3748
|
direction: "row",
|
|
3401
3749
|
spacing: 0.5,
|
|
@@ -3403,11 +3751,11 @@ var ServiceNode = (0, import_react10.memo)(function ServiceNode2({ data, selecte
|
|
|
3403
3751
|
flexWrap: "wrap",
|
|
3404
3752
|
gap: "2px"
|
|
3405
3753
|
},
|
|
3406
|
-
children: data.event.errors?.map((error) => /* @__PURE__ */ (0,
|
|
3754
|
+
children: data.event.errors?.map((error) => /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(ProblemIndicator, { error }, error.span_id))
|
|
3407
3755
|
}
|
|
3408
3756
|
),
|
|
3409
|
-
/* @__PURE__ */ (0,
|
|
3410
|
-
|
|
3757
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
3758
|
+
import_material12.Typography,
|
|
3411
3759
|
{
|
|
3412
3760
|
sx: {
|
|
3413
3761
|
fontSize: "0.9rem",
|
|
@@ -3429,7 +3777,7 @@ var ServiceNode = (0, import_react10.memo)(function ServiceNode2({ data, selecte
|
|
|
3429
3777
|
|
|
3430
3778
|
// src/components/trace-graph/utils.ts
|
|
3431
3779
|
var import_dagre = __toESM(require("@dagrejs/dagre"), 1);
|
|
3432
|
-
var
|
|
3780
|
+
var import_react12 = require("@xyflow/react");
|
|
3433
3781
|
var generateNodesAndEdges = (event, onEventSelect, parentId) => {
|
|
3434
3782
|
const nodes = [];
|
|
3435
3783
|
const edges = [];
|
|
@@ -3446,8 +3794,8 @@ var generateNodesAndEdges = (event, onEventSelect, parentId) => {
|
|
|
3446
3794
|
id: event.span_id,
|
|
3447
3795
|
position: { x: 0, y: 0 },
|
|
3448
3796
|
// Will be set by layout
|
|
3449
|
-
sourcePosition:
|
|
3450
|
-
targetPosition:
|
|
3797
|
+
sourcePosition: import_react12.Position.Right,
|
|
3798
|
+
targetPosition: import_react12.Position.Left,
|
|
3451
3799
|
type: "service"
|
|
3452
3800
|
});
|
|
3453
3801
|
if (parentId) {
|
|
@@ -3457,7 +3805,7 @@ var generateNodesAndEdges = (event, onEventSelect, parentId) => {
|
|
|
3457
3805
|
markerEnd: {
|
|
3458
3806
|
color: "lightgray",
|
|
3459
3807
|
height: 16,
|
|
3460
|
-
type:
|
|
3808
|
+
type: import_react12.MarkerType.Arrow,
|
|
3461
3809
|
width: 16
|
|
3462
3810
|
},
|
|
3463
3811
|
source: parentId,
|
|
@@ -3520,7 +3868,7 @@ var calculateCenterX = (focusNodeX, viewPortPixelWidth, minX, maxX) => {
|
|
|
3520
3868
|
};
|
|
3521
3869
|
|
|
3522
3870
|
// src/components/trace-graph/trace-graph.tsx
|
|
3523
|
-
var
|
|
3871
|
+
var import_jsx_runtime134 = require("react/jsx-runtime");
|
|
3524
3872
|
var nodeTypes = {
|
|
3525
3873
|
service: ServiceNode
|
|
3526
3874
|
};
|
|
@@ -3530,15 +3878,15 @@ var TraceGraph = ({
|
|
|
3530
3878
|
traceId,
|
|
3531
3879
|
viewPortPixelWidth
|
|
3532
3880
|
}) => {
|
|
3533
|
-
const [nodes, setNodes] = (0,
|
|
3534
|
-
const [edges, setEdges] = (0,
|
|
3535
|
-
const [isLoading, setIsLoading] = (0,
|
|
3536
|
-
const [initialViewSet, setInitialViewSet] = (0,
|
|
3537
|
-
const { fitView, setCenter } = (0,
|
|
3538
|
-
const store = (0,
|
|
3881
|
+
const [nodes, setNodes] = (0, import_react14.useState)([]);
|
|
3882
|
+
const [edges, setEdges] = (0, import_react14.useState)([]);
|
|
3883
|
+
const [isLoading, setIsLoading] = (0, import_react14.useState)(true);
|
|
3884
|
+
const [initialViewSet, setInitialViewSet] = (0, import_react14.useState)(false);
|
|
3885
|
+
const { fitView, setCenter } = (0, import_react13.useReactFlow)();
|
|
3886
|
+
const store = (0, import_react13.useStoreApi)();
|
|
3539
3887
|
const api = useAppInspectorApi();
|
|
3540
|
-
const [fetchError, setFetchError] = (0,
|
|
3541
|
-
const updateSelectedNode = (0,
|
|
3888
|
+
const [fetchError, setFetchError] = (0, import_react14.useState)();
|
|
3889
|
+
const updateSelectedNode = (0, import_react14.useCallback)(
|
|
3542
3890
|
(nodeId) => {
|
|
3543
3891
|
const { addSelectedNodes } = store.getState();
|
|
3544
3892
|
if (nodeId) {
|
|
@@ -3550,7 +3898,7 @@ var TraceGraph = ({
|
|
|
3550
3898
|
},
|
|
3551
3899
|
[nodes, store]
|
|
3552
3900
|
);
|
|
3553
|
-
const fetchTrace = (0,
|
|
3901
|
+
const fetchTrace = (0, import_react14.useCallback)(async () => {
|
|
3554
3902
|
setIsLoading(true);
|
|
3555
3903
|
try {
|
|
3556
3904
|
const response = await api.getSpans({ trace_id: traceId });
|
|
@@ -3593,13 +3941,13 @@ var TraceGraph = ({
|
|
|
3593
3941
|
setIsLoading(false);
|
|
3594
3942
|
}
|
|
3595
3943
|
}, [api, traceId, onEventSelect]);
|
|
3596
|
-
const fetchTraceSync = (0,
|
|
3944
|
+
const fetchTraceSync = (0, import_react14.useCallback)(() => {
|
|
3597
3945
|
void fetchTrace();
|
|
3598
3946
|
}, [fetchTrace]);
|
|
3599
|
-
(0,
|
|
3947
|
+
(0, import_react14.useEffect)(() => {
|
|
3600
3948
|
fetchTraceSync();
|
|
3601
3949
|
}, [fetchTraceSync]);
|
|
3602
|
-
(0,
|
|
3950
|
+
(0, import_react14.useEffect)(() => {
|
|
3603
3951
|
const shouldSetInitialView = !isLoading && nodes.length > 0 && !initialViewSet;
|
|
3604
3952
|
if (shouldSetInitialView) {
|
|
3605
3953
|
if (initialFocusEventId) {
|
|
@@ -3619,20 +3967,20 @@ var TraceGraph = ({
|
|
|
3619
3967
|
setInitialViewSet(true);
|
|
3620
3968
|
}
|
|
3621
3969
|
}, [isLoading, nodes, initialFocusEventId, viewPortPixelWidth, setCenter, fitView, onEventSelect, initialViewSet]);
|
|
3622
|
-
(0,
|
|
3970
|
+
(0, import_react14.useEffect)(() => {
|
|
3623
3971
|
if (initialFocusEventId) {
|
|
3624
3972
|
updateSelectedNode(initialFocusEventId);
|
|
3625
3973
|
}
|
|
3626
3974
|
}, [initialFocusEventId, updateSelectedNode]);
|
|
3627
|
-
const onNodeClick = (0,
|
|
3975
|
+
const onNodeClick = (0, import_react14.useCallback)((_event, node) => {
|
|
3628
3976
|
onEventSelect(node.data.event);
|
|
3629
3977
|
updateSelectedNode(node.id);
|
|
3630
3978
|
}, [onEventSelect, updateSelectedNode]);
|
|
3631
|
-
return /* @__PURE__ */ (0,
|
|
3632
|
-
fetchError && /* @__PURE__ */ (0,
|
|
3633
|
-
|
|
3979
|
+
return /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(import_jsx_runtime134.Fragment, { children: [
|
|
3980
|
+
fetchError && /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(
|
|
3981
|
+
import_material13.Alert,
|
|
3634
3982
|
{
|
|
3635
|
-
action: /* @__PURE__ */ (0,
|
|
3983
|
+
action: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_material13.Button, { onClick: fetchTraceSync, children: "Retry" }),
|
|
3636
3984
|
severity: "error",
|
|
3637
3985
|
children: [
|
|
3638
3986
|
"Unexpected error:",
|
|
@@ -3641,8 +3989,8 @@ var TraceGraph = ({
|
|
|
3641
3989
|
]
|
|
3642
3990
|
}
|
|
3643
3991
|
),
|
|
3644
|
-
/* @__PURE__ */ (0,
|
|
3645
|
-
|
|
3992
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(
|
|
3993
|
+
import_react13.ReactFlow,
|
|
3646
3994
|
{
|
|
3647
3995
|
"data-testid": "trace-graph",
|
|
3648
3996
|
defaultViewport: { x: 0, y: 0, zoom: 1 },
|
|
@@ -3655,8 +4003,8 @@ var TraceGraph = ({
|
|
|
3655
4003
|
onNodeClick,
|
|
3656
4004
|
selectNodesOnDrag: false,
|
|
3657
4005
|
children: [
|
|
3658
|
-
/* @__PURE__ */ (0,
|
|
3659
|
-
/* @__PURE__ */ (0,
|
|
4006
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_react13.Controls, { showInteractive: false }),
|
|
4007
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_react13.Background, {})
|
|
3660
4008
|
]
|
|
3661
4009
|
}
|
|
3662
4010
|
)
|
|
@@ -3664,7 +4012,7 @@ var TraceGraph = ({
|
|
|
3664
4012
|
};
|
|
3665
4013
|
|
|
3666
4014
|
// src/pages/trace-graph.tsx
|
|
3667
|
-
var
|
|
4015
|
+
var import_jsx_runtime135 = require("react/jsx-runtime");
|
|
3668
4016
|
var HEADER_HEIGHT = 56;
|
|
3669
4017
|
var DRAWER_WIDTH = "35%";
|
|
3670
4018
|
var Main = (0, import_styles.styled)("main", { shouldForwardProp: (property) => property !== "open" })(({ open, theme }) => ({
|
|
@@ -3682,7 +4030,7 @@ var Main = (0, import_styles.styled)("main", { shouldForwardProp: (property) =>
|
|
|
3682
4030
|
})
|
|
3683
4031
|
}
|
|
3684
4032
|
}));
|
|
3685
|
-
var StyledDrawer = (0, import_styles.styled)(
|
|
4033
|
+
var StyledDrawer = (0, import_styles.styled)(import_material14.Drawer)(() => ({
|
|
3686
4034
|
"& .MuiDrawer-paper": {
|
|
3687
4035
|
backgroundColor: "#ffffff",
|
|
3688
4036
|
bottom: 0,
|
|
@@ -3700,10 +4048,11 @@ var TraceGraphPage = () => {
|
|
|
3700
4048
|
const { traceId } = (0, import_react_router_dom2.useParams)();
|
|
3701
4049
|
const [searchParameters] = (0, import_react_router_dom2.useSearchParams)();
|
|
3702
4050
|
const spanId = searchParameters.get("spanId");
|
|
3703
|
-
const [open, setOpen] = (0,
|
|
3704
|
-
const [selectedEvent, setSelectedEvent] = (0,
|
|
3705
|
-
const [viewPortPixelWidth, setViewPortPixelWidth] = (0,
|
|
3706
|
-
const
|
|
4051
|
+
const [open, setOpen] = (0, import_react16.useState)(true);
|
|
4052
|
+
const [selectedEvent, setSelectedEvent] = (0, import_react16.useState)();
|
|
4053
|
+
const [viewPortPixelWidth, setViewPortPixelWidth] = (0, import_react16.useState)(0);
|
|
4054
|
+
const { checkStatus, error: statusError, status } = useStatus();
|
|
4055
|
+
const calculateDrawerWidth = (0, import_react16.useCallback)(() => {
|
|
3707
4056
|
const percentageMatch = /(\d+)%/.exec(DRAWER_WIDTH);
|
|
3708
4057
|
if (percentageMatch && open) {
|
|
3709
4058
|
const percentage = Number.parseInt(percentageMatch[1], 10);
|
|
@@ -3711,7 +4060,7 @@ var TraceGraphPage = () => {
|
|
|
3711
4060
|
}
|
|
3712
4061
|
return 0;
|
|
3713
4062
|
}, [open]);
|
|
3714
|
-
(0,
|
|
4063
|
+
(0, import_react16.useEffect)(() => {
|
|
3715
4064
|
const updateViewportWidth = () => {
|
|
3716
4065
|
const totalWidth = window.innerWidth;
|
|
3717
4066
|
const drawerPixelWidth = open ? calculateDrawerWidth() : 0;
|
|
@@ -3725,12 +4074,16 @@ var TraceGraphPage = () => {
|
|
|
3725
4074
|
clearTimeout(timeoutId);
|
|
3726
4075
|
};
|
|
3727
4076
|
}, [open, calculateDrawerWidth]);
|
|
3728
|
-
const handleEventSelect = (0,
|
|
4077
|
+
const handleEventSelect = (0, import_react16.useCallback)((event) => {
|
|
3729
4078
|
setSelectedEvent(event);
|
|
3730
4079
|
setOpen(true);
|
|
3731
4080
|
}, []);
|
|
3732
|
-
|
|
3733
|
-
|
|
4081
|
+
const handleRetry = (0, import_react16.useCallback)(() => {
|
|
4082
|
+
void checkStatus();
|
|
4083
|
+
}, [checkStatus]);
|
|
4084
|
+
const shouldShowStatusMessage = Boolean(statusError) || status?.status === "DISABLED";
|
|
4085
|
+
return /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
4086
|
+
import_material14.Box,
|
|
3734
4087
|
{
|
|
3735
4088
|
"data-testid": "trace-graph-page",
|
|
3736
4089
|
sx: {
|
|
@@ -3740,8 +4093,8 @@ var TraceGraphPage = () => {
|
|
|
3740
4093
|
height: "100vh",
|
|
3741
4094
|
overflow: "hidden"
|
|
3742
4095
|
},
|
|
3743
|
-
children: /* @__PURE__ */ (0,
|
|
3744
|
-
|
|
4096
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
4097
|
+
import_material14.Paper,
|
|
3745
4098
|
{
|
|
3746
4099
|
sx: {
|
|
3747
4100
|
display: "flex",
|
|
@@ -3750,15 +4103,22 @@ var TraceGraphPage = () => {
|
|
|
3750
4103
|
position: "relative",
|
|
3751
4104
|
width: "100%"
|
|
3752
4105
|
},
|
|
3753
|
-
children:
|
|
3754
|
-
|
|
3755
|
-
|
|
4106
|
+
children: shouldShowStatusMessage ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
4107
|
+
StatusMessage,
|
|
4108
|
+
{
|
|
4109
|
+
error: statusError,
|
|
4110
|
+
onRetry: handleRetry,
|
|
4111
|
+
status
|
|
4112
|
+
}
|
|
4113
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(import_jsx_runtime135.Fragment, { children: [
|
|
4114
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(Main, { open, children: /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
4115
|
+
import_material14.Box,
|
|
3756
4116
|
{
|
|
3757
4117
|
sx: {
|
|
3758
4118
|
height: "100%",
|
|
3759
4119
|
overflow: "auto"
|
|
3760
4120
|
},
|
|
3761
|
-
children: traceId !== void 0 && /* @__PURE__ */ (0,
|
|
4121
|
+
children: traceId !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_react15.ReactFlowProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
3762
4122
|
TraceGraph,
|
|
3763
4123
|
{
|
|
3764
4124
|
initialFocusEventId: spanId,
|
|
@@ -3769,8 +4129,8 @@ var TraceGraphPage = () => {
|
|
|
3769
4129
|
) })
|
|
3770
4130
|
}
|
|
3771
4131
|
) }),
|
|
3772
|
-
/* @__PURE__ */ (0,
|
|
3773
|
-
]
|
|
4132
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(StyledDrawer, { anchor: "right", open, variant: "persistent", children: /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(EventDetails, { selectedEvent }) })
|
|
4133
|
+
] })
|
|
3774
4134
|
}
|
|
3775
4135
|
)
|
|
3776
4136
|
}
|