You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "wu-sheng (via GitHub)" <gi...@apache.org> on 2023/04/24 08:36:17 UTC

[GitHub] [skywalking-go] wu-sheng commented on a diff in pull request #13: Setup Documentations

wu-sheng commented on code in PR #13:
URL: https://github.com/apache/skywalking-go/pull/13#discussion_r1174884127


##########
docs/en/setup/gobuild.md:
##########
@@ -0,0 +1,40 @@
+# Setup in build
+
+When you want to integrate the Agent using the original go build command, you need to follow these steps.
+
+## Install SkyWalking Go
+
+Use go get to import the `skywalking-go` program. 
+
+```shell
+go get github.com/apache/skywalking-go
+```
+
+Also, import the module to your main package: 
+
+```go
+import _ "github.com/apache/skywalking-go"
+```
+
+## Build the project
+When building the project, you need to download the Golang enhancement program first:
+
+```shell
+go install github.com/apache/skywalking-go/tools/go-agent
+```
+
+When using go build, add the following parameters:
+
+```shell
+-toolexec="/path/to/go-agent" -a
+```
+
+1. `-toolexec` is the path to the Golang enhancement program.
+2. `-a` is the parameter to force rebuild all packages.

Review Comment:
   ```suggestion
   2. `-a` is the parameter for rebuilding all packages forcibly.
   ```



##########
docs/en/setup/gobuild.md:
##########
@@ -0,0 +1,40 @@
+# Setup in build
+
+When you want to integrate the Agent using the original go build command, you need to follow these steps.
+
+## Install SkyWalking Go
+
+Use go get to import the `skywalking-go` program. 

Review Comment:
   ```suggestion
   Use `go get` to import the `skywalking-go` program. 
   ```



##########
docs/en/advanced-features/settings-override.md:
##########
@@ -0,0 +1,20 @@
+# Setting Override
+
+By default, SkyWalking Go provides a default [agent.default.yaml](../../../tools/go-agent/config/agent.default.yaml) to define the default configuration options.
+
+This configuration file is used **during hybrid compilation to write the configuration information of the Agent into the program**. 
+When the program starts, agent would read the pre-configured content.

Review Comment:
   ```suggestion
   When the program boots, the agent would read the pre-configured content.
   ```



##########
docs/en/menu.yml:
##########
@@ -0,0 +1,51 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+catalog:
+    - name: Concepts and Designs
+      catalog:
+        - name: Introduction
+          path: /en/concepts-and-designs/introduction
+        - name: Design
+          catalog:
+            - name: Hybrid Compilation
+              path: /en/concepts-and-designs/hybird-compilcation
+            - name: Key Principles
+              path: /en/concepts-and-designs/key-principles
+            - name: Project Structure
+              path: /en/concepts-and-designs/project-structure
+    - name: Setup
+      catalog:
+        - name: Setup in Build
+          path: /en/setup/gobuild
+    - name: Advanced Features
+      catalog:

Review Comment:
   I think we need another advanced feature, `Logging Setup`.



##########
docs/en/concepts-and-designs/hybird-compilcation.md:
##########
@@ -0,0 +1,49 @@
+# Hybrid Compilation
+
+Hybrid compilation technology is the base of SkyWalking Go's implementation. 
+
+It utilizes the `-toolexec` flag during Golang compilation to introduce custom programs that intercept all original files in the compilation stage. 
+This allows for the modification or addition of files to be completed seamlessly.
+
+## Toolchain in Golang
+
+The `-toolexec` flag in Golang is a powerful feature that can be used during stages such as `build`, `test`, and others. 
+When this flag is used, developers can provide a custom program or script to replace the default go tools functionality. 
+This offers greater flexibility and control over the build, test, or analysis processes.
+
+When passing this flag during a `go build`, it can intercept the execution flow of commands such as `compile`, `asm`, and `link`, 
+which are required during Golang's compilation process. These commands are also referred to as the `toolchain` within Golang.
+
+### Information about the Toolchain
+
+The following command demonstrates the parameter information for the specified `-toolexec` program when it is invoked:
+
+```shell
+/usr/bin/skywalking-go /usr/local/opt/go/libexec/pkg/tool/darwin_amd64/compile -o /var/folders/wz/s5m922z15vz4fjhf5l4458xm0000gn/T/go-build452071603/b011/_pkg_.a -trimpath /var/folders/wz/s5m922z15vz4fjhf5l4458xm0000gn/T/go-build452071603/b011=> -p runtime -std -+ -buildid zSeDyjJh0lgXlIqBZScI/zSeDyjJh0lgXlIqBZScI -goversion go1.19.2 -symabis /var/folders/wz/s5m922z15vz4fjhf5l4458xm0000gn/T/go-build452071603/b011/symabis -c=4 -nolocalimports -importcfg /var/folders/wz/s5m922z15vz4fjhf5l4458xm0000gn/T/go-build452071603/b011/importcfg -pack -asmhdr /var/folders/wz/s5m922z15vz4fjhf5l4458xm0000gn/T/go-build452071603/b011/go_asm.h /usr/local/opt/go/libexec/src/runtime/alg.go /usr/local/opt/go/libexec/src/runtime/asan0.go ...
+```
+
+The code above demonstrates the parameters used when a custom program is executed, which mainly includes the following information:
+
+1. **Current toolchain tool**: In this example, it is a compilation tool with the path: `/usr/local/opt/go/libexec/pkg/tool/darwin_amd64/compile`.
+2. **Target file of the tool**: The final target file that the current tool needs to generate. 
+3. **Package information**: The module package path information being compiled, which is the parameter value of the `-p` flag. The current package path is `runtime`.
+4. **Temporary directory address**: For each compilation, the Go program would generate a corresponding temporary directory. This directory contains all the temporary files required for the compilation. 
+5. **Files to be compiled**: Many `.go` file paths can be seen at the end of the command, which are the file path list of the module that needs to be compiled.
+
+## Toolchain with SkyWalking Go Agent
+
+SkyWalking Go Agent works by intercepting the `compile` program in the toolchain and making changes to the program based on the information above. The main parts include:

Review Comment:
   ```suggestion
   SkyWalking Go Agent works by intercepting the `compile` program through the toolchain and making changes to the program based on the information above. The main parts include:
   ```



##########
docs/en/concepts-and-designs/hybird-compilcation.md:
##########
@@ -0,0 +1,49 @@
+# Hybrid Compilation
+
+Hybrid compilation technology is the base of SkyWalking Go's implementation. 
+
+It utilizes the `-toolexec` flag during Golang compilation to introduce custom programs that intercept all original files in the compilation stage. 
+This allows for the modification or addition of files to be completed seamlessly.
+
+## Toolchain in Golang
+
+The `-toolexec` flag in Golang is a powerful feature that can be used during stages such as `build`, `test`, and others. 
+When this flag is used, developers can provide a custom program or script to replace the default go tools functionality. 
+This offers greater flexibility and control over the build, test, or analysis processes.
+
+When passing this flag during a `go build`, it can intercept the execution flow of commands such as `compile`, `asm`, and `link`, 
+which are required during Golang's compilation process. These commands are also referred to as the `toolchain` within Golang.
+
+### Information about the Toolchain
+
+The following command demonstrates the parameter information for the specified `-toolexec` program when it is invoked:
+
+```shell
+/usr/bin/skywalking-go /usr/local/opt/go/libexec/pkg/tool/darwin_amd64/compile -o /var/folders/wz/s5m922z15vz4fjhf5l4458xm0000gn/T/go-build452071603/b011/_pkg_.a -trimpath /var/folders/wz/s5m922z15vz4fjhf5l4458xm0000gn/T/go-build452071603/b011=> -p runtime -std -+ -buildid zSeDyjJh0lgXlIqBZScI/zSeDyjJh0lgXlIqBZScI -goversion go1.19.2 -symabis /var/folders/wz/s5m922z15vz4fjhf5l4458xm0000gn/T/go-build452071603/b011/symabis -c=4 -nolocalimports -importcfg /var/folders/wz/s5m922z15vz4fjhf5l4458xm0000gn/T/go-build452071603/b011/importcfg -pack -asmhdr /var/folders/wz/s5m922z15vz4fjhf5l4458xm0000gn/T/go-build452071603/b011/go_asm.h /usr/local/opt/go/libexec/src/runtime/alg.go /usr/local/opt/go/libexec/src/runtime/asan0.go ...
+```
+
+The code above demonstrates the parameters used when a custom program is executed, which mainly includes the following information:
+
+1. **Current toolchain tool**: In this example, it is a compilation tool with the path: `/usr/local/opt/go/libexec/pkg/tool/darwin_amd64/compile`.
+2. **Target file of the tool**: The final target file that the current tool needs to generate. 
+3. **Package information**: The module package path information being compiled, which is the parameter value of the `-p` flag. The current package path is `runtime`.
+4. **Temporary directory address**: For each compilation, the Go program would generate a corresponding temporary directory. This directory contains all the temporary files required for the compilation. 
+5. **Files to be compiled**: Many `.go` file paths can be seen at the end of the command, which are the file path list of the module that needs to be compiled.
+
+## Toolchain with SkyWalking Go Agent
+
+SkyWalking Go Agent works by intercepting the `compile` program in the toolchain and making changes to the program based on the information above. The main parts include:
+
+1. **AST**: Using `AST` to parse or modify files which ready for compiled.
+2. **File copying/generation**: Copy or generate files to the temporary directory required for the compilation, and add file path addresses when the compilation command is executed.
+3. **Proxy command execution**: After completing the modification of the specified package, the command execution in the toolchain will be proxied.

Review Comment:
   What do you mean `will be proxied`? Is that a term of `the new codes are weaved into the target`?



##########
docs/en/concepts-and-designs/key-principles.md:
##########
@@ -0,0 +1,174 @@
+# Key Principle
+
+Enhancing applications in hybrid compilation is very important for SkyWalking Go Agent. 
+In this section, I will delve deeper into several key technical points.
+
+## Method Interceptor
+
+Method interception is particularly important in SkyWalking Go, as it enables the creation of plugins. In SkyWalking Go, method interception mainly involves the following key points:
+
+1. **Finding Method**: Using `AST` to find method information in the target code to be enhanced.
+2. **Modifying Methods**: Enhancing the specified methods and embedding interceptor code.
+3. **Saving and Compiling**: Updating the modified files in the compilation arguments.
+
+### Finding Method
+
+When looking for methods, the SkyWalking Go Agent need to search according to the provided compilation arguments, which mainly include the following two parts:
+
+1. **Package information**: Based on the package name provided by the arguments, the Agent can find the specific plugin.
+2 **Go files**: When a matching plugin is found, Agent can read the `.go` files and use `AST` to parse the method information contained in these files. When the method information matches the method information required by the plugin for interception, Agent can consider the method found.

Review Comment:
   ```suggestion
   2 **Go files**: When a matching plugin is found, the Agent reads the `.go` files and uses `AST` to parse the method information from these source files. When the method information matches the method information required by the plugin for the interception, the agent would consider the method found.
   ```



