Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename metrics #135

Merged
merged 1 commit into from
Jan 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 26 additions & 15 deletions pkg/networkpolicy/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,40 +16,51 @@ import (

var (
packetProcessingHist = prometheus.NewHistogramVec(prometheus.HistogramOpts{
Name: "packet_process_time",
Help: "Time it has taken to process each packet (microseconds)",
Buckets: []float64{1, 10, 50, 200, 500, 750, 1000, 2000, 5000, 10000, 100000},
Namespace: "kube_network_policies",
Name: "packet_process_time",
Help: "Time it has taken to process each packet (microseconds)",
Buckets: []float64{1, 10, 50, 200, 500, 750, 1000, 2000, 5000, 10000, 100000},
}, []string{"protocol", "family"})

packetProcessingSum = prometheus.NewSummary(prometheus.SummaryOpts{
Name: "packet_process_duration_microseconds",
Help: "A summary of the packet processing durations in microseconds.",
Namespace: "kube_network_policies",
Name: "packet_process_duration_microseconds",
Help: "A summary of the packet processing durations in microseconds.",
Objectives: map[float64]float64{
0.5: 0.05, // 50th percentile with a max. absolute error of 0.05.
0.9: 0.01, // 90th percentile with a max. absolute error of 0.01.
0.99: 0.001, // 99th percentile with a max. absolute error of 0.001.
},
})

packetCounterVec = prometheus.NewCounterVec(prometheus.CounterOpts{
Name: "packet_count",
Help: "Number of packets",
Namespace: "kube_network_policies",
Name: "packet_count",
Help: "Number of packets",
}, []string{"protocol", "family", "verdict"})

nfqueueQueueTotal = prometheus.NewGaugeVec(prometheus.GaugeOpts{
Name: "nfqueue_queue_total",
Help: "The number of packets currently queued and waiting to be processed by the application",
Namespace: "kube_network_policies",
Name: "nfqueue_queue_total",
Help: "The number of packets currently queued and waiting to be processed by the application",
}, []string{"queue"})

nfqueueQueueDropped = prometheus.NewGaugeVec(prometheus.GaugeOpts{
Name: "nfqueue_queue_dropped",
Help: "Number of packets that had to be dropped by the kernel because too many packets are already waiting for user space to send back the mandatory accept/drop verdicts",
Namespace: "kube_network_policies",
Name: "nfqueue_queue_dropped",
Help: "Number of packets that had to be dropped by the kernel because too many packets are already waiting for user space to send back the mandatory accept/drop verdicts",
}, []string{"queue"})

nfqueueUserDropped = prometheus.NewGaugeVec(prometheus.GaugeOpts{
Name: "nfqueue_user_dropped",
Help: "Number of packets that were dropped within the netlink subsystem. Such drops usually happen when the corresponding socket buffer is full; that is, user space is not able to read messages fast enough",
Namespace: "kube_network_policies",
Name: "nfqueue_user_dropped",
Help: "Number of packets that were dropped within the netlink subsystem. Such drops usually happen when the corresponding socket buffer is full; that is, user space is not able to read messages fast enough",
}, []string{"queue"})

nfqueuePacketID = prometheus.NewGaugeVec(prometheus.GaugeOpts{
Name: "nfqueue_packet_id",
Help: "ID of the most recent packet queued.",
Namespace: "kube_network_policies",
Name: "nfqueue_packet_id",
Help: "ID of the most recent packet queued.",
}, []string{"queue"})
)

Expand Down
Loading