chore: master to test#115
Conversation
fix: fix for garbage data and host mapping
fix: add trace in alert label
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.33.0 to 0.36.0. - [Commits](golang/net@v0.33.0...v0.36.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
…g/x/net-0.36.0 build(deps): bump golang.org/x/net from 0.33.0 to 0.36.0
Bumps [github.com/docker/docker](https://github.com/docker/docker) from 25.0.3+incompatible to 25.0.6+incompatible. - [Release notes](https://github.com/docker/docker/releases) - [Commits](moby/moby@v25.0.3...v25.0.6) --- updated-dependencies: - dependency-name: github.com/docker/docker dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [github.com/Azure/azure-sdk-for-go/sdk/azidentity](https://github.com/Azure/azure-sdk-for-go) from 1.5.1 to 1.6.0. - [Release notes](https://github.com/Azure/azure-sdk-for-go/releases) - [Changelog](https://github.com/Azure/azure-sdk-for-go/blob/main/documentation/release.md) - [Commits](Azure/azure-sdk-for-go@sdk/internal/v1.5.1...sdk/azcore/v1.6.0) --- updated-dependencies: - dependency-name: github.com/Azure/azure-sdk-for-go/sdk/azidentity dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [github.com/containerd/containerd](https://github.com/containerd/containerd) from 1.6.26 to 1.6.38. - [Release notes](https://github.com/containerd/containerd/releases) - [Changelog](https://github.com/containerd/containerd/blob/main/RELEASES.md) - [Commits](containerd/containerd@v1.6.26...v1.6.38) --- updated-dependencies: - dependency-name: github.com/containerd/containerd dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [github.com/golang-jwt/jwt/v5](https://github.com/golang-jwt/jwt) from 5.2.1 to 5.2.2. - [Release notes](https://github.com/golang-jwt/jwt/releases) - [Changelog](https://github.com/golang-jwt/jwt/blob/main/VERSION_HISTORY.md) - [Commits](golang-jwt/jwt@v5.2.1...v5.2.2) --- updated-dependencies: - dependency-name: github.com/golang-jwt/jwt/v5 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com>
…m/golang-jwt/jwt/v5-5.2.2 build(deps): bump github.com/golang-jwt/jwt/v5 from 5.2.1 to 5.2.2
…m/containerd/containerd-1.6.38 build(deps): bump github.com/containerd/containerd from 1.6.26 to 1.6.38
fix: fix for invalid src workload
There was a problem hiding this comment.
Hello @mayankpande88, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
Summary of Changes
This pull request appears to be a synchronization from the master branch to the test branch, as indicated by the title. The changes include modifications to common/ip_resolver.go, containers/container.go, containers/l7.go, containers/registry.go, ebpftracer/tracer.go, go.mod, and tracing/tracing.go. The most significant changes involve resolving pod owners, enhancing L7 metrics with trace IDs, and improving payload handling in the eBPF tracer.
Highlights
- IP Resolver Enhancement: A new function
ResolvePodOwneris added tocommon/ip_resolver.goto resolve the owner of a pod, and thegetControllerOfOwnerfunction is modified to directly return the owner. - Container Metadata Enrichment: The
NewContainerfunction incontainers/container.gois updated to resolve the source workload of a container using theResolvePodOwnerfunction and log the pod's owner information. - L7 Metrics Enhancement: The
L7Statsstruct incontainers/l7.gois updated to include trace IDs in L7 metrics, and logic is added to extract the host from HTTP requests when the destination namespace is external. - eBPF Tracer Payload Handling: The
runEventsReaderfunction inebpftracer/tracer.gois modified to improve payload handling by checking payload sizes and safely copying payload and response data. - Tracing Headers: The
tracing/tracing.gofile is updated to extract trace IDs from HTTP headers. - Dependency Updates: The
go.modandgo.sumfiles are updated to reflect changes in dependencies, includingcontainerd,docker,golang.org/x/net,golang.org/x/sys, and other indirect dependencies.
Changelog
Click here to see the changelog
- common/ip_resolver.go
- Modified
getControllerOfOwnerto directly return the owner. - Added
ResolvePodOwnerfunction to resolve the owner of a pod.
- Modified
- containers/container.go
- Modified container ID splitting to extract namespace and pod name.
- Added logic to resolve and log pod owner information.
- Updated
NewContainerto use resolved workload as source workload.
- containers/l7.go
- Modified
L7Stats.getto include trace ID. - Added logic to extract host from HTTP requests for external destinations.
- Modified
- containers/registry.go
- Added
ResolvePodOwnerto theIPResolverinterface.
- Added
- ebpftracer/tracer.go
- Improved payload handling in
runEventsReaderby checking payload sizes and safely copying data.
- Improved payload handling in
- go.mod
- Updated Go version to 1.23.0 and added toolchain go1.24.1.
- Updated dependencies, including
containerdanddocker.
- go.sum
- Updated checksums for various dependencies.
- tracing/tracing.go
- Added
ExtractTraceIdfunction to extract trace IDs from HTTP headers. - Modified
HttpRequestto useExtractTraceId.
- Added
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Did you know?
The eBPF technology, heavily used in this project, allows sandboxed programs to run in the Linux kernel without changing kernel source code.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Code Review
The pull request introduces several changes to improve the observability and workload resolution capabilities of the node agent. It includes enhancements to L7 tracing, pod owner resolution, and dependency updates. The changes seem well-structured, but some areas could benefit from additional clarity and error handling.
Summary of Findings
- Potential nil pointer dereference: In
tracing/tracing.go, theheadersvariable might be nil when callingt.ExtractTraceId(headers), which could lead to a nil pointer dereference. Adding a nil check before calling the method would improve the code's robustness. - Error handling in
ResolvePodOwner: TheResolvePodOwnerfunction incommon/ip_resolver.goreturns a defaultWorkloadstruct when an error occurs while fetching the pod. It might be better to return the error to allow the caller to handle the failure explicitly. - Inconsistent namespace extraction: The
NewContainerfunction incontainers/container.goextracts the namespace from the container ID string. The indices used to extract the namespace and pod name are different in the before and after versions of the code. Ensure that the correct indices are used to extract the namespace and pod name. - Logging external host: In
containers/container.go, the external host is logged usinglog.Printf. Consider usingklog.Infoffor consistency with other logging statements in the codebase.
Merge Readiness
The pull request introduces valuable improvements, but addressing the potential nil pointer dereference and error handling issues is crucial before merging. I am unable to approve this pull request, and recommend that another reviewer also reviews this code before merging. At a minimum, the critical and high severity issues should be addressed before merging.
No description provided.