##########
docs/en/concepts-and-designs/key-principles.md:
##########
@@ -0,0 +1,174 @@
+# Key Principle
+
+Enhancing applications in hybrid compilation is very important for SkyWalking Go Agent. 
+In this section, I will delve deeper into several key technical points.
+
+## Method Interceptor
+
+Method interception is particularly important in SkyWalking Go, as it enables the creation of plugins. In SkyWalking Go, method interception mainly involves the following key points:
+
+1. **Finding Method**: Using `AST` to find method information in the target code to be enhanced.
+2. **Modifying Methods**: Enhancing the specified methods and embedding interceptor code.
+3. **Saving and Compiling**: Updating the modified files in the compilation arguments.
+
+### Finding Method
+
+When looking for methods, the SkyWalking Go Agent need to search according to the provided compilation arguments, which mainly include the following two parts:
+
+1. **Package information**: Based on the package name provided by the arguments, the Agent can find the specific plugin.
+2 **Go files**: When a matching plugin is found, Agent can read the `.go` files and use `AST` to parse the method information contained in these files. When the method information matches the method information required by the plugin for interception, Agent can consider the method found.
+
+### Modifying Methods
+
+After finding the method, the SkyWalking Go Agent needs to modify the method implication and embed the interceptor code.
+
+#### Change Method Body
+
+When intercepting a method, the first thing to do is to modify the method and [embed the template code](../../../tools/go-agent/instrument/plugins/templates/method_inserts.tmpl). 
+This code segment includes two method executions:
+
+1. **Before method execution**: Pass in the current method's arguments, instances, and other information.
+2. **After method execution**: Using the `defer` method, intercept the result parameters after the code execution is completed.
+
+Based on these two methods, the agent can intercept before and after method execution. 
+
+In order not to affect the line of code execution, this code segment will only be executed in the **same line as the first statement in the method**. 
+This ensures that when an exception occurs in the framework code execution, the exact location can still be found without being affected by the enhanced code.
+
+#### Write Adapter File
+
+After the agent enhances the method body, it needs to implement the above two methods and write them into a single file, called the **adapter file**. These two methods will do the following:
+
+1. **Before method execution**: [Build by the template](../../../tools/go-agent/instrument/plugins/templates/method_intercept_before.tmpl). Build the context for before and after interception, and pass the parameter information during execution to the interceptor in each plugin.
+2. **After method execution**: [Build by the template](../../../tools/go-agent/instrument/plugins/templates/method_intercept_after.tmpl). Pass the method return value to the interceptor and execute the method.
+
+#### Copy Files
+
+After completing the adapter file, the agent would perform the following copy operations:
+
+1. **Plugin Code**: Copy the Go files containing the interceptors in the plugin to the same level directory as the current framework.
+2. **Plugin Development API Code**: Copy the operation APIs needed by the interceptors in the plugin to the same level directory as the current framework, such as `tracing`.
+
+After copying the files, they cannot be immediately added to the compilation parameters, because they may have the same name as the existing framework code. Therefore, we need to perform some rewriting operations, which include the following parts:
+
+1. **Types**: Rename created structures, interfaces, methods, and other types by adding a unified prefix.
+2. **Static Methods**: Add a prefix to non-instance methods. Static methods do not need to be rewritten since they have already been processed in the types.
+3. **Variables**: Add a prefix to global variables. It's not necessary to add a prefix to variables inside methods because they can ensure no conflicts would arise and are helpful for debugging.

Review Comment:
   Could we use an intercepting case as an example? About how they are changed?



##########
docs/en/concepts-and-designs/key-principles.md:
##########
@@ -0,0 +1,174 @@
+# Key Principle
+
+Enhancing applications in hybrid compilation is very important for SkyWalking Go Agent. 
+In this section, I will delve deeper into several key technical points.
+
+## Method Interceptor
+
+Method interception is particularly important in SkyWalking Go, as it enables the creation of plugins. In SkyWalking Go, method interception mainly involves the following key points:
+
+1. **Finding Method**: Using `AST` to find method information in the target code to be enhanced.
+2. **Modifying Methods**: Enhancing the specified methods and embedding interceptor code.
+3. **Saving and Compiling**: Updating the modified files in the compilation arguments.
+
+### Finding Method
+
+When looking for methods, the SkyWalking Go Agent need to search according to the provided compilation arguments, which mainly include the following two parts:
+
+1. **Package information**: Based on the package name provided by the arguments, the Agent can find the specific plugin.
+2 **Go files**: When a matching plugin is found, Agent can read the `.go` files and use `AST` to parse the method information contained in these files. When the method information matches the method information required by the plugin for interception, Agent can consider the method found.
+
+### Modifying Methods
+
+After finding the method, the SkyWalking Go Agent needs to modify the method implication and embed the interceptor code.
+
+#### Change Method Body
+
+When intercepting a method, the first thing to do is to modify the method and [embed the template code](../../../tools/go-agent/instrument/plugins/templates/method_inserts.tmpl). 
+This code segment includes two method executions:
+
+1. **Before method execution**: Pass in the current method's arguments, instances, and other information.
+2. **After method execution**: Using the `defer` method, intercept the result parameters after the code execution is completed.
+
+Based on these two methods, the agent can intercept before and after method execution. 
+
+In order not to affect the line of code execution, this code segment will only be executed in the **same line as the first statement in the method**. 
+This ensures that when an exception occurs in the framework code execution, the exact location can still be found without being affected by the enhanced code.
+
+#### Write Adapter File
+
+After the agent enhances the method body, it needs to implement the above two methods and write them into a single file, called the **adapter file**. These two methods will do the following:
+
+1. **Before method execution**: [Build by the template](../../../tools/go-agent/instrument/plugins/templates/method_intercept_before.tmpl). Build the context for before and after interception, and pass the parameter information during execution to the interceptor in each plugin.
+2. **After method execution**: [Build by the template](../../../tools/go-agent/instrument/plugins/templates/method_intercept_after.tmpl). Pass the method return value to the interceptor and execute the method.
+
+#### Copy Files
+
+After completing the adapter file, the agent would perform the following copy operations:
+
+1. **Plugin Code**: Copy the Go files containing the interceptors in the plugin to the same level directory as the current framework.
+2. **Plugin Development API Code**: Copy the operation APIs needed by the interceptors in the plugin to the same level directory as the current framework, such as `tracing`.
+
+After copying the files, they cannot be immediately added to the compilation parameters, because they may have the same name as the existing framework code. Therefore, we need to perform some rewriting operations, which include the following parts:
+
+1. **Types**: Rename created structures, interfaces, methods, and other types by adding a unified prefix.
+2. **Static Methods**: Add a prefix to non-instance methods. Static methods do not need to be rewritten since they have already been processed in the types.
+3. **Variables**: Add a prefix to global variables. It's not necessary to add a prefix to variables inside methods because they can ensure no conflicts would arise and are helpful for debugging.
+
+### Saving and Compiling
+
+After the above steps are completed, the agent needs to save the modified files and add them to the compilation parameters.
+
+At this point, when the framework executes the enhanced method, it can have the following capabilities:
+
+1. **Execute Plugin Code**: Custom code can be embedded before and after the method execution, and real-time parameter information can be obtained.
+2. **Operate Agent**: By calling the Agent API, interaction with the Agent Core can be achieved, enabling functions such as distributed tracing.
+
+## Propagation context
+
+In Golang programs, we use `context.Context` to achieve data exchange between methods and goroutines. 
+However, if the framework or environment does not provide `context.Context` for propagation, or it is not required as a parameter when used, it would result in the inability to pass information. 
+Therefore, we need to consider a method to pass data using **non-**`context.Context` objects to keep the entire distributed tracing chain complete.
+
+### Context Propagation between Methods
+
+In the agent, it would enhance the `g` structure in the `runtime` package. 
+The `g` structure in Golang represents the internal data of the current goroutine. 
+By enhancing this structure and using the `runtime.getg()` method, we can obtain the enhanced data in the current structure in real-time.
+
+Enhancement includes the following steps:
+
+1. **Add Attributes to g**: Add a new field to the `g` struct, and value as `interface{}`.
+2. **Export Methods**: Export methods for real-time setting and getting of custom field values in the current goroutine through `go:linkname`.
+3. **Import methods**: In the Agent Core, import the setting and getting methods for custom fields.
+
+After completing the above steps, the agent can get or set data of the same goroutine in any method within the same goroutine, similar to Java's `Thread Local`.

Review Comment:
   ```suggestion
   Through these, the agent has a shared context in any place within the same goroutine, similar to Java's `Thread Local`.
   ```



##########
docs/en/concepts-and-designs/key-principles.md:
##########
@@ -0,0 +1,174 @@
+# Key Principle
+
+Enhancing applications in hybrid compilation is very important for SkyWalking Go Agent. 
+In this section, I will delve deeper into several key technical points.
+
+## Method Interceptor
+
+Method interception is particularly important in SkyWalking Go, as it enables the creation of plugins. In SkyWalking Go, method interception mainly involves the following key points:
+
+1. **Finding Method**: Using `AST` to find method information in the target code to be enhanced.
+2. **Modifying Methods**: Enhancing the specified methods and embedding interceptor code.
+3. **Saving and Compiling**: Updating the modified files in the compilation arguments.
+
+### Finding Method
+
+When looking for methods, the SkyWalking Go Agent need to search according to the provided compilation arguments, which mainly include the following two parts:
+
+1. **Package information**: Based on the package name provided by the arguments, the Agent can find the specific plugin.
+2 **Go files**: When a matching plugin is found, Agent can read the `.go` files and use `AST` to parse the method information contained in these files. When the method information matches the method information required by the plugin for interception, Agent can consider the method found.
+
+### Modifying Methods
+
+After finding the method, the SkyWalking Go Agent needs to modify the method implication and embed the interceptor code.
+
+#### Change Method Body
+
+When intercepting a method, the first thing to do is to modify the method and [embed the template code](../../../tools/go-agent/instrument/plugins/templates/method_inserts.tmpl). 
+This code segment includes two method executions:
+
+1. **Before method execution**: Pass in the current method's arguments, instances, and other information.
+2. **After method execution**: Using the `defer` method, intercept the result parameters after the code execution is completed.
+
+Based on these two methods, the agent can intercept before and after method execution. 
+
+In order not to affect the line of code execution, this code segment will only be executed in the **same line as the first statement in the method**. 
+This ensures that when an exception occurs in the framework code execution, the exact location can still be found without being affected by the enhanced code.
+
+#### Write Adapter File
+
+After the agent enhances the method body, it needs to implement the above two methods and write them into a single file, called the **adapter file**. These two methods will do the following:
+
+1. **Before method execution**: [Build by the template](../../../tools/go-agent/instrument/plugins/templates/method_intercept_before.tmpl). Build the context for before and after interception, and pass the parameter information during execution to the interceptor in each plugin.
+2. **After method execution**: [Build by the template](../../../tools/go-agent/instrument/plugins/templates/method_intercept_after.tmpl). Pass the method return value to the interceptor and execute the method.
+
+#### Copy Files
+
+After completing the adapter file, the agent would perform the following copy operations:
+
+1. **Plugin Code**: Copy the Go files containing the interceptors in the plugin to the same level directory as the current framework.
+2. **Plugin Development API Code**: Copy the operation APIs needed by the interceptors in the plugin to the same level directory as the current framework, such as `tracing`.
+
+After copying the files, they cannot be immediately added to the compilation parameters, because they may have the same name as the existing framework code. Therefore, we need to perform some rewriting operations, which include the following parts:
+
+1. **Types**: Rename created structures, interfaces, methods, and other types by adding a unified prefix.
+2. **Static Methods**: Add a prefix to non-instance methods. Static methods do not need to be rewritten since they have already been processed in the types.
+3. **Variables**: Add a prefix to global variables. It's not necessary to add a prefix to variables inside methods because they can ensure no conflicts would arise and are helpful for debugging.
+
+### Saving and Compiling
+
+After the above steps are completed, the agent needs to save the modified files and add them to the compilation parameters.
+
+At this point, when the framework executes the enhanced method, it can have the following capabilities:
+
+1. **Execute Plugin Code**: Custom code can be embedded before and after the method execution, and real-time parameter information can be obtained.
+2. **Operate Agent**: By calling the Agent API, interaction with the Agent Core can be achieved, enabling functions such as distributed tracing.
+
+## Propagation context
+
+In Golang programs, we use `context.Context` to achieve data exchange between methods and goroutines. 
+However, if the framework or environment does not provide `context.Context` for propagation, or it is not required as a parameter when used, it would result in the inability to pass information. 
+Therefore, we need to consider a method to pass data using **non-**`context.Context` objects to keep the entire distributed tracing chain complete.
+
+### Context Propagation between Methods
+
+In the agent, it would enhance the `g` structure in the `runtime` package. 
+The `g` structure in Golang represents the internal data of the current goroutine. 
+By enhancing this structure and using the `runtime.getg()` method, we can obtain the enhanced data in the current structure in real-time.
+
+Enhancement includes the following steps:
+
+1. **Add Attributes to g**: Add a new field to the `g` struct, and value as `interface{}`.
+2. **Export Methods**: Export methods for real-time setting and getting of custom field values in the current goroutine through `go:linkname`.
+3. **Import methods**: In the Agent Core, import the setting and getting methods for custom fields.
+
+After completing the above steps, the agent can get or set data of the same goroutine in any method within the same goroutine, similar to Java's `Thread Local`.
+
+### Context Propagation between Goroutines
+
+For cross-goroutine situations, since different goroutines have different `g` objects, 
+the agent cannot access data from one goroutine in another goroutine. 

