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

hubble: Support --{last,since,until} on agent and debug events #14739

Conversation

gandro
Copy link
Member

@gandro gandro commented Jan 26, 2021

This PR ensures that the Number, Until and Since filters on
the GetFlowsRequest are treated the same on agent and debug events as
they are on flow events.

Previously, the observer API would only stop reading from the ring
buffer once it had collected enough flows. All interleaved debug and
agent events were returned without proper accounting (assuming they were
allows by the event type filter). This meant that if a request was only
requesting agent and/or debug events, that it would try to dump all such
events in the ring buffer.

The first commit in this PR is a simple refactor renaming flowsReader to eventsReader.
It should not contain any functional changes.

@gandro gandro added release-note/misc This PR makes changes that have no direct user impact. sig/hubble Impacts hubble server or relay labels Jan 26, 2021
@gandro gandro requested a review from a team January 26, 2021 17:20
@maintainer-s-little-helper maintainer-s-little-helper bot added this to In progress in 1.10.0 Jan 26, 2021
@gandro gandro requested a review from glibsm January 26, 2021 17:20
Copy link
Member

@rolinh rolinh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good but see question/comment about when to increment r.eventCount.

pkg/hubble/observer/local_observer.go Outdated Show resolved Hide resolved
pkg/hubble/observer/local_observer.go Show resolved Hide resolved
With the introduction of agent and debug events, this reader, while
implementing the GetFlows API, actually now returns events which are
different from flows. This commit renames the involved types and
variables to reflect that.

This commit contains no functional changes.

Signed-off-by: Sebastian Wicki <sebastian@isovalent.com>
@gandro gandro force-pushed the pr/gandro/hubble-fix-non-flows-request-collection branch from 741ddd7 to a8c28ce Compare January 26, 2021 17:43
Copy link
Member

@tklauser tklauser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nit on the PR description/commit message:

This PR ensures that the Number, Until and Since filters on
the GetFlowsRequest are treated the same on agent and flow events as
they are on flow events.

I assume this should say "...the GetFlowsRequest are treated the same on agent and debug events as they are on flow events."?

This commit ensures that the `Number`, `Until` and `Since` filters on
the `GetFlowsRequest` are treated the same on agent and debug events as
they are on flow events.

Previously, the observer API would only stop reading from the ring
buffer once it had collected enough flows. All interleaved debug and
agent events were returned without proper accounting (assuming they were
allows by the event type filter). This meant that if a request was only
requesting agent and/or debug events, that it would try to dump all such
events in the ring buffer.

Signed-off-by: Sebastian Wicki <sebastian@isovalent.com>
@gandro gandro force-pushed the pr/gandro/hubble-fix-non-flows-request-collection branch from a8c28ce to 44a05f5 Compare January 27, 2021 15:28
@gandro
Copy link
Member Author

gandro commented Jan 28, 2021

test-me-please

@gandro
Copy link
Member Author

gandro commented Jan 28, 2021

GKE failed to scale cluster https://jenkins.cilium.io/job/Cilium-PR-K8s-GKE/4146/

retest-gke

@gandro
Copy link
Member Author

gandro commented Jan 28, 2021

retest-runtime

@gandro
Copy link
Member Author

gandro commented Jan 28, 2021

retest-4.9

@tklauser tklauser merged commit 482a639 into cilium:master Feb 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note/misc This PR makes changes that have no direct user impact. sig/hubble Impacts hubble server or relay
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants