chore: main to test#198
Conversation
Moved regex compilations in `ebpftracer/tls.go` to package-level variables. Previously, `regexp.MustCompile` was called every time `getSslLibPathAndVersion` was executed (scanning process maps), which is expensive. This change compiles the regexes once at startup, reducing CPU overhead and allocations. Impact: - Eliminates regex compilation overhead (parsing + compilation) for each call. - Reduces memory allocations during process scanning.
…-15837461305579583930 ⚡ Bolt: Optimize regex compilation in TLS tracer
* fix: fix for unexpected token error * fix: resolve concurrent map access crash in updateDelays and handle systemd services - Fix concurrent map read/write crash in updateDelays by using proper locking: - Get PIDs snapshot under read lock - Make syscalls without holding lock to avoid contention - Update delays under write lock - Fix "unexpected container id" errors for systemd services: - Only resolve pod owner for k8s containers (/k8s/ or /k8s-cronjob/ prefixes) - Use container name as workload for non-k8s containers - Skip systemd services that match IGNORE_CONTROL_PLANE list in calcId Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: reduce l7_events log spam and increase perf buffer - Increase l7_events perf buffer from 64 to 128 pages per CPU to reduce lost samples - Add rate-limited logging for lost samples (aggregate and log every 10s instead of per-event) - Include CPU info in lost samples log for better debugging The duplicate log lines (4x) were caused by per-CPU lost sample records being logged separately. Now they are aggregated and logged periodically. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: prevent duplicate klog output Initialize klog flags properly to prevent duplicate log output. The issue was that klog was outputting to both the custom writer and stderr by default. Setting logtostderr=false, alsologtostderr=false, and stderrthreshold=FATAL ensures only the custom output is used. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: use klog.ErrorS to prevent duplicate log output Replace klog.Errorf with klog.ErrorS for lost samples logging. klog.Errorf logs to ERROR, WARNING, and INFO levels causing 3x duplicates. klog.ErrorS uses structured logging and only logs once at the ERROR level. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * fix: use standard log.Printf to prevent duplicate output Replace klog.ErrorS with log.Printf for lost samples logging. Both klog.Errorf and klog.ErrorS output to multiple severity levels (ERROR, WARNING, INFO) by design, causing 3x duplicates. The standard log package writes once to the configured output (our RateLimitedLogOutput) without duplication. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * fix: protect activeConnections map iteration in Collect Add read lock when iterating over activeConnections map in the Collect function to prevent concurrent map iteration and map write errors during Prometheus metric collection. The race condition occurs when: - Prometheus calls Collect() which iterates over activeConnections - Concurrently, connection events modify activeConnections Error: fatal error: concurrent map iteration and map write at containers/container.go:455 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * fix: add panic recovery to ClickHouse parser Prevent agent crashes when receiving malformed or incomplete ClickHouse protocol packets by adding defer/recover pattern to ParseClickhouse. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Replaced make([]byte) with stack-allocated arrays for IP and port buffers. Used hex.Decode directly into stack buffers. This eliminates heap allocations in the hot path of parsing /proc/net/tcp. Benchmarks: IPv4: 88ns -> 38ns (-57%) IPv6: 160ns -> 67ns (-58%) Allocs: 1 -> 0 (-100%) Co-authored-by: blue4209211 <3078106+blue4209211@users.noreply.github.com>
…nfrastructure - Strict HTTP/2 detection requiring HEADERS frame with HPACK static table match - DNS protocol ordering fix to prevent DNS/HTTP/2 misclassification - HPACK fault tolerance for mid-stream HTTP/2 connection monitoring - HTTP/2 CONTINUATION frame support and per-fd parser isolation - LLM provider detection (OpenAI, Anthropic, Google Gemini, AWS Bedrock, Azure OpenAI) - Request/response payload structure analysis for provider identification - OTel GenAI semantic convention metrics (container_llm_*) - DNS cache lookup at L7 request time for hostname resolution - eBPF verifier-safe pointer arithmetic for frame scanning - Various protocol detection, memory optimization, and stability fixes
…nfrastructure (#180) - Strict HTTP/2 detection requiring HEADERS frame with HPACK static table match - DNS protocol ordering fix to prevent DNS/HTTP/2 misclassification - HPACK fault tolerance for mid-stream HTTP/2 connection monitoring - HTTP/2 CONTINUATION frame support and per-fd parser isolation - LLM provider detection (OpenAI, Anthropic, Google Gemini, AWS Bedrock, Azure OpenAI) - Request/response payload structure analysis for provider identification - OTel GenAI semantic convention metrics (container_llm_*) - DNS cache lookup at L7 request time for hostname resolution - eBPF verifier-safe pointer arithmetic for frame scanning - Various protocol detection, memory optimization, and stability fixes
Bumps [github.com/opencontainers/selinux](https://github.com/opencontainers/selinux) from 1.11.0 to 1.13.0. - [Release notes](https://github.com/opencontainers/selinux/releases) - [Commits](opencontainers/selinux@v1.11.0...v1.13.0) --- updated-dependencies: - dependency-name: github.com/opencontainers/selinux dependency-version: 1.13.0 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com>
…12884711624083843 ⚡ Bolt: Optimize decodeAddr in proc/net to zero allocations
…m/opencontainers/selinux-1.13.0 chore(deps): bump github.com/opencontainers/selinux from 1.11.0 to 1.13.0
…8163120042195743 ⚡ Bolt: Optimize eBPF event parsing by replacing binary.Read
Summary of ChangesHello @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! This pull request introduces a significant enhancement to the agent's observability capabilities by adding comprehensive support for Large Language Model (LLM) API tracing and metrics. It enables detailed monitoring of LLM interactions, including streaming responses, by leveraging advanced eBPF techniques for Go TLS and HTTP/2 traffic. The changes ensure more reliable data collection and provide deeper insights into LLM performance and usage patterns. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe 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 by creating a comment using either
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 Limitations & Feedback Gemini Code Assist 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. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. 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. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a substantial set of enhancements focused on improving LLM and gRPC observability, along with significant architectural and performance improvements. The changes are extensive and well-executed, greatly increasing the agent's capabilities and robustness.
Key improvements include:
- Enhanced LLM & gRPC Tracing: A new streaming LLM tracker has been added to monitor responses using Server-Sent Events (SSE), and the agent now adheres to OpenTelemetry's GenAI semantic conventions for metrics and traces.
- Robust Go TLS Probing: The mechanism for tracing Go applications has been completely overhauled. It now uses dynamic offset discovery (via DWARF, itab, and BTF) to make probes resilient to different Go and kernel versions. Fallback paths have been added in eBPF to handle cases where standard TCP connection tracking fails, which is common in Go applications using goroutines.
- eBPF Modernization: The L7 event handling has been migrated from perf buffers to a more modern ring buffer, which guarantees event ordering and improves performance. The HTTP/2 frame parsing logic in eBPF has also been made significantly more compliant and strict to prevent false positives.
- Concurrency and Performance: Several potential race conditions in the metrics collection code have been resolved by implementing proper locking. Additionally, performance has been improved in hot paths by reducing lock contention and eliminating heap allocations.
Overall, this is an excellent update that demonstrates a deep understanding of eBPF and observability challenges in modern applications. The code is well-refactored and the new features are thoughtfully implemented.
No description provided.