Skip to content

Conversation

devodev
Copy link
Contributor

@devodev devodev commented Oct 28, 2024

Continuation of #35206

  • Introduce a new hubble-exporters cell that provides the static and dynamic exporters using observer Options.
  • The static exporter now uses the context received from OnDecodedEvent instead of embedding one at construct time.
  • Add OnExportEvent hook system to the exporter to provide extension capabilities.
  • Allow providing a custom writer to exporters.
  • Allow providing a custom encoder to exporters.

Related: #35514

@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Oct 28, 2024
@github-actions github-actions bot added the kind/community-contribution This was a contribution made by a community member. label Oct 28, 2024
@devodev devodev force-pushed the pr/devodev/hubble-logging-cell branch 3 times, most recently from e817568 to e11af17 Compare November 4, 2024 22:16
@kaworu kaworu added kind/cleanup This includes no functional changes. area/misc Impacts miscellaneous areas of the code not otherwise owned by another area. release-note/misc This PR makes changes that have no direct user impact. sig/hubble labels Nov 5, 2024
@maintainer-s-little-helper maintainer-s-little-helper bot removed dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. labels Nov 5, 2024
@kaworu kaworu self-requested a review November 5, 2024 16:18
@devodev devodev force-pushed the pr/devodev/hubble-logging-cell branch 2 times, most recently from e5b6738 to ccbdf7a Compare November 7, 2024 22:41
@devodev devodev marked this pull request as ready for review November 7, 2024 23:24
@devodev devodev requested a review from a team as a code owner November 7, 2024 23:24
@kaworu kaworu requested a review from chancez November 8, 2024 08:00
Copy link
Member

@kaworu kaworu left a comment

Choose a reason for hiding this comment

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

Nice work @devodev 👍

Some comments and questions inline. Also I noticed that in exporter.Stop() we're closing the writer, which can be setup with os.Stdout and I don't think we're supposed to close stdout. Not to be addressed in this PR, but something to look into. cc @chancez whom I added as a reviewer as well since he has context about export.

@devodev
Copy link
Contributor Author

devodev commented Nov 8, 2024

Nice work @devodev 👍

Some comments and questions inline. Also I noticed that in exporter.Stop() we're closing the writer, which can be setup with os.Stdout and I don't think we're supposed to close stdout. Not to be addressed in this PR, but something to look into. cc @chancez whom I added as a reviewer as well since he has context about export.

Looked into it, and it seems we use a noopWriteCloser to avoid calling Close on the underlying writer.

@chancez
Copy link
Contributor

chancez commented Nov 8, 2024

Looked into it, and it seems we use a noopWriteCloser to avoid calling Close on the underlying writer.

Yep, there was previously a bug where we were closing os.Stdout that I fixed in a49276f.

@devodev devodev force-pushed the pr/devodev/hubble-logging-cell branch 3 times, most recently from b76d39d to 81255ab Compare November 8, 2024 21:34
Copy link
Contributor

@glrf glrf left a comment

Choose a reason for hiding this comment

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

Nice work 🚀

Signed-off-by: Alexandre Barone <abalexandrebarone@gmail.com>
@devodev devodev force-pushed the pr/devodev/hubble-logging-cell branch from 8c317f7 to 2f7a251 Compare November 18, 2024 15:05
@michi-covalent michi-covalent requested review from a team, pippolo84 and bimmlerd and removed request for a team November 18, 2024 22:04
@michi-covalent
Copy link
Contributor

/test

@bimmlerd bimmlerd removed their request for review November 19, 2024 13:40
@michi-covalent
Copy link
Contributor

@kaworu ping 🏓

Copy link
Member

@pippolo84 pippolo84 left a comment

Choose a reason for hiding this comment

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

Focused my review on the newly added cells and the usage of the "hive and cells" framework. LGTM, thanks! 💯

Copy link
Member

@kaworu kaworu left a comment

Choose a reason for hiding this comment

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

Awesome work @devodev 👏 !

@michi-covalent michi-covalent added this pull request to the merge queue Nov 20, 2024
@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Nov 20, 2024
Merged via the queue into cilium:main with commit ef23827 Nov 20, 2024
70 checks passed
devodev added a commit to devodev/cilium that referenced this pull request Jan 24, 2025
Hubble export allow/deny list parsing regressed in cilium#35596
when moving export to a hive cell due to how hive cells handle flags.StringSlices.
Similar to cilium#35619.

Redefine the flag as a string and parse it ourselves to avoid going through the
implicit hive decoder hooks that convert strings to slices by splitting on comma.

Also added tests for the hubble.ParseFlowFilters helper to make it clear which
formats we support and which we don't.

