Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modify according to code review comments
Signed-off-by: surechen <chenshuo17@huawei.com>
- Loading branch information
Showing
5 changed files
with
25 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,36 @@ | ||
# SkyWalking | ||
|
||
Skywalking-manager is a handler plugin of mesher, it reports tracing data to skywalking server | ||
Skywalking-manager is a handler plugin of mesher, it reports tracing data to skywalking server. | ||
|
||
## Configurations | ||
**In conf/mesher.conf** | ||
|
||
**servicecomb.apm.tracing.enable** | ||
> *(optional, bool)* enable apm | ||
> *(optional, bool)* enable application performance manager | ||
**servicecomb.apm.tracing.serverUri** | ||
> *(optional, string)* server address of skywalking | ||
## Example | ||
```yaml | ||
servicecomb: | ||
apm: | ||
apm: #application performance monitor | ||
tracing: | ||
enable: true | ||
serverUri: 127.0.0.1:11800 | ||
enable: true #enable tracing ability | ||
serverUri: 127.0.0.1:11800 #url of skywalking | ||
``` | ||
## Step: | ||
|
||
## SkyWawlking-Manager Init | ||
**In file proxy/bootstrap/bootstrap.go** | ||
```shell script | ||
import "github.com/apache/servicecomb-mesher/proxy/pkg/skywalking" | ||
``` | ||
**In function Start()** | ||
```shell script | ||
skywalking.Init() | ||
``` | ||
|
||
**In function SetHandlers() add two Handlers** | ||
```shell script | ||
consumerChain := strings.Join([]string{ | ||
... | ||
skywalking.SkyWalkingConsumer, | ||
chassisHandler.Transport, | ||
}} | ||
# 1. SkyWawlking-Manager Init | ||
**You must init skywawlking manager pkg which will manage connection and report msg to skywalking** | ||
- For example: | ||
- [1] You can import skywalking manager proxy/pkg/skywalking in file proxy/bootstrap/bootstrap.go. | ||
- [2] Calling function Init() in proxy/pkg/skywalking manually to init skywalking manager. | ||
- [3] Adding skywalking's consumer handler name SkyWalkingConsumer defined in proxy/pkg/skywalking to consumerChain. | ||
- [4] Adding skywalking's provider handler name SkyWalkingProvider defined in proxy/pkg/skywalking to providerChain. | ||
- more details about handler chains in [go-chassis](https://github.com/go-chassis/go-chassis#readme) | ||
|
||
providerChain := strings.Join([]string{ | ||
... | ||
skywalking.SkyWalkingProvider, | ||
chassisHandler.Transport, | ||
}} | ||
# 2. SkyWalking-Handler Init | ||
- You must import proxy/handler pkg to init skywalking handler. Not only skywalking handler, all the handlers which are customized for mesher are defined here. | ||
- For example you can import handler pkg in file cmd/mesher/mesher.go | ||
|
||
``` | ||
## SkyWalking-Handler Init | ||
**In cmd/mesher/mesher.go** | ||
```shell script | ||
import _ "github.com/apache/servicecomb-mesher/proxy/handler" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters