chore: test to prod#116
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
* fix: fix for garbage data and host mapping * fix: add trace in alert label * fix: made ParseHTTPRequest http request one time * build(deps): bump golang.org/x/net from 0.33.0 to 0.36.0 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> * chore: fix updated go.mod (#109) * build(deps): bump github.com/docker/docker (#111) 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> * build(deps): bump github.com/Azure/azure-sdk-for-go/sdk/azidentity (#63) 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> * build(deps): bump github.com/containerd/containerd from 1.6.26 to 1.6.38 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> * build(deps): bump github.com/golang-jwt/jwt/v5 from 5.2.1 to 5.2.2 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> * fix: fix for invalid src workload * fix: fix for src_workload_kind labels --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Shiv <3078106+blue4209211@users.noreply.github.com> Co-authored-by: Raman Kumar <raman.kharche@nudgebee.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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 focuses on enhancing the observability and accuracy of workload attribution within the Coroot node agent. It introduces a new function to resolve pod owners, improves external host identification, and refactors L7 metrics to include trace IDs. Additionally, it updates dependencies to newer versions.
Highlights
- Workload Attribution: A new
ResolvePodOwnerfunction is added toip_resolver.goto accurately determine the workload owning a pod, enhancing workload attribution. - External Host Identification: The container now identifies external hosts by parsing the HTTP request payload when the destination workload is external, improving the accuracy of service mapping.
- L7 Metrics Enhancement: L7 metrics are refactored to include trace IDs, enabling better correlation of metrics with distributed traces.
- Dependency Updates: The
go.modandgo.sumfiles are updated to use newer versions of dependencies, includingcontainerd,docker,golang.org/x/net,golang.org/x/sys, and others, ensuring compatibility and incorporating the latest features and fixes. - Payload Handling: The eBPF tracer now handles L7 request payloads more robustly by adjusting sizes and copying data to prevent garbage data from reused buffers.
Changelog
Click here to see the changelog
- common/ip_resolver.go
- Modified
getControllerOfOwnerto directly return the owner. - Added
ResolvePodOwnerfunction to resolve the workload owner of a pod.
- Modified
- containers/container.go
- Modified container creation to resolve and log the pod owner.
- Updated
NewContainerto use the resolved workload fromip_resolver. - Enhanced
onL7Requestto identify external hosts and include trace IDs in L7 metrics.
- containers/l7.go
- Modified
L7Stats.getto include trace ID as a label for L7 metrics. - Removed redundant host parsing logic for external workloads.
- Modified
- containers/registry.go
- Added
ResolvePodOwnerto theIPResolverinterface.
- Added
- ebpftracer/tracer.go
- Improved L7 request payload handling by adjusting sizes and copying data.
- go.mod
- Updated Go version to 1.23.0 and added toolchain go1.24.1
- Updated dependencies including
containerd,docker,golang.org/x/net,golang.org/x/sys, and others.
- go.sum
- Updated checksums for the modified and updated dependencies.
- tracing/tracing.go
- Added
ExtractTraceIdfunction to extract trace IDs from HTTP headers. - Modified
HttpRequestto useExtractTraceIdand pass the trace ID tocreateSpan.
- 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 'go' command in Go automatically fetches, builds, and installs dependencies, making dependency management straightforward.
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 related to IP resolution, container metadata, and L7 tracing. The addition of ResolvePodOwner to the IPResolver interface and its implementation in K8sIPResolver seems beneficial for resolving pod owners. The changes in container.go to resolve pod ownership and log the information are also relevant. The updates to ebpftracer/tracer.go to handle payload sizes and copy data are important for data integrity. Overall, the changes appear to enhance the functionality and robustness of the system. However, there are some areas that could be improved, particularly around error handling and logging.
Summary of Findings
- Missing Error Handling: In
common/ip_resolver.go, theResolvePodOwnerfunction does not log the error when failing to get pod information, which can make debugging difficult. - Potential nil pointer dereference: In
containers/container.go, theheadersvariable can be nil, leading to a potential nil pointer dereference when callingtrace.ExtractTraceId(headers). - Inconsistent logging: In
containers/container.go, the logging format in theResolvePodOwnerfunction could be improved for better readability and consistency. - Inefficient string conversion: In
containers/container.go, convertingr.Payloadto a string multiple times can be inefficient. It's better to convert it once and reuse the string.
Merge Readiness
The pull request introduces valuable features and improvements, but there are a few issues that should be addressed before merging. Specifically, the missing error handling in common/ip_resolver.go and the potential nil pointer dereference in containers/container.go should be fixed. Addressing these issues will improve the robustness and maintainability of the code. I am unable to approve this pull request, and recommend that others review and approve this code before merging. At a minimum, the high severity issues should be addressed before merging.
|
Warning You have reached your daily quota limit. As a reminder, free tier users are limited to 5 requests per day. Please wait up to 24 hours and I will start processing your requests again! |
4 similar comments
|
Warning You have reached your daily quota limit. As a reminder, free tier users are limited to 5 requests per day. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning You have reached your daily quota limit. As a reminder, free tier users are limited to 5 requests per day. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning You have reached your daily quota limit. As a reminder, free tier users are limited to 5 requests per day. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning You have reached your daily quota limit. As a reminder, free tier users are limited to 5 requests per day. Please wait up to 24 hours and I will start processing your requests again! |
No description provided.