Review Comment:
   ```suggestion
   Besides using `g` object as the in-goroutine context propagation, SkyWalking builds a mechanism 
   to propagate context between Goroutines.
   ```



##########
docs/en/concepts-and-designs/key-principles.md:
##########
@@ -0,0 +1,174 @@
+# Key Principle
+
+Enhancing applications in hybrid compilation is very important for SkyWalking Go Agent. 
+In this section, I will delve deeper into several key technical points.
+
+## Method Interceptor
+
+Method interception is particularly important in SkyWalking Go, as it enables the creation of plugins. In SkyWalking Go, method interception mainly involves the following key points:
+
+1. **Finding Method**: Using `AST` to find method information in the target code to be enhanced.
+2. **Modifying Methods**: Enhancing the specified methods and embedding interceptor code.
+3. **Saving and Compiling**: Updating the modified files in the compilation arguments.
+
+### Finding Method
+
+When looking for methods, the SkyWalking Go Agent need to search according to the provided compilation arguments, which mainly include the following two parts:
+
+1. **Package information**: Based on the package name provided by the arguments, the Agent can find the specific plugin.
+2 **Go files**: When a matching plugin is found, Agent can read the `.go` files and use `AST` to parse the method information contained in these files. When the method information matches the method information required by the plugin for interception, Agent can consider the method found.
+
+### Modifying Methods
+
+After finding the method, the SkyWalking Go Agent needs to modify the method implication and embed the interceptor code.
+
+#### Change Method Body
+
+When intercepting a method, the first thing to do is to modify the method and [embed the template code](../../../tools/go-agent/instrument/plugins/templates/method_inserts.tmpl). 
+This code segment includes two method executions:
+
+1. **Before method execution**: Pass in the current method's arguments, instances, and other information.
+2. **After method execution**: Using the `defer` method, intercept the result parameters after the code execution is completed.
+
+Based on these two methods, the agent can intercept before and after method execution. 
+
+In order not to affect the line of code execution, this code segment will only be executed in the **same line as the first statement in the method**. 
+This ensures that when an exception occurs in the framework code execution, the exact location can still be found without being affected by the enhanced code.
+
+#### Write Adapter File
+
+After the agent enhances the method body, it needs to implement the above two methods and write them into a single file, called the **adapter file**. These two methods will do the following:
+
+1. **Before method execution**: [Build by the template](../../../tools/go-agent/instrument/plugins/templates/method_intercept_before.tmpl). Build the context for before and after interception, and pass the parameter information during execution to the interceptor in each plugin.
+2. **After method execution**: [Build by the template](../../../tools/go-agent/instrument/plugins/templates/method_intercept_after.tmpl). Pass the method return value to the interceptor and execute the method.
+
+#### Copy Files
+
+After completing the adapter file, the agent would perform the following copy operations:
+
+1. **Plugin Code**: Copy the Go files containing the interceptors in the plugin to the same level directory as the current framework.
+2. **Plugin Development API Code**: Copy the operation APIs needed by the interceptors in the plugin to the same level directory as the current framework, such as `tracing`.
+
+After copying the files, they cannot be immediately added to the compilation parameters, because they may have the same name as the existing framework code. Therefore, we need to perform some rewriting operations, which include the following parts:
+
+1. **Types**: Rename created structures, interfaces, methods, and other types by adding a unified prefix.
+2. **Static Methods**: Add a prefix to non-instance methods. Static methods do not need to be rewritten since they have already been processed in the types.
+3. **Variables**: Add a prefix to global variables. It's not necessary to add a prefix to variables inside methods because they can ensure no conflicts would arise and are helpful for debugging.
+
+### Saving and Compiling
+
+After the above steps are completed, the agent needs to save the modified files and add them to the compilation parameters.
+
+At this point, when the framework executes the enhanced method, it can have the following capabilities:
+
+1. **Execute Plugin Code**: Custom code can be embedded before and after the method execution, and real-time parameter information can be obtained.
+2. **Operate Agent**: By calling the Agent API, interaction with the Agent Core can be achieved, enabling functions such as distributed tracing.
+
+## Propagation context
+
+In Golang programs, we use `context.Context` to achieve data exchange between methods and goroutines. 
+However, if the framework or environment does not provide `context.Context` for propagation, or it is not required as a parameter when used, it would result in the inability to pass information. 
+Therefore, we need to consider a method to pass data using **non-**`context.Context` objects to keep the entire distributed tracing chain complete.
+
+### Context Propagation between Methods
+
+In the agent, it would enhance the `g` structure in the `runtime` package. 
+The `g` structure in Golang represents the internal data of the current goroutine. 
+By enhancing this structure and using the `runtime.getg()` method, we can obtain the enhanced data in the current structure in real-time.
+
+Enhancement includes the following steps:
+
+1. **Add Attributes to g**: Add a new field to the `g` struct, and value as `interface{}`.
+2. **Export Methods**: Export methods for real-time setting and getting of custom field values in the current goroutine through `go:linkname`.
+3. **Import methods**: In the Agent Core, import the setting and getting methods for custom fields.
+
+After completing the above steps, the agent can get or set data of the same goroutine in any method within the same goroutine, similar to Java's `Thread Local`.
+
+### Context Propagation between Goroutines
+
+For cross-goroutine situations, since different goroutines have different `g` objects, 
+the agent cannot access data from one goroutine in another goroutine. 
+
+However, when a new goroutine is started on an existing goroutine, the `runtime.newproc1` method is called to create a new goroutine based on the existing one. 
+The current solution used by the Agent is to, after the method execution is finished, use the `defer` command so that the Agent can access both the previous and the new goroutine. 
+At this point, the data in the custom fields is copied. The purpose of copying is to prevent panic caused by the same object being accessed in multiple goroutines.
+
+The specific operation process is as follows:
+
+1. **Write the copy method**: Create a method for copying data from the custom fields.

Review Comment:
   ```suggestion
   1. **Write the copy method**: Create a method for copying data from the previous goroutine.
   ```



##########
docs/en/advanced-features/settings-override.md:
##########
@@ -0,0 +1,20 @@
+# Setting Override
+
+By default, SkyWalking Go provides a default [agent.default.yaml](../../../tools/go-agent/config/agent.default.yaml) to define the default configuration options.
+
+This configuration file is used **during hybrid compilation to write the configuration information of the Agent into the program**. 
+When the program starts, agent would read the pre-configured content.
+
+## Configuration Changes
+
+If you want to modify the default configuration, you can copy the default file and specify it as the file when building.
+
+For missing configuration items in the custom file, the Agent would use the values from the **default configuration**.
+
+## Environment Variables
+
+In the default configuration, you can see that most of the configurations are in the format `${xxx:config_value}`. 
+It means that when the program starts, agent would first read the `xxx` from the **system environment variables**. 

Review Comment:
   ```suggestion
   It means that when the program starts, the agent would first read the `xxx` from the **system environment variables** in the runtime. 
   ```



