Skip to content

Commit

Permalink
Increase counter and log when cant observe interface
Browse files Browse the repository at this point in the history
  • Loading branch information
jotak committed Dec 18, 2024
1 parent 52341d4 commit f2a7a94
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 4 deletions.
3 changes: 3 additions & 0 deletions bpf/flows.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ static inline void add_observed_intf(additional_metrics *value, u32 if_index, u8
value->observed_intf[value->nb_observed_intf].if_index = if_index;
value->observed_intf[value->nb_observed_intf].direction = direction;
value->nb_observed_intf++;
} else {
increase_counter(OBSERVED_INTF_MISSED);
BPF_PRINTK("observed interface missed (array capacity reached) for ifindex %d\n", if_index);
}
}

Expand Down
1 change: 1 addition & 0 deletions bpf/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ typedef enum global_counters_key_t {
NETWORK_EVENTS_ERR_GROUPID_MISMATCH,
NETWORK_EVENTS_ERR_UPDATE_MAP_FLOWS,
NETWORK_EVENTS_GOOD,
OBSERVED_INTF_MISSED,
MAX_COUNTERS,
} global_counters_key;

Expand Down
3 changes: 2 additions & 1 deletion pkg/ebpf/bpf_arm64_bpfel.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified pkg/ebpf/bpf_arm64_bpfel.o
Binary file not shown.
3 changes: 2 additions & 1 deletion pkg/ebpf/bpf_powerpc_bpfel.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified pkg/ebpf/bpf_powerpc_bpfel.o
Binary file not shown.
3 changes: 2 additions & 1 deletion pkg/ebpf/bpf_s390_bpfeb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified pkg/ebpf/bpf_s390_bpfeb.o
Binary file not shown.
3 changes: 2 additions & 1 deletion pkg/ebpf/bpf_x86_bpfel.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified pkg/ebpf/bpf_x86_bpfel.o
Binary file not shown.
1 change: 1 addition & 0 deletions pkg/tracer/tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -915,6 +915,7 @@ func (m *FlowFetcher) ReadGlobalCounter(met *metrics.Metrics) {
ebpf.BpfGlobalCountersKeyTNETWORK_EVENTS_ERR_GROUPID_MISMATCH: met.NetworkEventsCounter.WithSourceAndReason("network-events", "NetworkEventsErrorsGroupIDMismatch"),
ebpf.BpfGlobalCountersKeyTNETWORK_EVENTS_ERR_UPDATE_MAP_FLOWS: met.NetworkEventsCounter.WithSourceAndReason("network-events", "NetworkEventsErrorsFlowMapUpdate"),
ebpf.BpfGlobalCountersKeyTNETWORK_EVENTS_GOOD: met.NetworkEventsCounter.WithSourceAndReason("network-events", "NetworkEventsGoodEvent"),
ebpf.BpfGlobalCountersKeyTOBSERVED_INTF_MISSED: met.Errors.WithErrorName("flow-fetcher", "MaxObservedInterfacesReached"),
}
zeroCounters := make([]uint32, cilium.MustPossibleCPU())
for key := ebpf.BpfGlobalCountersKeyT(0); key < ebpf.BpfGlobalCountersKeyTMAX_COUNTERS; key++ {
Expand Down

0 comments on commit f2a7a94

Please sign in to comment.