# EGO 1.0.3 release

# 更好的维护EGO-Component

为了更好的维护组件,我们将https://github.com/gotomicro/ego-component (opens new window)做了拆包处理 现在新版本的组件在 https://github.com/ego-component (opens new window)

升级方式

# 1 在goland中全局替换 github.com/gotomicro/ego-component => github.com/ego-component
# 2 删除 go.mod 中的 github.com/gotomicro/ego-component
# 3 go mod tidy
# 4 升级成功
1
2
3
4

# 新版本特效

# 1 EGO组件支持otel

gRPC Client、HTTP Client、gRPC Server、HTTP Server、MySQL、Redis、Kafka组件已按照官方标准支持otel

# 2 EGO组件增强DEBUG模式能力

debug模式的六元组能力:代码行号、配置名、目标地址、耗时、请求数据、响应数据

gRPC、HTTP、MySQL、Redis、Kafka、Mongo 客户端组件在EGO_DEBUG模式下,支持直接打印业务代码运行的真正路径,在IDE模式下,可以直接点击该链接跳转到对应的代码地方

gRPC的debug模式 img.png

kafka的debug模式 img.png

# 3 HTTP、gRPC服务在Prometheus的Exemplar特性

EGO的HTTP,gRPC服务都可以使用Prometheus的Exemplar特性,在metric中写入otel的trace id。这样我们就可以在metric中,看到最慢的趋势,在图中找到trace id,去trace或者log中查看变慢的原因。 img.png

# 4 Gorm、Redis支持更强大的stat监控模式

  • 我们可以通过gorm的wait_count、wait_duration等9个监控指标,可以看到Go MySQL Client是否阻塞
  • 我们可以通过redis的idle_conns、total_conns等6个监控指标,可以看到Go Redis Client是否阻塞

在高并发条件下,监控这些指标,可以很方便帮助我们排查我们的连接数设置不合理。如果指标存在异常,可以优化连接池配置。

以下是一个压测过程中,可以看到MySQL的连接数耗尽,导致大量在go内部的阻塞和等待时间。这个并发在MySQL服务端是体现不出任何异常,只会导致Go MySQL Client内部的阻塞。 以下是一个MySQL客户端阻塞的请求数图 img.png 以下是一个MySQL客户端阻塞的等待时间图 img.png

使用以上功能,请升级gorm,redis版本

go get github.com/ego-component/egorm@v1.0.4
go get github.com/ego-component/eredis@v1.0.3
1
2

# 5 补充大量文档

在每个组件的 https://github.com/ego-component (opens new window) Readme里补充了相应的文档

Component Name Code Example Doc
HTTP Server Code (opens new window) Example (opens new window) Doc (opens new window)
gRPC Server Code (opens new window) Example (opens new window) Doc (opens new window)
Governance Service Code (opens new window) Example (opens new window) Doc (opens new window)
Job Code (opens new window) Example (opens new window) Doc (opens new window)
Corn job Code (opens new window) Example (opens new window) Doc (opens new window)
Distributed Scheduled Job Code (opens new window) Example (opens new window) Doc (opens new window)
HTTP Client Code (opens new window) Example (opens new window) Doc (opens new window)
gRPC Client Code (opens new window) Example (opens new window) Doc (opens new window)
gRPC Client using ETCD Code (opens new window) Example (opens new window) Doc (opens new window)
gRPC Client using k8s Code (opens new window) Example (opens new window) Doc (opens new window)
Sentinel Code (opens new window) Example (opens new window) Doc (opens new window)
MySQL Code (opens new window) Example (opens new window) Doc (opens new window)
Redis Code (opens new window) Example (opens new window) Doc (opens new window)
Redis Distributed lock Code (opens new window) Example (opens new window) Doc (opens new window)
Mongo Code (opens new window) Example (opens new window) Doc (opens new window)
Kafka Code (opens new window) Example (opens new window) Doc (opens new window)
ETCD Code (opens new window) Example (opens new window) Doc (opens new window)
K8S Code (opens new window) Example (opens new window) Doc (opens new window)
Oauth2 Code (opens new window) Example (opens new window)

# 欢迎大家使用EGO

上次更新: 2022-04-22 09:25:17