##########
docs/en/concepts-and-designs/key-principles.md:
##########
@@ -0,0 +1,174 @@
+# Key Principle
+
+Enhancing applications in hybrid compilation is very important for SkyWalking Go Agent. 
+In this section, I will delve deeper into several key technical points.
+
+## Method Interceptor
+
+Method interception is particularly important in SkyWalking Go, as it enables the creation of plugins. In SkyWalking Go, method interception mainly involves the following key points:
+
+1. **Finding Method**: Using `AST` to find method information in the target code to be enhanced.
+2. **Modifying Methods**: Enhancing the specified methods and embedding interceptor code.
+3. **Saving and Compiling**: Updating the modified files in the compilation arguments.
+
+### Finding Method
+
+When looking for methods, the SkyWalking Go Agent need to search according to the provided compilation arguments, which mainly include the following two parts:
+
+1. **Package information**: Based on the package name provided by the arguments, the Agent can find the specific plugin.
+2 **Go files**: When a matching plugin is found, Agent can read the `.go` files and use `AST` to parse the method information contained in these files. When the method information matches the method information required by the plugin for interception, Agent can consider the method found.
+
+### Modifying Methods
+
+After finding the method, the SkyWalking Go Agent needs to modify the method implication and embed the interceptor code.
+
+#### Change Method Body
+
+When intercepting a method, the first thing to do is to modify the method and [embed the template code](../../../tools/go-agent/instrument/plugins/templates/method_inserts.tmpl). 
+This code segment includes two method executions:
+
+1. **Before method execution**: Pass in the current method's arguments, instances, and other information.
+2. **After method execution**: Using the `defer` method, intercept the result parameters after the code execution is completed.
+
+Based on these two methods, the agent can intercept before and after method execution. 
+
+In order not to affect the line of code execution, this code segment will only be executed in the **same line as the first statement in the method**. 
+This ensures that when an exception occurs in the framework code execution, the exact location can still be found without being affected by the enhanced code.
+
+#### Write Adapter File
+
+After the agent enhances the method body, it needs to implement the above two methods and write them into a single file, called the **adapter file**. These two methods will do the following:
+
+1. **Before method execution**: [Build by the template](../../../tools/go-agent/instrument/plugins/templates/method_intercept_before.tmpl). Build the context for before and after interception, and pass the parameter information during execution to the interceptor in each plugin.
+2. **After method execution**: [Build by the template](../../../tools/go-agent/instrument/plugins/templates/method_intercept_after.tmpl). Pass the method return value to the interceptor and execute the method.
+
+#### Copy Files
+
+After completing the adapter file, the agent would perform the following copy operations:
+
+1. **Plugin Code**: Copy the Go files containing the interceptors in the plugin to the same level directory as the current framework.
+2. **Plugin Development API Code**: Copy the operation APIs needed by the interceptors in the plugin to the same level directory as the current framework, such as `tracing`.
+
+After copying the files, they cannot be immediately added to the compilation parameters, because they may have the same name as the existing framework code. Therefore, we need to perform some rewriting operations, which include the following parts:
+
+1. **Types**: Rename created structures, interfaces, methods, and other types by adding a unified prefix.
+2. **Static Methods**: Add a prefix to non-instance methods. Static methods do not need to be rewritten since they have already been processed in the types.
+3. **Variables**: Add a prefix to global variables. It's not necessary to add a prefix to variables inside methods because they can ensure no conflicts would arise and are helpful for debugging.
+
+### Saving and Compiling
+
+After the above steps are completed, the agent needs to save the modified files and add them to the compilation parameters.
+
+At this point, when the framework executes the enhanced method, it can have the following capabilities:
+
+1. **Execute Plugin Code**: Custom code can be embedded before and after the method execution, and real-time parameter information can be obtained.
+2. **Operate Agent**: By calling the Agent API, interaction with the Agent Core can be achieved, enabling functions such as distributed tracing.
+
+## Propagation context
+
+In Golang programs, we use `context.Context` to achieve data exchange between methods and goroutines. 
+However, if the framework or environment does not provide `context.Context` for propagation, or it is not required as a parameter when used, it would result in the inability to pass information. 
+Therefore, we need to consider a method to pass data using **non-**`context.Context` objects to keep the entire distributed tracing chain complete.
+
+### Context Propagation between Methods
+
+In the agent, it would enhance the `g` structure in the `runtime` package. 
+The `g` structure in Golang represents the internal data of the current goroutine. 
+By enhancing this structure and using the `runtime.getg()` method, we can obtain the enhanced data in the current structure in real-time.
+
+Enhancement includes the following steps:
+
+1. **Add Attributes to g**: Add a new field to the `g` struct, and value as `interface{}`.
+2. **Export Methods**: Export methods for real-time setting and getting of custom field values in the current goroutine through `go:linkname`.
+3. **Import methods**: In the Agent Core, import the setting and getting methods for custom fields.
+
+After completing the above steps, the agent can get or set data of the same goroutine in any method within the same goroutine, similar to Java's `Thread Local`.
+
+### Context Propagation between Goroutines
+
+For cross-goroutine situations, since different goroutines have different `g` objects, 
+the agent cannot access data from one goroutine in another goroutine. 
+
+However, when a new goroutine is started on an existing goroutine, the `runtime.newproc1` method is called to create a new goroutine based on the existing one. 
+The current solution used by the Agent is to, after the method execution is finished, use the `defer` command so that the Agent can access both the previous and the new goroutine. 
+At this point, the data in the custom fields is copied. The purpose of copying is to prevent panic caused by the same object being accessed in multiple goroutines.
+
+The specific operation process is as follows:
+
+1. **Write the copy method**: Create a method for copying data from the custom fields.
+2. **Insert code into newproc1**: Insert the `defer` code, intercept the `g` objects before and after the execution, and call the copy method to assign values to the custom fields' data.
+
+## Agent with Dependency
+
+Since SkyWalking Go Agent is based on compile-time enhancement, it cannot introduce third-party modules. 
+For example, when SkyWalking Agent communicates with OAP, it needs to exchange data through the `gRPC` protocol. 
+If the user does not introduce the gRPC module, it cannot be completed.
+
+Due to this problem, users need to introduce relevant modules to complete the basic dependency functions. 

Review Comment:
   ```suggestion
   Due to resolve this problem, users need to introduce relevant modules to complete the basic dependency functions. This is why `import _ "github.com/apache/skywalking-go"` is required.
   ```



##########
tools/go-agent/config/agent.default.yaml:
##########
@@ -18,12 +18,18 @@
 #
 
 agent:
+  # Service name is showed in UI.
   service_name: ${SW_AGENT_NAME:Your_ApplicationName}
+  # To obtain the environment variable key for the instance name, if it cannot be obtained, an instance name will be automatically generated.
   instance_env_name: SW_AGENT_INSTANCE_NAME
+  # The layer of the agent.
   layer: GENERAL

Review Comment:
   Where is the `layer` used? I remember it is set to `GENERAL` by the OAP.



##########
docs/en/menu.yml:
##########
@@ -0,0 +1,51 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+catalog:
+    - name: Concepts and Designs
+      catalog:
+        - name: Introduction
+          path: /en/concepts-and-designs/introduction
+        - name: Design
+          catalog:
+            - name: Hybrid Compilation
+              path: /en/concepts-and-designs/hybird-compilcation
+            - name: Key Principles
+              path: /en/concepts-and-designs/key-principles
+            - name: Project Structure
+              path: /en/concepts-and-designs/project-structure
+    - name: Setup
+      catalog:
+        - name: Setup in Build

Review Comment:
   Is there another kind of `setup`? If not, please remove this level



##########
docs/en/concepts-and-designs/hybird-compilcation.md:
##########
@@ -0,0 +1,49 @@
+# Hybrid Compilation
+
+Hybrid compilation technology is the base of SkyWalking Go's implementation. 
+
+It utilizes the `-toolexec` flag during Golang compilation to introduce custom programs that intercept all original files in the compilation stage. 
+This allows for the modification or addition of files to be completed seamlessly.
+
+## Toolchain in Golang
+
+The `-toolexec` flag in Golang is a powerful feature that can be used during stages such as `build`, `test`, and others. 
+When this flag is used, developers can provide a custom program or script to replace the default go tools functionality. 
+This offers greater flexibility and control over the build, test, or analysis processes.
+
+When passing this flag during a `go build`, it can intercept the execution flow of commands such as `compile`, `asm`, and `link`, 
+which are required during Golang's compilation process. These commands are also referred to as the `toolchain` within Golang.
+
+### Information about the Toolchain
+
+The following command demonstrates the parameter information for the specified `-toolexec` program when it is invoked:
+
+```shell
+/usr/bin/skywalking-go /usr/local/opt/go/libexec/pkg/tool/darwin_amd64/compile -o /var/folders/wz/s5m922z15vz4fjhf5l4458xm0000gn/T/go-build452071603/b011/_pkg_.a -trimpath /var/folders/wz/s5m922z15vz4fjhf5l4458xm0000gn/T/go-build452071603/b011=> -p runtime -std -+ -buildid zSeDyjJh0lgXlIqBZScI/zSeDyjJh0lgXlIqBZScI -goversion go1.19.2 -symabis /var/folders/wz/s5m922z15vz4fjhf5l4458xm0000gn/T/go-build452071603/b011/symabis -c=4 -nolocalimports -importcfg /var/folders/wz/s5m922z15vz4fjhf5l4458xm0000gn/T/go-build452071603/b011/importcfg -pack -asmhdr /var/folders/wz/s5m922z15vz4fjhf5l4458xm0000gn/T/go-build452071603/b011/go_asm.h /usr/local/opt/go/libexec/src/runtime/alg.go /usr/local/opt/go/libexec/src/runtime/asan0.go ...
+```
+
+The code above demonstrates the parameters used when a custom program is executed, which mainly includes the following information:
+
+1. **Current toolchain tool**: In this example, it is a compilation tool with the path: `/usr/local/opt/go/libexec/pkg/tool/darwin_amd64/compile`.
+2. **Target file of the tool**: The final target file that the current tool needs to generate. 
+3. **Package information**: The module package path information being compiled, which is the parameter value of the `-p` flag. The current package path is `runtime`.
+4. **Temporary directory address**: For each compilation, the Go program would generate a corresponding temporary directory. This directory contains all the temporary files required for the compilation. 
+5. **Files to be compiled**: Many `.go` file paths can be seen at the end of the command, which are the file path list of the module that needs to be compiled.
+
+## Toolchain with SkyWalking Go Agent
+
+SkyWalking Go Agent works by intercepting the `compile` program in the toolchain and making changes to the program based on the information above. The main parts include:
+
+1. **AST**: Using `AST` to parse or modify files which ready for compiled.

Review Comment:
   I want to be clear, AST should not be compiled. It is just after the `lexical analysis`. Please recheck with golang doc.



##########
docs/en/advanced-features/settings-override.md:
##########
@@ -0,0 +1,20 @@
+# Setting Override
+
+By default, SkyWalking Go provides a default [agent.default.yaml](../../../tools/go-agent/config/agent.default.yaml) to define the default configuration options.

Review Comment:
   ```suggestion
   By default, SkyWalking Go agent provides a default [agent.default.yaml](../../../tools/go-agent/config/agent.default.yaml) to define the default configuration options.
   ```



##########
docs/en/advanced-features/settings-override.md:
##########
@@ -0,0 +1,20 @@
+# Setting Override
+
+By default, SkyWalking Go provides a default [agent.default.yaml](../../../tools/go-agent/config/agent.default.yaml) to define the default configuration options.
+
+This configuration file is used **during hybrid compilation to write the configuration information of the Agent into the program**. 
+When the program starts, agent would read the pre-configured content.
+
+## Configuration Changes
+
+If you want to modify the default configuration, you can copy the default file and specify it as the file when building.

Review Comment:
   ```suggestion
   The values in the config file should be updated by following the user requirements. They are applied during the hybrid compilation process.
   ```



##########
docs/en/concepts-and-designs/key-principles.md:
##########
@@ -0,0 +1,174 @@
+# Key Principle
+
+Enhancing applications in hybrid compilation is very important for SkyWalking Go Agent. 
+In this section, I will delve deeper into several key technical points.

Review Comment:
   ```suggestion
   Introduce the key technical processes used in the SkyWalking Go Agent, to help the developers and end users understand how the agent works easier.
   ```



##########
docs/en/concepts-and-designs/key-principles.md:
##########
@@ -0,0 +1,174 @@
+# Key Principle
+
+Enhancing applications in hybrid compilation is very important for SkyWalking Go Agent. 
+In this section, I will delve deeper into several key technical points.
+
+## Method Interceptor
+
+Method interception is particularly important in SkyWalking Go, as it enables the creation of plugins. In SkyWalking Go, method interception mainly involves the following key points:
+
+1. **Finding Method**: Using `AST` to find method information in the target code to be enhanced.
+2. **Modifying Methods**: Enhancing the specified methods and embedding interceptor code.
+3. **Saving and Compiling**: Updating the modified files in the compilation arguments.
+
+### Finding Method
+
+When looking for methods, the SkyWalking Go Agent need to search according to the provided compilation arguments, which mainly include the following two parts:
+
+1. **Package information**: Based on the package name provided by the arguments, the Agent can find the specific plugin.
+2 **Go files**: When a matching plugin is found, Agent can read the `.go` files and use `AST` to parse the method information contained in these files. When the method information matches the method information required by the plugin for interception, Agent can consider the method found.
+
+### Modifying Methods
+
+After finding the method, the SkyWalking Go Agent needs to modify the method implication and embed the interceptor code.
+
+#### Change Method Body
+
+When intercepting a method, the first thing to do is to modify the method and [embed the template code](../../../tools/go-agent/instrument/plugins/templates/method_inserts.tmpl). 
+This code segment includes two method executions:
+
+1. **Before method execution**: Pass in the current method's arguments, instances, and other information.
+2. **After method execution**: Using the `defer` method, intercept the result parameters after the code execution is completed.
+
+Based on these two methods, the agent can intercept before and after method execution. 
+
+In order not to affect the line of code execution, this code segment will only be executed in the **same line as the first statement in the method**. 
+This ensures that when an exception occurs in the framework code execution, the exact location can still be found without being affected by the enhanced code.
+
+#### Write Adapter File