Signed-off-by: Alexandre Barone <abalexandrebarone@gmail.com>
devodev added a commit to devodev/cilium that referenced this pull request Jan 24, 2025
Hubble export allow/deny list parsing regressed in cilium#35596
when moving export to a hive cell due to how hive cells handle flags.StringSlices.
Similar to cilium#35619.

Redefine the flag as a string to avoid going through the implicit hive decoder hooks
that convert strings to slices by splitting on comma. Update hubble.ParseFlowFilters
to take in a string and decode all filters until EOF.

Also added tests for the hubble.ParseFlowFilters helper to make it clear which
formats we support and which we don't.

Signed-off-by: Alexandre Barone <abalexandrebarone@gmail.com>
devodev added a commit to devodev/cilium that referenced this pull request Jan 24, 2025
Hubble export allow/deny list parsing regressed in cilium#35596
when moving export to a hive cell due to how hive cells handle flags.StringSlices.
Similar to cilium#35619.

Redefine the flag as a string to avoid going through the implicit hive decoder hooks
that convert strings to slices by splitting on comma. Update hubble.ParseFlowFilters
to take in a string and decode all filters until EOF.

Also added tests for the hubble.ParseFlowFilters helper to make it clear which
formats we support and which we don't.

Signed-off-by: Alexandre Barone <abalexandrebarone@gmail.com>
devodev added a commit to devodev/cilium that referenced this pull request Jan 24, 2025
Hubble export allow/deny list parsing regressed in cilium#35596
when moving export to a hive cell due to how hive cells handle flags.StringSlices.
Similar to cilium#35619.

Redefine the flag as a string to avoid going through the implicit hive decoder hooks
that convert strings to slices by splitting on comma. Update hubble.ParseFlowFilters
to take in a string and decode all filters until EOF.

Also added tests for the hubble.ParseFlowFilters helper to make it clear which
formats we support and which we don't.

Signed-off-by: Alexandre Barone <abalexandrebarone@gmail.com>
github-merge-queue bot pushed a commit that referenced this pull request Jan 28, 2025
Hubble export allow/deny list parsing regressed in #35596
when moving export to a hive cell due to how hive cells handle flags.StringSlices.
Similar to #35619.

Redefine the flag as a string to avoid going through the implicit hive decoder hooks
that convert strings to slices by splitting on comma. Update hubble.ParseFlowFilters
to take in a string and decode all filters until EOF.

Also added tests for the hubble.ParseFlowFilters helper to make it clear which
formats we support and which we don't.

Signed-off-by: Alexandre Barone <abalexandrebarone@gmail.com>
giorio94 pushed a commit that referenced this pull request Jan 31, 2025
[ upstream commit cb3341b ]

Hubble export allow/deny list parsing regressed in #35596
when moving export to a hive cell due to how hive cells handle flags.StringSlices.
Similar to #35619.

Redefine the flag as a string to avoid going through the implicit hive decoder hooks
that convert strings to slices by splitting on comma. Update hubble.ParseFlowFilters
to take in a string and decode all filters until EOF.

Also added tests for the hubble.ParseFlowFilters helper to make it clear which
formats we support and which we don't.

Signed-off-by: Alexandre Barone <abalexandrebarone@gmail.com>
Signed-off-by: Marco Iorio <marco.iorio@isovalent.com>
github-merge-queue bot pushed a commit that referenced this pull request Jan 31, 2025
[ upstream commit cb3341b ]

Hubble export allow/deny list parsing regressed in #35596
when moving export to a hive cell due to how hive cells handle flags.StringSlices.
Similar to #35619.

Redefine the flag as a string to avoid going through the implicit hive decoder hooks
that convert strings to slices by splitting on comma. Update hubble.ParseFlowFilters
to take in a string and decode all filters until EOF.

Also added tests for the hubble.ParseFlowFilters helper to make it clear which
formats we support and which we don't.

Signed-off-by: Alexandre Barone <abalexandrebarone@gmail.com>
Signed-off-by: Marco Iorio <marco.iorio@isovalent.com>
jongj pushed a commit to jongj/cilium that referenced this pull request Feb 11, 2025
Hubble export allow/deny list parsing regressed in cilium#35596
when moving export to a hive cell due to how hive cells handle flags.StringSlices.
Similar to cilium#35619.

Redefine the flag as a string to avoid going through the implicit hive decoder hooks
that convert strings to slices by splitting on comma. Update hubble.ParseFlowFilters
to take in a string and decode all filters until EOF.

Also added tests for the hubble.ParseFlowFilters helper to make it clear which
formats we support and which we don't.

Signed-off-by: Alexandre Barone <abalexandrebarone@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/misc Impacts miscellaneous areas of the code not otherwise owned by another area. kind/cleanup This includes no functional changes. kind/community-contribution This was a contribution made by a community member. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/misc This PR makes changes that have no direct user impact.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants