Skip to content

Commit

Permalink
md
Browse files Browse the repository at this point in the history
  • Loading branch information
dao-jun committed Oct 13, 2021
1 parent e40f9d8 commit a605179
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 2 deletions.
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
Hermes是提供给Java应用使用的Apm解决方案。
* 基于Apache Skywalking Agent Core.
1. 复用了对于byte-buddy的封装
2. 复用了logging日志模块
3. 复用了config配置
4. 复用了BootService
5. 做了一些优化定制


* Tracing协议基于Open-telemetry.
1. Skywalking在实现Open-tracing的时候做了一些选择。考虑到OAP对于异步Span的处理,会让一整个TraceSegment完全结束后再上报,有一定的内存压力。
2. Open-telemetry相对来说对于内存的使用会小一些,每个Span结束后就会立刻上报。
3. Open-telemetry的baggage相对难用,因此本项目自行实现了baggage.
4. 开源项目对于Open-telemetry的兼容性较好,CNCF成员,未来可期。


* UI
1. 阿里云链路追踪可接受jaeger协议的数据,链路图表功能不错,本项目使用阿里云链路追踪做UI
2. 阿里云指标计算和展示需要另外的服务。本项目暂未加上指标采集上报。
3. elastic-apm兼容原生Open-telemetry协议,图表非常好看,但是需要部署一个elastic-apm-server,架构相对复杂。
4. 阿里云链路追踪UI展示:![img_1.png](img_1.png)![img_2.png](img_2.png)![img_3.png](img_3.png) ![img_4.png](img_4.png)![img_5.png](img_5.png)![img_6.png](img_6.png)![img_7.png](img_7.png)

* 配置
1. 应用名和环境
1. hermes.app.name: 应用名
2. hermes.app.env: 环境(例如: dev、test、pre、pro)
2. 阿里云链路追踪
1. 需要开通阿里云链路追踪服务
2. 查看接入点信息。![img.png](img.png)
3. 配置接入点信息
1. 打开`HermesSpanExporter`
2. 修改of方法里面的host为你的接入点。例如:`host=tracing-analysis-dc-us-east-1.aliyuncs.com`
3. 修改of方法里面的auth为上图中的token字段(全部复制过来,token类似123@xxxx_123@yyy)
3. 跨线程
1. 修改`Config.Plugin.JdkThreading.THREAD_CLZ_PREFIXES`的配置,加上你的项目包名前缀,比如`com.taobao.buy2`

* 安装
1. 将该项目下载到本地
2. 执行`mvn clean install -Dmaven.test.skip=true`
3. mac用户将会在桌面上看到一个`hermes-agent`目录(windows用户请修改hermes-parent.pom、hermes-plugin.pom的相关属性)
4. 执行`java -javaagent:/path/to/hermes-agent/hermes-agent.jar -Dhermes.app.name=ur-app-name -Dhermes.app.env=dev -server -jar /path-to-your-app/app.jar`启动你的应用

Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ public static class Logging {


public static class Application {
public static final String NAME = System.getProperty("octopus.app.name", "unknown");
public static final String ENV = System.getProperty("octopus.app.env", "unknown");
public static final String NAME = System.getProperty("hermes.app.name", "unknown");
public static final String ENV = System.getProperty("hermes.app.env", "unknown");
}

public static class Plugin {
Expand Down
Binary file added img.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img_5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img_6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img_7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a605179

Please sign in to comment.