Review Comment:
   Adapter seems like a strange name. Should we consider renaming to `Delegator`?



##########
docs/en/concepts-and-designs/key-principles.md:
##########
@@ -0,0 +1,174 @@
+# Key Principle
+
+Enhancing applications in hybrid compilation is very important for SkyWalking Go Agent. 
+In this section, I will delve deeper into several key technical points.
+
+## Method Interceptor
+
+Method interception is particularly important in SkyWalking Go, as it enables the creation of plugins. In SkyWalking Go, method interception mainly involves the following key points:
+
+1. **Finding Method**: Using `AST` to find method information in the target code to be enhanced.
+2. **Modifying Methods**: Enhancing the specified methods and embedding interceptor code.
+3. **Saving and Compiling**: Updating the modified files in the compilation arguments.
+
+### Finding Method
+
+When looking for methods, the SkyWalking Go Agent need to search according to the provided compilation arguments, which mainly include the following two parts:

Review Comment:
   ```suggestion
   When looking for methods, the SkyWalking Go Agent requires to search according to the provided compilation arguments, which mainly include the following two parts:
   ```



##########
docs/en/menu.yml:
##########
@@ -0,0 +1,51 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+catalog:
+    - name: Concepts and Designs
+      catalog:
+        - name: Introduction
+          path: /en/concepts-and-designs/introduction
+        - name: Design
+          catalog:
+            - name: Hybrid Compilation
+              path: /en/concepts-and-designs/hybird-compilcation

Review Comment:
   ```suggestion
                 path: /en/concepts-and-designs/hybrid-compilation
   ```
   Two typos for the menu and fille names.



##########
docs/en/concepts-and-designs/key-principles.md:
##########
@@ -0,0 +1,174 @@
+# Key Principle
+
+Enhancing applications in hybrid compilation is very important for SkyWalking Go Agent. 
+In this section, I will delve deeper into several key technical points.
+
+## Method Interceptor
+
+Method interception is particularly important in SkyWalking Go, as it enables the creation of plugins. In SkyWalking Go, method interception mainly involves the following key points:
+
+1. **Finding Method**: Using `AST` to find method information in the target code to be enhanced.
+2. **Modifying Methods**: Enhancing the specified methods and embedding interceptor code.
+3. **Saving and Compiling**: Updating the modified files in the compilation arguments.
+
+### Finding Method
+
+When looking for methods, the SkyWalking Go Agent need to search according to the provided compilation arguments, which mainly include the following two parts:
+
+1. **Package information**: Based on the package name provided by the arguments, the Agent can find the specific plugin.
+2 **Go files**: When a matching plugin is found, Agent can read the `.go` files and use `AST` to parse the method information contained in these files. When the method information matches the method information required by the plugin for interception, Agent can consider the method found.
+
+### Modifying Methods
+
+After finding the method, the SkyWalking Go Agent needs to modify the method implication and embed the interceptor code.
+
+#### Change Method Body
+
+When intercepting a method, the first thing to do is to modify the method and [embed the template code](../../../tools/go-agent/instrument/plugins/templates/method_inserts.tmpl). 
+This code segment includes two method executions:
+
+1. **Before method execution**: Pass in the current method's arguments, instances, and other information.
+2. **After method execution**: Using the `defer` method, intercept the result parameters after the code execution is completed.
+
+Based on these two methods, the agent can intercept before and after method execution. 
+
+In order not to affect the line of code execution, this code segment will only be executed in the **same line as the first statement in the method**. 
+This ensures that when an exception occurs in the framework code execution, the exact location can still be found without being affected by the enhanced code.
+
+#### Write Adapter File
+
+After the agent enhances the method body, it needs to implement the above two methods and write them into a single file, called the **adapter file**. These two methods will do the following:
+
+1. **Before method execution**: [Build by the template](../../../tools/go-agent/instrument/plugins/templates/method_intercept_before.tmpl). Build the context for before and after interception, and pass the parameter information during execution to the interceptor in each plugin.
+2. **After method execution**: [Build by the template](../../../tools/go-agent/instrument/plugins/templates/method_intercept_after.tmpl). Pass the method return value to the interceptor and execute the method.
+
+#### Copy Files
+
+After completing the adapter file, the agent would perform the following copy operations:
+
+1. **Plugin Code**: Copy the Go files containing the interceptors in the plugin to the same level directory as the current framework.
+2. **Plugin Development API Code**: Copy the operation APIs needed by the interceptors in the plugin to the same level directory as the current framework, such as `tracing`.

Review Comment:
   ```suggestion
   2. **Plugin Development API Code**: Copy the operation APIs required by the interceptors in the plugin to the same level directory as the current framework, such as `tracing`.
   ```



##########
docs/en/concepts-and-designs/key-principles.md:
##########
@@ -0,0 +1,174 @@
+# Key Principle
+
+Enhancing applications in hybrid compilation is very important for SkyWalking Go Agent. 
+In this section, I will delve deeper into several key technical points.
+
+## Method Interceptor
+
+Method interception is particularly important in SkyWalking Go, as it enables the creation of plugins. In SkyWalking Go, method interception mainly involves the following key points:
+
+1. **Finding Method**: Using `AST` to find method information in the target code to be enhanced.
+2. **Modifying Methods**: Enhancing the specified methods and embedding interceptor code.
+3. **Saving and Compiling**: Updating the modified files in the compilation arguments.
+
+### Finding Method
+
+When looking for methods, the SkyWalking Go Agent need to search according to the provided compilation arguments, which mainly include the following two parts:
+
+1. **Package information**: Based on the package name provided by the arguments, the Agent can find the specific plugin.
+2 **Go files**: When a matching plugin is found, Agent can read the `.go` files and use `AST` to parse the method information contained in these files. When the method information matches the method information required by the plugin for interception, Agent can consider the method found.
+
+### Modifying Methods
+
+After finding the method, the SkyWalking Go Agent needs to modify the method implication and embed the interceptor code.
+
+#### Change Method Body
+
+When intercepting a method, the first thing to do is to modify the method and [embed the template code](../../../tools/go-agent/instrument/plugins/templates/method_inserts.tmpl). 
+This code segment includes two method executions:
+
+1. **Before method execution**: Pass in the current method's arguments, instances, and other information.
+2. **After method execution**: Using the `defer` method, intercept the result parameters after the code execution is completed.
+
+Based on these two methods, the agent can intercept before and after method execution. 
+
+In order not to affect the line of code execution, this code segment will only be executed in the **same line as the first statement in the method**. 
+This ensures that when an exception occurs in the framework code execution, the exact location can still be found without being affected by the enhanced code.
+
+#### Write Adapter File
+
+After the agent enhances the method body, it needs to implement the above two methods and write them into a single file, called the **adapter file**. These two methods will do the following:

Review Comment:
   ```suggestion
   After the agent enhances the method body, it needs to implement the above two methods and write them into a single file, called the **adapter file**. These two methods would do the following:
   ```



##########
docs/en/concepts-and-designs/key-principles.md:
##########
@@ -0,0 +1,174 @@
+# Key Principle
+
+Enhancing applications in hybrid compilation is very important for SkyWalking Go Agent. 
+In this section, I will delve deeper into several key technical points.
+
+## Method Interceptor
+
+Method interception is particularly important in SkyWalking Go, as it enables the creation of plugins. In SkyWalking Go, method interception mainly involves the following key points:
+
+1. **Finding Method**: Using `AST` to find method information in the target code to be enhanced.
+2. **Modifying Methods**: Enhancing the specified methods and embedding interceptor code.
+3. **Saving and Compiling**: Updating the modified files in the compilation arguments.
+
+### Finding Method
+
+When looking for methods, the SkyWalking Go Agent need to search according to the provided compilation arguments, which mainly include the following two parts:
+
+1. **Package information**: Based on the package name provided by the arguments, the Agent can find the specific plugin.
+2 **Go files**: When a matching plugin is found, Agent can read the `.go` files and use `AST` to parse the method information contained in these files. When the method information matches the method information required by the plugin for interception, Agent can consider the method found.
+
+### Modifying Methods
+
+After finding the method, the SkyWalking Go Agent needs to modify the method implication and embed the interceptor code.
+
+#### Change Method Body
+
+When intercepting a method, the first thing to do is to modify the method and [embed the template code](../../../tools/go-agent/instrument/plugins/templates/method_inserts.tmpl). 
+This code segment includes two method executions:
+
+1. **Before method execution**: Pass in the current method's arguments, instances, and other information.
+2. **After method execution**: Using the `defer` method, intercept the result parameters after the code execution is completed.
+
+Based on these two methods, the agent can intercept before and after method execution. 
+
+In order not to affect the line of code execution, this code segment will only be executed in the **same line as the first statement in the method**. 
+This ensures that when an exception occurs in the framework code execution, the exact location can still be found without being affected by the enhanced code.
+
+#### Write Adapter File
+
+After the agent enhances the method body, it needs to implement the above two methods and write them into a single file, called the **adapter file**. These two methods will do the following:
+
+1. **Before method execution**: [Build by the template](../../../tools/go-agent/instrument/plugins/templates/method_intercept_before.tmpl). Build the context for before and after interception, and pass the parameter information during execution to the interceptor in each plugin.
+2. **After method execution**: [Build by the template](../../../tools/go-agent/instrument/plugins/templates/method_intercept_after.tmpl). Pass the method return value to the interceptor and execute the method.
+
+#### Copy Files
+
+After completing the adapter file, the agent would perform the following copy operations:
+
+1. **Plugin Code**: Copy the Go files containing the interceptors in the plugin to the same level directory as the current framework.
+2. **Plugin Development API Code**: Copy the operation APIs needed by the interceptors in the plugin to the same level directory as the current framework, such as `tracing`.
+
+After copying the files, they cannot be immediately added to the compilation parameters, because they may have the same name as the existing framework code. Therefore, we need to perform some rewriting operations, which include the following parts:
+
+1. **Types**: Rename created structures, interfaces, methods, and other types by adding a unified prefix.
+2. **Static Methods**: Add a prefix to non-instance methods. Static methods do not need to be rewritten since they have already been processed in the types.
+3. **Variables**: Add a prefix to global variables. It's not necessary to add a prefix to variables inside methods because they can ensure no conflicts would arise and are helpful for debugging.
+
+### Saving and Compiling
+
+After the above steps are completed, the agent needs to save the modified files and add them to the compilation parameters.
+
+At this point, when the framework executes the enhanced method, it can have the following capabilities:
+
+1. **Execute Plugin Code**: Custom code can be embedded before and after the method execution, and real-time parameter information can be obtained.
+2. **Operate Agent**: By calling the Agent API, interaction with the Agent Core can be achieved, enabling functions such as distributed tracing.
+
+## Propagation context
+
+In Golang programs, we use `context.Context` to achieve data exchange between methods and goroutines. 
+However, if the framework or environment does not provide `context.Context` for propagation, or it is not required as a parameter when used, it would result in the inability to pass information. 
+Therefore, we need to consider a method to pass data using **non-**`context.Context` objects to keep the entire distributed tracing chain complete.

