aws / aws-network-policy-agent

Apache License 2.0
45 stars 29 forks source link

[Draft]adding drop bytes and drop packets count metric #316

Open yash97 opened 1 month ago

yash97 commented 1 month ago

Issue #, if available:

solves #229 Description of changes: his PR enhances the network policy agent by adding packet length and direction information to policy events. These additions enable the export of more detailed metrics, specifically:

  1. Packet drop counts with direction
  2. Packet drop bytes with direction

Sample Output of metrics:

 curl localhost:61680/metrics

# HELP network_policy_drop_bytes_total Total number of bytes dropped by network policy agent
# TYPE network_policy_drop_bytes_total counter
network_policy_drop_bytes_total{direction="ingress"} 1.0665324e+07
# HELP network_policy_drop_count_total Total number of packets dropped by network policy agent
# TYPE network_policy_drop_count_total counter
network_policy_drop_count_total{direction="ingress"} 144126

Important Notes

These metrics will only be measured if the --enable-policy-event-logs flag is set to true.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.