-
Notifications
You must be signed in to change notification settings - Fork 417
Expand file tree
/
Copy pathadmin-debug-bundle.tsx
More file actions
701 lines (669 loc) · 25.1 KB
/
admin-debug-bundle.tsx
File metadata and controls
701 lines (669 loc) · 25.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
/**
* Copyright 2022 Redpanda Data, Inc.
*
* Use of this software is governed by the Business Source License
* included in the file https://github.com/redpanda-data/redpanda/blob/dev/licenses/bsl.md
*
* As of the Change Date specified in that file, in accordance with
* the Business Source License, use of this software will be governed
* by the Apache License, Version 2.0
*/
import { Link } from '@tanstack/react-router';
import { type FC, useEffect, useState } from 'react';
import '../../../utils/array-extensions';
import { create } from '@bufbuild/protobuf';
import { timestampDate, timestampFromDate } from '@bufbuild/protobuf/wkt';
import {
Alert,
AlertIcon,
Box,
Button,
Checkbox,
ConfirmModal,
DateTimeInput,
Flex,
FormField,
Grid,
GridItem,
Input,
isMultiValue,
isSingleValue,
PasswordInput,
Select,
Text,
} from '@redpanda-data/ui';
import { TrashIcon } from 'components/icons';
import {
type CreateDebugBundleRequest,
CreateDebugBundleRequestSchema,
DebugBundleStatus_Status,
LabelSelectorSchema,
type SCRAMAuth,
SCRAMAuth_Mechanism,
} from '../../../protogen/redpanda/api/console/v1alpha1/debug_bundle_pb';
import queryClient from '../../../query-client';
import { appGlobal } from '../../../state/app-global';
import { api, useApiStoreHook } from '../../../state/backend-api';
import type { BrokerWithConfigAndStorage } from '../../../state/rest-interfaces';
import DebugBundleLink from '../../debugBundle/debug-bundle-link';
import { SingleSelect } from '../../misc/select';
import { PageComponent, type PageInitHelper } from '../page';
// Unit mappings for consistent dropdown handling
const SIZE_UNITS = [
{ value: 1, label: 'Bytes' },
{ value: 1024, label: 'KB' },
{ value: 1024 * 1024, label: 'MB' },
{ value: 1024 * 1024 * 1024, label: 'GB' },
];
const TIME_UNITS = [
{ value: 1, label: 'Seconds' },
{ value: 60, label: 'Minutes' },
];
// Helper functions to get labels from unit values
const getSizeUnitLabel = (unitValue: number): string =>
SIZE_UNITS.find((unit) => unit.value === unitValue)?.label || '';
const getTimeUnitLabel = (unitValue: number): string =>
TIME_UNITS.find((unit) => unit.value === unitValue)?.label || '';
const Header: FC<{ mode?: 'default' | 'advanced' }> = ({ mode = 'default' }) => (
<Text data-testid={`debug-bundle-description-${mode}-mode`}>
Collect environment data that can help debug and diagnose issues with a Redpanda cluster, a broker, or the machine
it's running on. This will bundle the collected data into a ZIP file.
</Text>
);
type ErrorDebugInfo = {
reason?: string;
domain?: string;
fieldViolations?: Array<{
field: string;
description: string;
}>;
};
type ErrorDetail = {
type: string;
value: string;
debug?: ErrorDebugInfo;
};
// This is a tmp workaround until we figure out how to properly type response errors from the backend
type ErrorResponse = {
code: string;
message: string;
details: ErrorDetail[];
};
type FieldViolationsMap = {
[field: string]: string;
};
export class AdminDebugBundle extends PageComponent {
initPage(p: PageInitHelper): void {
p.title = 'Debug bundle';
p.addBreadcrumb('Debug bundle', '/debug-bundle');
this.refreshData();
appGlobal.onRefresh = () => this.refreshData();
}
refreshData() {
api.refreshDebugBundleStatuses().catch(() => {
// Error handling managed by API layer
});
}
render() {
return <AdminDebugBundleContent />;
}
}
const AdminDebugBundleContent: FC = () => {
const statuses = useApiStoreHook((s) => s.debugBundleStatuses);
const hasDebugProcess = useApiStoreHook((s) => s.hasDebugProcess);
const [submitInProgress, setSubmitInProgress] = useState(false);
const [createBundleError, setCreateBundleError] = useState<ErrorResponse | undefined>(undefined);
const isInProgress = statuses.some(
(s) => s.value.case === 'bundleStatus' && s.value.value.status === DebugBundleStatus_Status.RUNNING
);
const isExpired =
statuses.length > 0 &&
!isInProgress &&
statuses.some((s) => s.value.case === 'bundleStatus' && s.value.value.status === DebugBundleStatus_Status.EXPIRED);
const isError =
statuses.length > 0 &&
!isInProgress &&
statuses.every((s) => s.value.case === 'bundleStatus' && s.value.value.status === DebugBundleStatus_Status.ERROR);
const canDownload =
statuses.length > 0 &&
!isInProgress &&
statuses.some((s) => s.value.case === 'bundleStatus' && s.value.value.status === DebugBundleStatus_Status.SUCCESS);
const debugBundleStatus = statuses
.map((s) => (s.value.case === 'bundleStatus' ? s.value.value : undefined))
.find(Boolean);
if (isInProgress) {
return (
<Box>
<Header />
<Button as={Link} mt={4} px={0} to={`/debug-bundle/progress/${debugBundleStatus?.jobId}`} variant="link">
Bundle generation in progress...
</Button>
{debugBundleStatus?.createdAt ? (
<Text>Started {timestampDate(debugBundleStatus.createdAt).toLocaleString()}</Text>
) : null}
</Box>
);
}
return (
<Box>
<Box mt={4}>
{Boolean(canDownload || isExpired) && <Text fontWeight="bold">Latest debug bundle:</Text>}
{Boolean(isExpired) && <Text>Your previous bundle has expired and cannot be downloaded.</Text>}
{Boolean(isError) && <Text fontWeight="bold">Your debug bundle was not generated. Try again.</Text>}
{Boolean(canDownload) && <DebugBundleLink showDeleteButton statuses={statuses} />}
{statuses.length === 0 && <Text>No debug bundle available for download.</Text>}
</Box>
<Box>
{Boolean(submitInProgress) && <Box>Generating bundle ...</Box>}
<NewDebugBundleForm
debugBundleExists={hasDebugProcess}
error={createBundleError}
isError={isError}
isExpired={isExpired}
onSubmit={(data: CreateDebugBundleRequest) => {
setSubmitInProgress(true);
setCreateBundleError(undefined);
api
.createDebugBundle(data)
.then(async (result) => {
await api.refreshDebugBundleStatuses();
appGlobal.historyPush(`/debug-bundle/progress/${result.jobId}`);
})
.catch((err: ErrorResponse) => {
setCreateBundleError(err);
})
.finally(() => {
setSubmitInProgress(false);
});
}}
/>
</Box>
</Box>
);
};
const NewDebugBundleForm: FC<{
onSubmit: (data: CreateDebugBundleRequest) => void;
error?: ErrorResponse;
debugBundleExists: boolean;
isExpired: boolean;
isError: boolean;
}> = ({ onSubmit, error, debugBundleExists, isExpired, isError }) => {
const [advancedForm, setAdvancedForm] = useState(false);
useEffect(() => {
api.refreshBrokers(true);
queryClient.invalidateQueries({ queryKey: ['topicPartitionsAll'] });
}, []);
const fieldViolationsMap = error?.details
?.find(({ debug }) => debug?.fieldViolations)
?.debug?.fieldViolations?.reduce((acc, violation) => {
acc[violation.field] = violation.description;
return acc;
}, {} as FieldViolationsMap);
const [formState, setFormState] = useState({
scramUsername: undefined as string | undefined,
scramPassword: undefined as string | undefined,
scramMechanism: SCRAMAuth_Mechanism.SCRAM_SHA_256 as SCRAMAuth_Mechanism,
skipTlsVerification: false,
brokerIds: [] as number[],
tlsEnabled: false,
tlsInsecureSkipVerify: false,
controllerLogsSizeLimitBytes: 132 as number, // Default 132MB
controllerLogsSizeLimitUnit: 1024 * 1024, // Default to MB
cpuProfilerWaitSeconds: 30 as number | undefined, // Default 30s
cpuProfilerWaitUnit: 1, // Default to seconds
logsSince: new Date().setDate(new Date().getDate() - 1) as number | undefined, // Default yesterday
logsSizeLimitBytes: 100 as number, // Default 100MB
logsSizeLimitUnit: 1024 * 1024, // Default to MB
logsUntil: undefined as number | undefined,
metricsIntervalSeconds: 10 as number, // Default 10s
metricsIntervalUnit: 1, // Default to seconds
metricsSamples: '2' as string, // Default 2 samples
namespace: 'redpanda' as string, // Default "redpanda"
partitions: [] as string[],
labelSelectors: [] as Array<{ key: string; value: string }>,
});
const generateNewDebugBundle = () => {
onSubmit(
advancedForm
? create(CreateDebugBundleRequestSchema, {
authentication:
formState.scramUsername || formState.scramPassword
? {
case: 'scram',
value: {
username: formState.scramUsername,
password: formState.scramPassword,
mechanism: formState.scramMechanism,
} as SCRAMAuth,
}
: undefined,
brokerIds: formState.brokerIds,
controllerLogsSizeLimitBytes:
formState.controllerLogsSizeLimitBytes * formState.controllerLogsSizeLimitUnit,
cpuProfilerWaitSeconds: formState.cpuProfilerWaitSeconds
? formState.cpuProfilerWaitSeconds * formState.cpuProfilerWaitUnit
: undefined,
logsSince: formState.logsSince ? timestampFromDate(new Date(formState.logsSince)) : undefined,
logsSizeLimitBytes: formState.logsSizeLimitBytes * formState.logsSizeLimitUnit,
logsUntil: formState.logsUntil ? timestampFromDate(new Date(formState.logsUntil)) : undefined,
metricsIntervalSeconds: formState.metricsIntervalSeconds * formState.metricsIntervalUnit,
tlsEnabled: formState.tlsEnabled,
tlsInsecureSkipVerify: formState.tlsInsecureSkipVerify,
namespace: formState.namespace,
labelSelector: formState.labelSelectors.map((x) => create(LabelSelectorSchema, x)),
partitions: formState.partitions,
})
: create(CreateDebugBundleRequestSchema)
);
};
return (
<Box mt={4}>
<Header mode={advancedForm ? 'advanced' : 'default'} />
{Boolean(advancedForm) && (
<Flex
flexDirection="column"
gap={2}
mt={4}
width={{
base: 'full',
sm: 500,
}}
>
<Alert my={2} status="info">
<AlertIcon />
This is an advanced feature, best used if you have received direction to do so from Redpanda support.
</Alert>
<FormField
errorText={fieldViolationsMap?.['scram.username']}
isInvalid={!!fieldViolationsMap?.['scram.username']}
label="SCRAM user"
>
<Input
data-testid="scram-user-input"
onChange={(e) => setFormState((prev) => ({ ...prev, scramUsername: e.target.value }))}
value={formState.scramUsername}
/>
</FormField>
<FormField label="SASL Mechanism" showRequiredIndicator>
<SingleSelect<SCRAMAuth_Mechanism>
onChange={(e) => {
setFormState((prev) => ({ ...prev, scramMechanism: e }));
}}
options={[
{
value: SCRAMAuth_Mechanism.SCRAM_SHA_256,
label: 'SCRAM-SHA-256',
},
{
value: SCRAMAuth_Mechanism.SCRAM_SHA_512,
label: 'SCRAM-SHA-512',
},
]}
value={formState.scramMechanism}
/>
</FormField>
<Checkbox
isChecked={formState.tlsEnabled}
onChange={(x) => {
setFormState((prev) => ({ ...prev, tlsEnabled: x.target.checked }));
}}
>
TLS enabled
</Checkbox>
<Checkbox
isChecked={formState.skipTlsVerification}
onChange={(x) => {
setFormState((prev) => ({ ...prev, skipTlsVerification: x.target.checked }));
}}
>
Skip TLS verification
</Checkbox>
<FormField
errorText={fieldViolationsMap?.['scram.password']}
isInvalid={!!fieldViolationsMap?.['scram.password']}
label="Password"
>
<PasswordInput
data-testid="scram-user-password"
onChange={(e) => setFormState((prev) => ({ ...prev, scramPassword: e.target.value }))}
value={formState.scramPassword}
/>
</FormField>
<FormField description="Specify broker IDs (or leave blank for all)" label="Broker(s)">
<Select<BrokerWithConfigAndStorage['brokerId']>
isMulti
onChange={(x) => {
if (isMultiValue(x)) {
setFormState((prev) => ({ ...prev, brokerIds: x.map((item) => item.value) }));
}
}}
options={
api.brokers?.map((broker) => ({
value: broker.brokerId,
label: `${broker.brokerId}`,
})) ?? []
}
/>
</FormField>
<FormField
description='The size limit of the controller logs that can be stored in the bundle (default "132MB")'
errorText={fieldViolationsMap?.controllerLogsSizeLimitBytes}
isInvalid={!!fieldViolationsMap?.controllerLogsSizeLimitBytes}
label="Controller log size limit"
>
<Flex gap={2}>
<Input
data-testid="controller-log-size-input"
onChange={(e) =>
setFormState((prev) => ({ ...prev, controllerLogsSizeLimitBytes: e.target.valueAsNumber }))
}
type="number"
value={formState.controllerLogsSizeLimitBytes}
/>
<Select
chakraStyles={{
container: (provided) => ({
...provided,
minWidth: 150,
}),
}}
onChange={(value) => {
if (value && isSingleValue(value)) {
setFormState((prev) => ({ ...prev, controllerLogsSizeLimitUnit: value.value }));
}
}}
options={SIZE_UNITS}
value={{
value: formState.controllerLogsSizeLimitUnit,
label: getSizeUnitLabel(formState.controllerLogsSizeLimitUnit),
}}
/>
</Flex>
</FormField>
<FormField
description="How long to collect samples for the CPU profiler. Must be higher than 15s (default 30s)"
errorText={fieldViolationsMap?.cpuProfilerWaitSeconds}
isInvalid={!!fieldViolationsMap?.cpuProfilerWaitSeconds}
label="CPU profiler wait"
>
<Flex gap={2}>
<Input
data-testid="cpu-profiler-input"
onChange={(e) => setFormState((prev) => ({ ...prev, cpuProfilerWaitSeconds: e.target.valueAsNumber }))}
type="number"
value={formState.cpuProfilerWaitSeconds}
/>
<Select
chakraStyles={{
container: (provided) => ({
...provided,
minWidth: 150,
}),
}}
onChange={(value) => {
if (value && isSingleValue(value)) {
setFormState((prev) => ({ ...prev, cpuProfilerWaitUnit: value.value }));
}
}}
options={TIME_UNITS}
value={{
value: formState.cpuProfilerWaitUnit,
label: getTimeUnitLabel(formState.cpuProfilerWaitUnit),
}}
/>
</Flex>
</FormField>
<FormField
description="Include logs dated from specified date onward; (journalctl date format: YYYY-MM-DD, 'yesterday', or 'today'). Default 'yesterday'."
errorText={fieldViolationsMap?.logsSince}
isInvalid={!!fieldViolationsMap?.logsSince}
label="Logs since"
>
<DateTimeInput
onChange={(date) => setFormState((prev) => ({ ...prev, logsSince: date }))}
value={formState.logsSince}
/>
</FormField>
<FormField
description="Include logs older than the specified date; (journalctl date format: YYYY-MM-DD, 'yesterday', or 'today')."
errorText={fieldViolationsMap?.logsUntil}
isInvalid={!!fieldViolationsMap?.logsUntil}
label="Logs until"
>
<DateTimeInput
onChange={(date) => setFormState((prev) => ({ ...prev, logsUntil: date }))}
value={formState.logsUntil}
/>
</FormField>
<FormField
description="Read the logs until the given size is reached (e.g. 3MB, 1GB). Default 100MB."
errorText={fieldViolationsMap?.logsSizeLimitBytes}
isInvalid={!!fieldViolationsMap?.logsSizeLimitBytes}
label="Logs size limit"
>
<Flex gap={2}>
<Input
data-testid="log-size-limit-input"
onChange={(e) => setFormState((prev) => ({ ...prev, logsSizeLimitBytes: e.target.valueAsNumber }))}
type="number"
value={formState.logsSizeLimitBytes}
/>
<Select
chakraStyles={{
container: (provided) => ({
...provided,
minWidth: 150,
}),
}}
onChange={(value) => {
if (value && isSingleValue(value)) {
setFormState((prev) => ({ ...prev, logsSizeLimitUnit: value.value }));
}
}}
options={SIZE_UNITS}
value={{
value: formState.logsSizeLimitUnit,
label: getSizeUnitLabel(formState.logsSizeLimitUnit),
}}
/>
</Flex>
</FormField>
<FormField
description="Interval between metrics snapshots (default 10s)"
errorText={fieldViolationsMap?.metricsIntervalSeconds}
isInvalid={!!fieldViolationsMap?.metricsIntervalSeconds}
label="Metrics interval duration"
>
<Flex gap={2}>
<Input
data-testid="metrics-interval-duration-input"
onChange={(e) => setFormState((prev) => ({ ...prev, metricsIntervalSeconds: e.target.valueAsNumber }))}
type="number"
value={formState.metricsIntervalSeconds}
/>
<Select
chakraStyles={{
container: (provided) => ({
...provided,
minWidth: 150,
}),
}}
onChange={(value) => {
if (value && isSingleValue(value)) {
setFormState((prev) => ({ ...prev, metricsIntervalUnit: value.value }));
}
}}
options={TIME_UNITS}
value={{
value: formState.metricsIntervalUnit,
label: getTimeUnitLabel(formState.metricsIntervalUnit),
}}
/>
</Flex>
</FormField>
<FormField
description="Number of metrics samples to take (at the interval of 'metrics interval duration'). Must be >= 2"
errorText={fieldViolationsMap?.metricsSamples}
isInvalid={!!fieldViolationsMap?.metricsSamples}
label="Metrics samples"
>
<Input
data-testid="metrics-samples-in put"
onChange={(e) => setFormState((prev) => ({ ...prev, metricsSamples: e.target.value }))}
value={formState.metricsSamples}
/>
</FormField>
<FormField
description='The namespace to use to collect the resources from (k8s only). Default "redpanda".'
errorText={fieldViolationsMap?.namespace}
isInvalid={!!fieldViolationsMap?.namespace}
label="Namespace"
>
<Input
data-testid="namespace-input"
onChange={(e) => setFormState((prev) => ({ ...prev, namespace: e.target.value }))}
value={formState.namespace}
/>
</FormField>
<FormField
description="Partition ID. If set, the bundle will include extra information about the requested partitions."
errorText={fieldViolationsMap?.partitions}
isInvalid={!!fieldViolationsMap?.partitions}
label="Partition(s)"
>
<Select<string>
isMulti
onChange={(x) => {
if (isMultiValue(x)) {
setFormState((prev) => ({ ...prev, partitions: x.map((item) => item.value) }));
}
}}
options={api.getTopicPartitionArray.map((partition) => ({
value: partition,
label: partition,
}))}
/>
</FormField>
<FormField
description="Label selectors to filter your resources."
errorText={fieldViolationsMap?.labelSelectors}
isInvalid={!!fieldViolationsMap?.labelSelectors}
label="Label selectors"
>
{formState.labelSelectors.map((labelSelector, idx) => (
<Grid gap={2} key={`label-${labelSelector.key}-${labelSelector.value}`} templateColumns="1fr 1fr auto">
<GridItem>
<Text fontSize="sm">Key</Text>
<Input
onChange={(e) => {
setFormState((prev) => ({
...prev,
labelSelectors: prev.labelSelectors.map((ls, i) =>
i === idx ? { ...ls, key: e.target.value } : ls
),
}));
}}
value={labelSelector.key}
/>
</GridItem>
<GridItem>
<Text fontSize="sm">Value</Text>
<Input
onChange={(e) => {
setFormState((prev) => ({
...prev,
labelSelectors: prev.labelSelectors.map((ls, i) =>
i === idx ? { ...ls, value: e.target.value } : ls
),
}));
}}
value={labelSelector.value}
/>
</GridItem>
<GridItem alignItems="flex-end" display="flex">
<Button
onClick={() => {
setFormState((prev) => ({
...prev,
labelSelectors: prev.labelSelectors.filter((_, i) => i !== idx),
}));
}}
variant="ghost"
>
<TrashIcon />
</Button>
</GridItem>
</Grid>
))}
<Box>
<Button
my={2}
onClick={() => {
setFormState((prev) => ({
...prev,
labelSelectors: [...prev.labelSelectors, { key: '', value: '' }],
}));
}}
variant="outline"
>
Add
</Button>
</Box>
</FormField>
</Flex>
)}
{error ? (
<Alert my={4} status="error">
<AlertIcon />
{error.message}
</Alert>
) : null}
<Flex gap={2} mt={4}>
{debugBundleExists && !isExpired && !isError ? (
<ConfirmModal
heading="Generate new debug bundle"
onConfirm={() => {
generateNewDebugBundle();
}}
trigger={advancedForm ? 'Generate' : 'Generate default'}
>
You have an existing debug bundle; generating a new one will delete the previous one. Are you sure?
</ConfirmModal>
) : (
<Button
onClick={() => {
generateNewDebugBundle();
}}
>
{advancedForm ? 'Generate' : 'Generate default'}
</Button>
)}
{advancedForm ? (
<Flex alignItems="center" gap={1}>
or
<Button
data-testid="switch-to-default-debug-bundle-form"
onClick={() => {
setAdvancedForm(false);
}}
px={0}
variant="link"
>
back to default
</Button>
</Flex>
) : (
<Button
data-testid="switch-to-custom-debug-bundle-form"
onClick={() => {
setAdvancedForm(true);
}}
variant="link"
>
or create a custom debug bundle
</Button>
)}
</Flex>
</Box>
);
};