Review Comment:
   ```suggestion
   SkyWalking uses a new and internal mechanism to propagate context(e.g. tracing context) instead of 
   relying on go native `context.Context`. This reduces the requirement for the target codes.
   ```



##########
docs/en/concepts-and-designs/key-principles.md:
##########
@@ -0,0 +1,174 @@
+# Key Principle
+
+Enhancing applications in hybrid compilation is very important for SkyWalking Go Agent. 
+In this section, I will delve deeper into several key technical points.
+
+## Method Interceptor
+
+Method interception is particularly important in SkyWalking Go, as it enables the creation of plugins. In SkyWalking Go, method interception mainly involves the following key points:
+
+1. **Finding Method**: Using `AST` to find method information in the target code to be enhanced.
+2. **Modifying Methods**: Enhancing the specified methods and embedding interceptor code.
+3. **Saving and Compiling**: Updating the modified files in the compilation arguments.
+
+### Finding Method
+
+When looking for methods, the SkyWalking Go Agent need to search according to the provided compilation arguments, which mainly include the following two parts:
+
+1. **Package information**: Based on the package name provided by the arguments, the Agent can find the specific plugin.
+2 **Go files**: When a matching plugin is found, Agent can read the `.go` files and use `AST` to parse the method information contained in these files. When the method information matches the method information required by the plugin for interception, Agent can consider the method found.
+
+### Modifying Methods
+
+After finding the method, the SkyWalking Go Agent needs to modify the method implication and embed the interceptor code.
+
+#### Change Method Body
+
+When intercepting a method, the first thing to do is to modify the method and [embed the template code](../../../tools/go-agent/instrument/plugins/templates/method_inserts.tmpl). 
+This code segment includes two method executions:
+
+1. **Before method execution**: Pass in the current method's arguments, instances, and other information.
+2. **After method execution**: Using the `defer` method, intercept the result parameters after the code execution is completed.
+
+Based on these two methods, the agent can intercept before and after method execution. 
+
+In order not to affect the line of code execution, this code segment will only be executed in the **same line as the first statement in the method**. 
+This ensures that when an exception occurs in the framework code execution, the exact location can still be found without being affected by the enhanced code.
+
+#### Write Adapter File
+
+After the agent enhances the method body, it needs to implement the above two methods and write them into a single file, called the **adapter file**. These two methods will do the following:
+
+1. **Before method execution**: [Build by the template](../../../tools/go-agent/instrument/plugins/templates/method_intercept_before.tmpl). Build the context for before and after interception, and pass the parameter information during execution to the interceptor in each plugin.
+2. **After method execution**: [Build by the template](../../../tools/go-agent/instrument/plugins/templates/method_intercept_after.tmpl). Pass the method return value to the interceptor and execute the method.
+
+#### Copy Files
+
+After completing the adapter file, the agent would perform the following copy operations:
+
+1. **Plugin Code**: Copy the Go files containing the interceptors in the plugin to the same level directory as the current framework.
+2. **Plugin Development API Code**: Copy the operation APIs needed by the interceptors in the plugin to the same level directory as the current framework, such as `tracing`.
+
+After copying the files, they cannot be immediately added to the compilation parameters, because they may have the same name as the existing framework code. Therefore, we need to perform some rewriting operations, which include the following parts:
+
+1. **Types**: Rename created structures, interfaces, methods, and other types by adding a unified prefix.
+2. **Static Methods**: Add a prefix to non-instance methods. Static methods do not need to be rewritten since they have already been processed in the types.
+3. **Variables**: Add a prefix to global variables. It's not necessary to add a prefix to variables inside methods because they can ensure no conflicts would arise and are helpful for debugging.
+
+### Saving and Compiling
+
+After the above steps are completed, the agent needs to save the modified files and add them to the compilation parameters.
+
+At this point, when the framework executes the enhanced method, it can have the following capabilities:
+
+1. **Execute Plugin Code**: Custom code can be embedded before and after the method execution, and real-time parameter information can be obtained.
+2. **Operate Agent**: By calling the Agent API, interaction with the Agent Core can be achieved, enabling functions such as distributed tracing.
+
+## Propagation context

Review Comment:
   ```suggestion
   ## Propagation Context
   ```



##########
docs/en/concepts-and-designs/key-principles.md:
##########
@@ -0,0 +1,174 @@
+# Key Principle
+
+Enhancing applications in hybrid compilation is very important for SkyWalking Go Agent. 
+In this section, I will delve deeper into several key technical points.
+
+## Method Interceptor
+
+Method interception is particularly important in SkyWalking Go, as it enables the creation of plugins. In SkyWalking Go, method interception mainly involves the following key points:
+
+1. **Finding Method**: Using `AST` to find method information in the target code to be enhanced.
+2. **Modifying Methods**: Enhancing the specified methods and embedding interceptor code.
+3. **Saving and Compiling**: Updating the modified files in the compilation arguments.
+
+### Finding Method
+
+When looking for methods, the SkyWalking Go Agent need to search according to the provided compilation arguments, which mainly include the following two parts:
+
+1. **Package information**: Based on the package name provided by the arguments, the Agent can find the specific plugin.
+2 **Go files**: When a matching plugin is found, Agent can read the `.go` files and use `AST` to parse the method information contained in these files. When the method information matches the method information required by the plugin for interception, Agent can consider the method found.
+
+### Modifying Methods
+
+After finding the method, the SkyWalking Go Agent needs to modify the method implication and embed the interceptor code.
+
+#### Change Method Body
+
+When intercepting a method, the first thing to do is to modify the method and [embed the template code](../../../tools/go-agent/instrument/plugins/templates/method_inserts.tmpl). 
+This code segment includes two method executions:
+
+1. **Before method execution**: Pass in the current method's arguments, instances, and other information.
+2. **After method execution**: Using the `defer` method, intercept the result parameters after the code execution is completed.
+
+Based on these two methods, the agent can intercept before and after method execution. 
+
+In order not to affect the line of code execution, this code segment will only be executed in the **same line as the first statement in the method**. 
+This ensures that when an exception occurs in the framework code execution, the exact location can still be found without being affected by the enhanced code.
+
+#### Write Adapter File
+
+After the agent enhances the method body, it needs to implement the above two methods and write them into a single file, called the **adapter file**. These two methods will do the following:
+
+1. **Before method execution**: [Build by the template](../../../tools/go-agent/instrument/plugins/templates/method_intercept_before.tmpl). Build the context for before and after interception, and pass the parameter information during execution to the interceptor in each plugin.
+2. **After method execution**: [Build by the template](../../../tools/go-agent/instrument/plugins/templates/method_intercept_after.tmpl). Pass the method return value to the interceptor and execute the method.
+
+#### Copy Files
+
+After completing the adapter file, the agent would perform the following copy operations:
+
+1. **Plugin Code**: Copy the Go files containing the interceptors in the plugin to the same level directory as the current framework.
+2. **Plugin Development API Code**: Copy the operation APIs needed by the interceptors in the plugin to the same level directory as the current framework, such as `tracing`.
+
+After copying the files, they cannot be immediately added to the compilation parameters, because they may have the same name as the existing framework code. Therefore, we need to perform some rewriting operations, which include the following parts:
+
+1. **Types**: Rename created structures, interfaces, methods, and other types by adding a unified prefix.
+2. **Static Methods**: Add a prefix to non-instance methods. Static methods do not need to be rewritten since they have already been processed in the types.
+3. **Variables**: Add a prefix to global variables. It's not necessary to add a prefix to variables inside methods because they can ensure no conflicts would arise and are helpful for debugging.
+
+### Saving and Compiling
+
+After the above steps are completed, the agent needs to save the modified files and add them to the compilation parameters.
+
+At this point, when the framework executes the enhanced method, it can have the following capabilities:
+
+1. **Execute Plugin Code**: Custom code can be embedded before and after the method execution, and real-time parameter information can be obtained.
+2. **Operate Agent**: By calling the Agent API, interaction with the Agent Core can be achieved, enabling functions such as distributed tracing.
+
+## Propagation context
+
+In Golang programs, we use `context.Context` to achieve data exchange between methods and goroutines. 
+However, if the framework or environment does not provide `context.Context` for propagation, or it is not required as a parameter when used, it would result in the inability to pass information. 
+Therefore, we need to consider a method to pass data using **non-**`context.Context` objects to keep the entire distributed tracing chain complete.
+
+### Context Propagation between Methods
+
+In the agent, it would enhance the `g` structure in the `runtime` package. 
+The `g` structure in Golang represents the internal data of the current goroutine. 
+By enhancing this structure and using the `runtime.getg()` method, we can obtain the enhanced data in the current structure in real-time.
+
+Enhancement includes the following steps:
+
+1. **Add Attributes to g**: Add a new field to the `g` struct, and value as `interface{}`.
+2. **Export Methods**: Export methods for real-time setting and getting of custom field values in the current goroutine through `go:linkname`.
+3. **Import methods**: In the Agent Core, import the setting and getting methods for custom fields.
+
+After completing the above steps, the agent can get or set data of the same goroutine in any method within the same goroutine, similar to Java's `Thread Local`.
+
+### Context Propagation between Goroutines
+
+For cross-goroutine situations, since different goroutines have different `g` objects, 
+the agent cannot access data from one goroutine in another goroutine. 
+
+However, when a new goroutine is started on an existing goroutine, the `runtime.newproc1` method is called to create a new goroutine based on the existing one. 
+The current solution used by the Agent is to, after the method execution is finished, use the `defer` command so that the Agent can access both the previous and the new goroutine. 
+At this point, the data in the custom fields is copied. The purpose of copying is to prevent panic caused by the same object being accessed in multiple goroutines.

Review Comment:
   ```suggestion
   The agent would do `context-copy` from the previous goroutine to the newly created goroutine.
   The new context in the `goroutine` only shares limited information to help continues tracing.
   ```



