-
Notifications
You must be signed in to change notification settings - Fork 434
feat: support APM Java Agent inject #2242
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for APM (Application Performance Monitoring) Java Agent injection functionality to the system. The implementation includes downloading, installing, and managing APM agents for Java applications, along with comprehensive test coverage.
- Adds APM agent injection capabilities with support for downloading and installing Java agents
- Implements package management for APM agents including archive extraction and version management
- Introduces task pipeline framework for managing APM injection configurations
Reviewed Changes
Copilot reviewed 32 out of 33 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| core/apm/.h, core/apm/.cpp | Core APM functionality including types, package manager, attach manager, and injection runner |
| core/plugin/input/InputApmAgentInject.* | APM agent injection task implementation |
| core/task_pipeline/* | Task pipeline framework for managing APM configurations |
| core/common/ArchiveHelper.* | Archive extraction utility for agent packages |
| core/unittest/apm/* | Comprehensive unit tests for APM functionality |
| core/unittest/common/* | Unit tests for archive helper and HTTP download functionality |
| core/dependencies.cmake, core/common/links.cmake | Build system changes to link libarchive |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
This pull request introduces a new Application Performance Monitoring (APM) agent injection feature to the codebase, primarily for Linux builds. The changes include the addition of several new files and classes that manage the lifecycle of APM agents, including their installation, configuration, and removal. The new functionality is encapsulated in the
apmdirectory and is integrated into the build system.New APM agent injection system:
apmdirectory is added to the list of subdirectories in the Linux build configuration (core/CMakeLists.txt), enabling compilation and inclusion of the new APM-related components.Core APM agent management classes:
ApmInjectRunner(ApmInjectRunner.cpp,ApmInjectRunner.h), a singleton class responsible for initializing, scheduling, injecting, and removing APM agents. It manages agent lifecycle, retry logic, and periodic update checks via a timer event. [1] [2]AttachManager(AttachManager.cpp,AttachManager.h), which handles writing and removing agent runtime configuration files for target processes, as well as checking agent attachment status. [1] [2]PackageManager(PackageManager.h), which manages downloading, installing, updating, and removing agent packages and exec hooks required for agent injection.These changes lay the foundation for automated APM agent management, including installation, configuration, update scheduling, and cleanup, supporting future monitoring and instrumentation features.
这个拉取请求为代码库引入了一个新的应用性能监控(APM)代理注入功能,主要面向Linux构建。变更包括添加了几个新文件和类,用于管理APM代理的生命周期,包括它们的安装、配置和移除。新功能封装在
apm目录中,并集成到构建系统中。新的APM代理注入系统:
core/CMakeLists.txt)的子目录列表中添加了apm目录,支持编译和包含新的APM相关组件。核心APM代理管理类:
ApmInjectRunner(ApmInjectRunner.cpp、ApmInjectRunner.h),这是一个单例类,负责初始化、调度、注入和移除APM代理。它管理代理生命周期、重试逻辑,并通过定时器事件执行定期更新检查。AttachManager(AttachManager.cpp、AttachManager.h),用于处理目标进程的代理运行时配置文件的写入和移除,以及检查代理附加状态。PackageManager(PackageManager.h),用于管理代理包和代理注入所需的执行钩子的下载、安装、更新和移除。这些变更为自动化APM代理管理奠定了基础,包括安装、配置、更新调度和清理,支持未来的监控和仪表化功能。