-
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
Collect traffic levels #271
base: main
Are you sure you want to change the base?
Conversation
95d00a6
to
8b467c7
Compare
sourceIdentity, err := r.resolveIPToIdentity(ctx, report.SrcIP) | ||
|
||
if err != nil { | ||
logrus.WithError(err).Errorf("Could not resolve source IP %s to identity", report.SrcIP) |
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.
use logrus.WithField for templated fields:
logrus.WithError(err).Errorf("Could not resolve source IP %s to identity", report.SrcIP) | |
logrus.WithError(err).WithFields("srcIP", report.SrcIP).Error("Could not resolve source IP to identity") |
destinationIdentity, err := r.resolveIPToIdentity(ctx, report.DstIP) | ||
|
||
if err != nil { | ||
logrus.WithError(err).Errorf("Could not resolve destination IP %s to identity", report.DstIP) |
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.
same here
@@ -314,6 +315,33 @@ func (r *Resolver) handleAzureOperationReport(ctx context.Context, operation mod | |||
return nil | |||
} | |||
|
|||
func (r *Resolver) handleTrafficLevelReport(ctx context.Context, results model.TrafficLevelResults) error { |
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.
unfortunately, resolving source and dest pods just by trying to search for the IP in kubefinder is not that reliable, due to annoying things like IP reuse or host-network pods. Please follow the flow performed by handleTCPCaptureResult
to correctly resolve the local and remote identities, taking all edge cases into consideration.
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.
The code in handleTCPCaptureResult also doesn't work well with traffic info, since it makes assumptions on the direction of traffic. Specifically, that traffic is always from a pod to a service, which is not true in our case. I'm not sure what's the best way to handle this generally, but I hesitate to modify the code used by handleTCPCaptureResult so to not break existing features.
Description
Aggregate data collected by the Otterize node-agent, using the traffic levels eBPF programs. This data includes the number of bytes, and number of connections between the services. The mapper then calculates a moving average, and reports it to the cloud.
Checklist