-
Notifications
You must be signed in to change notification settings - Fork 24
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
conntrack: Configurable timeouts #357
Conversation
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## main #357 +/- ##
==========================================
- Coverage 61.91% 60.91% -1.00%
==========================================
Files 91 91
Lines 5873 6177 +304
==========================================
+ Hits 3636 3763 +127
- Misses 2016 2192 +176
- Partials 221 222 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
a462f5d
to
8c37ec2
Compare
New image: ["quay.io/netobserv/flowlogs-pipeline:56612e6"]. It will expire after two weeks. |
New image: ["quay.io/netobserv/flowlogs-pipeline:fb0e3bb"]. It will expire after two weeks. |
pkg/api/conntrack.go
Outdated
@@ -83,6 +82,12 @@ type ConnTrackOperationEnum struct { | |||
Max string `yaml:"max" doc:"max"` | |||
} | |||
|
|||
type ConnTrackSchedulingGroup struct { | |||
Selector map[string]string `yaml:"selector,omitempty" doc:"key-value map to match against connection fields to apply this scheduling"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Selector matches only string: string. Is this the intended usage? So we cannot, for instance, select on integer values?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can select integer values. The integer values are converted to string before the comparison.
At first, I used map[string]interface{}
. But then I noticed that setting the selector to Proto: 6
is parsed as int
. The problem is that the grpc ingester parses Proto
as uint32
. Comparing int
and uint32
is evaluated to false regardless of the values. That's why I convert and compare strings.
return outputRecords | ||
} | ||
|
||
// TBD: think of how to avoid confusion with the word "update". It is used with periodic connections updates and for update a connection with incoming flow logs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a suggestion, you could use the terminology of "heartbeats" to refer to the periodic updates on long connections?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this idea! thanks @jotak :)
New image: . It will expire after two weeks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, nice PR!
I tired to improve
|
(and sorry for the delay!) |
Some of the grpc ingester fields are of type uint32. The yaml/json parser parses numeric values as int32. So, comparing uint32 to int32 where both static types are interface{} will always evaluate to false regardless of the actual values. Hence, we convert and compare strings.
827678c
to
6a0f65b
Compare
This PR allows configuring different timeouts for connections based on their key fields.
Implementation: Instead of using a single Multi-Order Map in the connection store for all the connections, the connection store will have a Multi-Order Map for each scheduling group. In addition, the store has a new
hashId2groupIdx
map that given a connection hash ID, finds the Multi-Order Map of the connection.Other changes:
conntrack_memory_connections
operational metric. This allows monitoring the number of active connections per scheduling group.