##########
docs/en/concepts-and-designs/key-principles.md:
##########
@@ -0,0 +1,174 @@
+# Key Principle
+
+Enhancing applications in hybrid compilation is very important for SkyWalking Go Agent. 
+In this section, I will delve deeper into several key technical points.
+
+## Method Interceptor
+
+Method interception is particularly important in SkyWalking Go, as it enables the creation of plugins. In SkyWalking Go, method interception mainly involves the following key points:
+
+1. **Finding Method**: Using `AST` to find method information in the target code to be enhanced.
+2. **Modifying Methods**: Enhancing the specified methods and embedding interceptor code.
+3. **Saving and Compiling**: Updating the modified files in the compilation arguments.
+
+### Finding Method
+
+When looking for methods, the SkyWalking Go Agent need to search according to the provided compilation arguments, which mainly include the following two parts:
+
+1. **Package information**: Based on the package name provided by the arguments, the Agent can find the specific plugin.
+2 **Go files**: When a matching plugin is found, Agent can read the `.go` files and use `AST` to parse the method information contained in these files. When the method information matches the method information required by the plugin for interception, Agent can consider the method found.
+
+### Modifying Methods
+
+After finding the method, the SkyWalking Go Agent needs to modify the method implication and embed the interceptor code.
+
+#### Change Method Body
+
+When intercepting a method, the first thing to do is to modify the method and [embed the template code](../../../tools/go-agent/instrument/plugins/templates/method_inserts.tmpl). 
+This code segment includes two method executions:
+
+1. **Before method execution**: Pass in the current method's arguments, instances, and other information.
+2. **After method execution**: Using the `defer` method, intercept the result parameters after the code execution is completed.
+
+Based on these two methods, the agent can intercept before and after method execution. 
+
+In order not to affect the line of code execution, this code segment will only be executed in the **same line as the first statement in the method**. 
+This ensures that when an exception occurs in the framework code execution, the exact location can still be found without being affected by the enhanced code.
+
+#### Write Adapter File
+
+After the agent enhances the method body, it needs to implement the above two methods and write them into a single file, called the **adapter file**. These two methods will do the following:
+
+1. **Before method execution**: [Build by the template](../../../tools/go-agent/instrument/plugins/templates/method_intercept_before.tmpl). Build the context for before and after interception, and pass the parameter information during execution to the interceptor in each plugin.
+2. **After method execution**: [Build by the template](../../../tools/go-agent/instrument/plugins/templates/method_intercept_after.tmpl). Pass the method return value to the interceptor and execute the method.
+
+#### Copy Files
+
+After completing the adapter file, the agent would perform the following copy operations:
+
+1. **Plugin Code**: Copy the Go files containing the interceptors in the plugin to the same level directory as the current framework.
+2. **Plugin Development API Code**: Copy the operation APIs needed by the interceptors in the plugin to the same level directory as the current framework, such as `tracing`.
+
+After copying the files, they cannot be immediately added to the compilation parameters, because they may have the same name as the existing framework code. Therefore, we need to perform some rewriting operations, which include the following parts:
+
+1. **Types**: Rename created structures, interfaces, methods, and other types by adding a unified prefix.
+2. **Static Methods**: Add a prefix to non-instance methods. Static methods do not need to be rewritten since they have already been processed in the types.
+3. **Variables**: Add a prefix to global variables. It's not necessary to add a prefix to variables inside methods because they can ensure no conflicts would arise and are helpful for debugging.
+
+### Saving and Compiling
+
+After the above steps are completed, the agent needs to save the modified files and add them to the compilation parameters.
+
+At this point, when the framework executes the enhanced method, it can have the following capabilities:
+
+1. **Execute Plugin Code**: Custom code can be embedded before and after the method execution, and real-time parameter information can be obtained.
+2. **Operate Agent**: By calling the Agent API, interaction with the Agent Core can be achieved, enabling functions such as distributed tracing.
+
+## Propagation context
+
+In Golang programs, we use `context.Context` to achieve data exchange between methods and goroutines. 
+However, if the framework or environment does not provide `context.Context` for propagation, or it is not required as a parameter when used, it would result in the inability to pass information. 
+Therefore, we need to consider a method to pass data using **non-**`context.Context` objects to keep the entire distributed tracing chain complete.
+
+### Context Propagation between Methods
+
+In the agent, it would enhance the `g` structure in the `runtime` package. 
+The `g` structure in Golang represents the internal data of the current goroutine. 
+By enhancing this structure and using the `runtime.getg()` method, we can obtain the enhanced data in the current structure in real-time.
+
+Enhancement includes the following steps:
+
+1. **Add Attributes to g**: Add a new field to the `g` struct, and value as `interface{}`.
+2. **Export Methods**: Export methods for real-time setting and getting of custom field values in the current goroutine through `go:linkname`.
+3. **Import methods**: In the Agent Core, import the setting and getting methods for custom fields.
+
+After completing the above steps, the agent can get or set data of the same goroutine in any method within the same goroutine, similar to Java's `Thread Local`.
+
+### Context Propagation between Goroutines
+
+For cross-goroutine situations, since different goroutines have different `g` objects, 
+the agent cannot access data from one goroutine in another goroutine. 
+
+However, when a new goroutine is started on an existing goroutine, the `runtime.newproc1` method is called to create a new goroutine based on the existing one. 
+The current solution used by the Agent is to, after the method execution is finished, use the `defer` command so that the Agent can access both the previous and the new goroutine. 
+At this point, the data in the custom fields is copied. The purpose of copying is to prevent panic caused by the same object being accessed in multiple goroutines.
+
+The specific operation process is as follows:
+
+1. **Write the copy method**: Create a method for copying data from the custom fields.
+2. **Insert code into newproc1**: Insert the `defer` code, intercept the `g` objects before and after the execution, and call the copy method to assign values to the custom fields' data.
+
+## Agent with Dependency
+
+Since SkyWalking Go Agent is based on compile-time enhancement, it cannot introduce third-party modules. 
+For example, when SkyWalking Agent communicates with OAP, it needs to exchange data through the `gRPC` protocol. 
+If the user does not introduce the gRPC module, it cannot be completed.
+
+Due to this problem, users need to introduce relevant modules to complete the basic dependency functions. 
+The main key modules that users currently need to introduce include:
+
+1. **uuid**: Used to generate UUIDs, mainly for `TraceID` generation.
+2. **errors**: To encapsulate error content.
+3. **gRPC**: The basic library used for communication between SkyWalking Go Agent and the Server.
+4. **skywalking-goapi**: The data protocol for communication between Agent and Server in SkyWalking.
+
+### Agent Core Copy
+
+To simplify the complexity of using Agent, the SkyWalking Go introduced by users only contains the user usage API and code import. 
+The Agent Core code would be dynamically added during hybrid compilation, so when the Agent releases new features, 
+users only need to upgrade the Agent enhancement program without modifying the references in the program.
+
+### Code Import
+
+You can see a lot of `imports.go` files anywhere in the SkyWalking Go, such as [imports.go in the root directory](../../../imports.go), but there is no actual code. 
+This is because, during hybrid compilation, if the code to be compiled references other libraries, 
+such as `os`, `fmt`, etc., they need to be referenced through the **importcfg** file during compilation.
+
+The content of the `importcfg` file is shown below, which specifies the package dependency information required for all Go files to be compiled in the current package path.
+
+```
+packagefile errors=/var/folders/wz/s5m922z15vz4fjhf5l4458xm0000gn/T/go-build2774248373/b006/_pkg_.a
+packagefile internal/itoa=/var/folders/wz/s5m922z15vz4fjhf5l4458xm0000gn/T/go-build2774248373/b027/_pkg_.a
+packagefile internal/oserror=/var/folders/wz/s5m922z15vz4fjhf5l4458xm0000gn/T/go-build2774248373/b035/_pkg_.a
+```
+
+So when the file is copied and added to the compilation process, the relevant dependency libraries need to be declared in `importcfg`. 
+Therefore, by predefining `import` in the project, the compiler can be forced to introduce the relevant libraries during compilation, 
+thus completing the dynamic enhancement operation.
+
+## Plugin with Agent Core
+
+As mentioned in the previous section, it is not possible to dynamically add dependencies between modules. 
+Agent can only modify the `importcfg` file to reference dependencies if we are sure that the previous dependencies have already been loaded, 
+but this is often impractical. For example, Agent cannot introduce dependencies from the plugin code into the Agent Core, 
+because the plugin is unaware of the Agent's existence. This raises a question: how can agent enable communication between plugins and Agent Core?
+
+Currently, agent employ the following method: a global object is introduced in the `runtime` package, provided by Agent Core. 
+When a plugin needs to interact with Agent Core, it simply searches for this global object from `runtime` package. The specific steps are as follows:
+
+1. **Global object definition**: Add a global variable when the `runtime` package is loaded and provide corresponding set and get methods.
+2. **Set the variable when the Agent loads**: When the Agent Core is copied and enhanced, import the method for setting the global variable and initialize the object in the global variable.
+3. **Plugin enhancement**: When the plugin is enhanced, import the method for getting the global variable and the interface definition for the global variable. 

Review Comment:
   ```suggestion
   3. **Plugins**: When the plugin is built, import the methods for reading the global variables and APIs.
   ```



##########
docs/en/concepts-and-designs/key-principles.md:
##########
@@ -0,0 +1,174 @@
+# Key Principle
+
+Enhancing applications in hybrid compilation is very important for SkyWalking Go Agent. 
+In this section, I will delve deeper into several key technical points.
+
+## Method Interceptor
+
+Method interception is particularly important in SkyWalking Go, as it enables the creation of plugins. In SkyWalking Go, method interception mainly involves the following key points:
+
+1. **Finding Method**: Using `AST` to find method information in the target code to be enhanced.
+2. **Modifying Methods**: Enhancing the specified methods and embedding interceptor code.
+3. **Saving and Compiling**: Updating the modified files in the compilation arguments.
+
+### Finding Method
+
+When looking for methods, the SkyWalking Go Agent need to search according to the provided compilation arguments, which mainly include the following two parts:
+
+1. **Package information**: Based on the package name provided by the arguments, the Agent can find the specific plugin.
+2 **Go files**: When a matching plugin is found, Agent can read the `.go` files and use `AST` to parse the method information contained in these files. When the method information matches the method information required by the plugin for interception, Agent can consider the method found.
+
+### Modifying Methods
+
+After finding the method, the SkyWalking Go Agent needs to modify the method implication and embed the interceptor code.
+
+#### Change Method Body
+
+When intercepting a method, the first thing to do is to modify the method and [embed the template code](../../../tools/go-agent/instrument/plugins/templates/method_inserts.tmpl). 
+This code segment includes two method executions:
+
+1. **Before method execution**: Pass in the current method's arguments, instances, and other information.
+2. **After method execution**: Using the `defer` method, intercept the result parameters after the code execution is completed.
+
+Based on these two methods, the agent can intercept before and after method execution. 
+
+In order not to affect the line of code execution, this code segment will only be executed in the **same line as the first statement in the method**. 
+This ensures that when an exception occurs in the framework code execution, the exact location can still be found without being affected by the enhanced code.
+
+#### Write Adapter File
+
+After the agent enhances the method body, it needs to implement the above two methods and write them into a single file, called the **adapter file**. These two methods will do the following:
+
+1. **Before method execution**: [Build by the template](../../../tools/go-agent/instrument/plugins/templates/method_intercept_before.tmpl). Build the context for before and after interception, and pass the parameter information during execution to the interceptor in each plugin.
+2. **After method execution**: [Build by the template](../../../tools/go-agent/instrument/plugins/templates/method_intercept_after.tmpl). Pass the method return value to the interceptor and execute the method.
+
+#### Copy Files
+
+After completing the adapter file, the agent would perform the following copy operations:
+
+1. **Plugin Code**: Copy the Go files containing the interceptors in the plugin to the same level directory as the current framework.
+2. **Plugin Development API Code**: Copy the operation APIs needed by the interceptors in the plugin to the same level directory as the current framework, such as `tracing`.
+
+After copying the files, they cannot be immediately added to the compilation parameters, because they may have the same name as the existing framework code. Therefore, we need to perform some rewriting operations, which include the following parts:
+
+1. **Types**: Rename created structures, interfaces, methods, and other types by adding a unified prefix.
+2. **Static Methods**: Add a prefix to non-instance methods. Static methods do not need to be rewritten since they have already been processed in the types.
+3. **Variables**: Add a prefix to global variables. It's not necessary to add a prefix to variables inside methods because they can ensure no conflicts would arise and are helpful for debugging.
+
+### Saving and Compiling
+
+After the above steps are completed, the agent needs to save the modified files and add them to the compilation parameters.
+
+At this point, when the framework executes the enhanced method, it can have the following capabilities:
+
+1. **Execute Plugin Code**: Custom code can be embedded before and after the method execution, and real-time parameter information can be obtained.
+2. **Operate Agent**: By calling the Agent API, interaction with the Agent Core can be achieved, enabling functions such as distributed tracing.
+
+## Propagation context
+
+In Golang programs, we use `context.Context` to achieve data exchange between methods and goroutines. 
+However, if the framework or environment does not provide `context.Context` for propagation, or it is not required as a parameter when used, it would result in the inability to pass information. 
+Therefore, we need to consider a method to pass data using **non-**`context.Context` objects to keep the entire distributed tracing chain complete.
+
+### Context Propagation between Methods
+
+In the agent, it would enhance the `g` structure in the `runtime` package. 
+The `g` structure in Golang represents the internal data of the current goroutine. 
+By enhancing this structure and using the `runtime.getg()` method, we can obtain the enhanced data in the current structure in real-time.
+
+Enhancement includes the following steps:
+
+1. **Add Attributes to g**: Add a new field to the `g` struct, and value as `interface{}`.
+2. **Export Methods**: Export methods for real-time setting and getting of custom field values in the current goroutine through `go:linkname`.
+3. **Import methods**: In the Agent Core, import the setting and getting methods for custom fields.
+
+After completing the above steps, the agent can get or set data of the same goroutine in any method within the same goroutine, similar to Java's `Thread Local`.
+
+### Context Propagation between Goroutines
+
+For cross-goroutine situations, since different goroutines have different `g` objects, 
+the agent cannot access data from one goroutine in another goroutine. 
+
+However, when a new goroutine is started on an existing goroutine, the `runtime.newproc1` method is called to create a new goroutine based on the existing one. 

