Skip to content

Commit c57e3ec

Browse files
committed
update config and manage drop columns
1 parent afbfefb commit c57e3ec

File tree

4 files changed

+68
-7
lines changed

4 files changed

+68
-7
lines changed

config/sample-config.yaml

Lines changed: 42 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ frontend:
4545
# - endConnection
4646
features:
4747
# eBPF agent features
48-
# - pktDrop
49-
# - dnsTracking
50-
# - flowRTT
48+
- pktDrop
49+
- dnsTracking
50+
- flowRTT
5151
# processor features
52-
# - multiCluster
53-
# - zones
52+
- multiCluster
53+
- zones
5454
portNaming:
5555
enable: true
5656
portNames:
@@ -588,6 +588,7 @@ frontend:
588588
- id: Bytes
589589
name: Bytes
590590
tooltip: The total aggregated number of bytes.
591+
field: Bytes
591592
fields:
592593
- Bytes
593594
- PktDropBytes
@@ -596,6 +597,7 @@ frontend:
596597
- id: Packets
597598
name: Packets
598599
tooltip: The total aggregated number of packets.
600+
field: Packets
599601
fields:
600602
- Packets
601603
- PktDropPackets
@@ -621,6 +623,41 @@ frontend:
621623
calculated: substract(column.CollectionTime,TimeFlowEndMs)
622624
default: false
623625
width: 5
626+
- id: PktDropBytes
627+
name: Dropped Bytes
628+
tooltip: The total aggregated number of bytes dropped.
629+
field: PktDropBytes
630+
default: false
631+
width: 5
632+
feature: pktDrop
633+
- id: PktDropPackets
634+
name: Dropped Packets
635+
tooltip: The total aggregated number of packets dropped.
636+
field: PktDropPackets
637+
default: false
638+
width: 5
639+
feature: pktDrop
640+
- id: PktDropLatestState
641+
name: Drop State
642+
tooltip: TCP state on last dropped packet.
643+
field: PktDropLatestState
644+
default: false
645+
width: 10
646+
feature: pktDrop
647+
- id: PktDropLatestDropCause
648+
name: Drop Cause
649+
tooltip: TCP state on last dropped packet.
650+
field: PktDropLatestDropCause
651+
default: false
652+
width: 10
653+
feature: pktDrop
654+
- id: PktDropLatestFlags
655+
name: Drop Flags
656+
tooltip: TCP flags on last dropped packet.
657+
field: PktDropLatestFlags
658+
default: false
659+
width: 10
660+
feature: pktDrop
624661
- id: DNSId
625662
group: DNS
626663
name: DNS Id

web/src/components/drawer/record/record-field.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,8 @@ export const RecordField: React.FC<RecordFieldProps> = ({
471471
}
472472
return singleContainer(child);
473473
}
474-
case ColumnsId.tcpflags: {
474+
case ColumnsId.tcpflags:
475+
case ColumnsId.dropflags: {
475476
let child = emptyText();
476477
if (typeof value === 'number' && !isNaN(value)) {
477478
const flags = decomposeTCPFlagsBitfield(value);
@@ -619,6 +620,16 @@ export const RecordField: React.FC<RecordFieldProps> = ({
619620
simpleTextWithTooltip(detailed ? `${String(value)} ${c.name.toLowerCase()} ${t('sent')}` : String(value))
620621
);
621622
}
623+
case ColumnsId.dropbytes:
624+
case ColumnsId.droppackets:
625+
const droppedText = t('dropped');
626+
const droppedCount = String(value);
627+
return singleContainer(
628+
simpleTextWithTooltip(
629+
detailed ? `${droppedCount} ${c.name.toLowerCase()} ${droppedText}` : droppedCount,
630+
isDark ? '#C9190B' : '#A30000'
631+
)
632+
);
622633
case ColumnsId.dnsid: {
623634
return singleContainer(
624635
typeof value === 'number' && !isNaN(value) ? simpleTextWithTooltip(String(value)) : emptyDnsErrorText()

web/src/components/drawer/record/record-panel.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,15 @@ export const RecordPanel: React.FC<RecordDrawerProps> = ({
7979

8080
// hide empty columns
8181
const getVisibleColumns = React.useCallback(() => {
82-
const forbiddenColumns = [ColumnsId.ifdirs, ColumnsId.interfaces];
82+
const forbiddenColumns = [
83+
ColumnsId.ifdirs,
84+
ColumnsId.interfaces,
85+
ColumnsId.dropbytes,
86+
ColumnsId.droppackets,
87+
ColumnsId.dropstate,
88+
ColumnsId.dropcause,
89+
ColumnsId.dropflags
90+
];
8391
return columns.filter((c: Column) => {
8492
const value = c.value(record);
8593
return !forbiddenColumns.includes(c.id) && value !== null && value !== '' && !Number.isNaN(value);

web/src/utils/columns.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ export enum ColumnsId {
4545
tcpflags = 'TCPFlags',
4646
bytes = 'Bytes',
4747
packets = 'Packets',
48+
dropbytes = 'PktDropBytes',
49+
droppackets = 'PktDropPackets',
50+
dropstate = 'PktDropLatestState',
51+
dropcause = 'PktDropLatestDropCause',
52+
dropflags = 'PktDropLatestFlags',
4853
owner = 'K8S_OwnerName',
4954
srcowner = 'SrcK8S_OwnerName',
5055
dstowner = 'DstK8S_OwnerName',

0 commit comments

Comments
 (0)