Review Comment:
   ```suggestion
   When a new goroutine is started on an existing goroutine, the `runtime.newproc1` method is called to create a new goroutine based on the existing one. 
   ```



##########
docs/en/concepts-and-designs/key-principles.md:
##########
@@ -0,0 +1,174 @@
+# Key Principle
+
+Enhancing applications in hybrid compilation is very important for SkyWalking Go Agent. 
+In this section, I will delve deeper into several key technical points.
+
+## Method Interceptor
+
+Method interception is particularly important in SkyWalking Go, as it enables the creation of plugins. In SkyWalking Go, method interception mainly involves the following key points:
+
+1. **Finding Method**: Using `AST` to find method information in the target code to be enhanced.
+2. **Modifying Methods**: Enhancing the specified methods and embedding interceptor code.
+3. **Saving and Compiling**: Updating the modified files in the compilation arguments.
+
+### Finding Method
+
+When looking for methods, the SkyWalking Go Agent need to search according to the provided compilation arguments, which mainly include the following two parts:
+
+1. **Package information**: Based on the package name provided by the arguments, the Agent can find the specific plugin.
+2 **Go files**: When a matching plugin is found, Agent can read the `.go` files and use `AST` to parse the method information contained in these files. When the method information matches the method information required by the plugin for interception, Agent can consider the method found.
+
+### Modifying Methods
+
+After finding the method, the SkyWalking Go Agent needs to modify the method implication and embed the interceptor code.
+
+#### Change Method Body
+
+When intercepting a method, the first thing to do is to modify the method and [embed the template code](../../../tools/go-agent/instrument/plugins/templates/method_inserts.tmpl). 
+This code segment includes two method executions:
+
+1. **Before method execution**: Pass in the current method's arguments, instances, and other information.
+2. **After method execution**: Using the `defer` method, intercept the result parameters after the code execution is completed.
+
+Based on these two methods, the agent can intercept before and after method execution. 
+
+In order not to affect the line of code execution, this code segment will only be executed in the **same line as the first statement in the method**. 
+This ensures that when an exception occurs in the framework code execution, the exact location can still be found without being affected by the enhanced code.
+
+#### Write Adapter File
+
+After the agent enhances the method body, it needs to implement the above two methods and write them into a single file, called the **adapter file**. These two methods will do the following:
+
+1. **Before method execution**: [Build by the template](../../../tools/go-agent/instrument/plugins/templates/method_intercept_before.tmpl). Build the context for before and after interception, and pass the parameter information during execution to the interceptor in each plugin.
+2. **After method execution**: [Build by the template](../../../tools/go-agent/instrument/plugins/templates/method_intercept_after.tmpl). Pass the method return value to the interceptor and execute the method.
+
+#### Copy Files
+
+After completing the adapter file, the agent would perform the following copy operations:
+
+1. **Plugin Code**: Copy the Go files containing the interceptors in the plugin to the same level directory as the current framework.
+2. **Plugin Development API Code**: Copy the operation APIs needed by the interceptors in the plugin to the same level directory as the current framework, such as `tracing`.
+
+After copying the files, they cannot be immediately added to the compilation parameters, because they may have the same name as the existing framework code. Therefore, we need to perform some rewriting operations, which include the following parts:
+
+1. **Types**: Rename created structures, interfaces, methods, and other types by adding a unified prefix.
+2. **Static Methods**: Add a prefix to non-instance methods. Static methods do not need to be rewritten since they have already been processed in the types.
+3. **Variables**: Add a prefix to global variables. It's not necessary to add a prefix to variables inside methods because they can ensure no conflicts would arise and are helpful for debugging.
+
+### Saving and Compiling
+
+After the above steps are completed, the agent needs to save the modified files and add them to the compilation parameters.
+
+At this point, when the framework executes the enhanced method, it can have the following capabilities:
+
+1. **Execute Plugin Code**: Custom code can be embedded before and after the method execution, and real-time parameter information can be obtained.
+2. **Operate Agent**: By calling the Agent API, interaction with the Agent Core can be achieved, enabling functions such as distributed tracing.
+
+## Propagation context
+
+In Golang programs, we use `context.Context` to achieve data exchange between methods and goroutines. 
+However, if the framework or environment does not provide `context.Context` for propagation, or it is not required as a parameter when used, it would result in the inability to pass information. 
+Therefore, we need to consider a method to pass data using **non-**`context.Context` objects to keep the entire distributed tracing chain complete.
+
+### Context Propagation between Methods
+
+In the agent, it would enhance the `g` structure in the `runtime` package. 
+The `g` structure in Golang represents the internal data of the current goroutine. 
+By enhancing this structure and using the `runtime.getg()` method, we can obtain the enhanced data in the current structure in real-time.
+
+Enhancement includes the following steps:
+
+1. **Add Attributes to g**: Add a new field to the `g` struct, and value as `interface{}`.
+2. **Export Methods**: Export methods for real-time setting and getting of custom field values in the current goroutine through `go:linkname`.
+3. **Import methods**: In the Agent Core, import the setting and getting methods for custom fields.
+
+After completing the above steps, the agent can get or set data of the same goroutine in any method within the same goroutine, similar to Java's `Thread Local`.
+
+### Context Propagation between Goroutines
+
+For cross-goroutine situations, since different goroutines have different `g` objects, 
+the agent cannot access data from one goroutine in another goroutine. 
+
+However, when a new goroutine is started on an existing goroutine, the `runtime.newproc1` method is called to create a new goroutine based on the existing one. 
+The current solution used by the Agent is to, after the method execution is finished, use the `defer` command so that the Agent can access both the previous and the new goroutine. 
+At this point, the data in the custom fields is copied. The purpose of copying is to prevent panic caused by the same object being accessed in multiple goroutines.
+
+The specific operation process is as follows:
+
+1. **Write the copy method**: Create a method for copying data from the custom fields.
+2. **Insert code into newproc1**: Insert the `defer` code, intercept the `g` objects before and after the execution, and call the copy method to assign values to the custom fields' data.
+
+## Agent with Dependency
+
+Since SkyWalking Go Agent is based on compile-time enhancement, it cannot introduce third-party modules. 
+For example, when SkyWalking Agent communicates with OAP, it needs to exchange data through the `gRPC` protocol. 
+If the user does not introduce the gRPC module, it cannot be completed.
+
+Due to this problem, users need to introduce relevant modules to complete the basic dependency functions. 
+The main key modules that users currently need to introduce include:
+
+1. **uuid**: Used to generate UUIDs, mainly for `TraceID` generation.
+2. **errors**: To encapsulate error content.
+3. **gRPC**: The basic library used for communication between SkyWalking Go Agent and the Server.
+4. **skywalking-goapi**: The data protocol for communication between Agent and Server in SkyWalking.
+
+### Agent Core Copy
+
+To simplify the complexity of using Agent, the SkyWalking Go introduced by users only contains the user usage API and code import. 
+The Agent Core code would be dynamically added during hybrid compilation, so when the Agent releases new features, 
+users only need to upgrade the Agent enhancement program without modifying the references in the program.
+
+### Code Import
+
+You can see a lot of `imports.go` files anywhere in the SkyWalking Go, such as [imports.go in the root directory](../../../imports.go), but there is no actual code. 
+This is because, during hybrid compilation, if the code to be compiled references other libraries, 
+such as `os`, `fmt`, etc., they need to be referenced through the **importcfg** file during compilation.
+
+The content of the `importcfg` file is shown below, which specifies the package dependency information required for all Go files to be compiled in the current package path.
+
+```
+packagefile errors=/var/folders/wz/s5m922z15vz4fjhf5l4458xm0000gn/T/go-build2774248373/b006/_pkg_.a
+packagefile internal/itoa=/var/folders/wz/s5m922z15vz4fjhf5l4458xm0000gn/T/go-build2774248373/b027/_pkg_.a
+packagefile internal/oserror=/var/folders/wz/s5m922z15vz4fjhf5l4458xm0000gn/T/go-build2774248373/b035/_pkg_.a
+```
+
+So when the file is copied and added to the compilation process, the relevant dependency libraries need to be declared in `importcfg`. 
+Therefore, by predefining `import` in the project, the compiler can be forced to introduce the relevant libraries during compilation, 
+thus completing the dynamic enhancement operation.
+
+## Plugin with Agent Core
+
+As mentioned in the previous section, it is not possible to dynamically add dependencies between modules. 
+Agent can only modify the `importcfg` file to reference dependencies if we are sure that the previous dependencies have already been loaded, 
+but this is often impractical. For example, Agent cannot introduce dependencies from the plugin code into the Agent Core, 
+because the plugin is unaware of the Agent's existence. This raises a question: how can agent enable communication between plugins and Agent Core?
+
+Currently, agent employ the following method: a global object is introduced in the `runtime` package, provided by Agent Core. 
+When a plugin needs to interact with Agent Core, it simply searches for this global object from `runtime` package. The specific steps are as follows:
+
+1. **Global object definition**: Add a global variable when the `runtime` package is loaded and provide corresponding set and get methods.
+2. **Set the variable when the Agent loads**: When the Agent Core is copied and enhanced, import the method for setting the global variable and initialize the object in the global variable.
+3. **Plugin enhancement**: When the plugin is enhanced, import the method for getting the global variable and the interface definition for the global variable. 
+At this point, we can access the object set in Agent Core and use the defined interface for the plugin to access methods in Agent Core.

Review Comment:
   ```suggestion
   At this point, we can access the object set in Agent Core and use the defined interface for the plugin to access methods in Agent Core.
   ```
   
   I think we should only access Agent Core APIs? what does this mean?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org