2023-05-21 01:46:52 +08:00
|
|
|
|
# chassis <ˈʃæsi>
|
2023-05-21 01:34:58 +08:00
|
|
|
|
|
2023-05-21 01:46:52 +08:00
|
|
|
|
chassis <ˈʃæsi> n. 底盘,底架
|
|
|
|
|
|
2023-05-23 22:22:04 +08:00
|
|
|
|
仓库名寓意服务的底盘,基础库。搭建微服务底盘是为了简化服务的创建过程,同时确保开发者遵循这套开发标准。
|
|
|
|
|
|
|
|
|
|
## 包含的特性
|
|
|
|
|
|
|
|
|
|
1. 微服务模板代码
|
2023-05-26 13:49:44 +08:00
|
|
|
|
2. 可观测 Observability
|
|
|
|
|
1. Metrics
|
|
|
|
|
- Statsd + Prometheus + Grafana)
|
|
|
|
|
2. Logging
|
|
|
|
|
- ELK
|
|
|
|
|
3. Tracing
|
|
|
|
|
- TODO, Maybe OpenTelemetry
|
|
|
|
|
4. Error Reporting
|
|
|
|
|
- Sentry
|
2023-05-23 22:22:04 +08:00
|
|
|
|
3. 数据存储相关 utils
|
|
|
|
|
1. Sqlalchemy
|
|
|
|
|
- 连接池
|
|
|
|
|
- 读写分离
|
|
|
|
|
2. Redis
|
|
|
|
|
- 连接池
|
|
|
|
|
3. ElasticSearch
|
|
|
|
|
4. 服务注册和发现 (RabbitMQ)
|
|
|
|
|
5. 健康检查 (TODO)
|
|
|
|
|
6. 配置获取 (TODO)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## 实现的功能
|
|
|
|
|
|
|
|
|
|
- 服务注册和发现
|
2023-05-22 15:54:01 +08:00
|
|
|
|
- 可观测
|
2023-05-23 22:22:04 +08:00
|
|
|
|
- 同步/异步传输
|
2023-05-22 15:54:01 +08:00
|
|
|
|
- 负载均衡
|
|
|
|
|
- 限流降级(消息确认+熔断)
|
|
|
|
|
|
|
|
|
|
|
2023-05-23 22:22:04 +08:00
|
|
|
|
## 安装方法
|
|
|
|
|
|
|
|
|
|
基础代码库:
|
|
|
|
|
`python3 -m pip install --trusted-host=gitea.bearcatlog.com git+https://gitea.bearcatlog.com/BryantStudio/chassis.git@main`
|
|
|
|
|
|
|
|
|
|
基础代码库依赖的服务:
|
|
|
|
|
`python3 -m pip install --trusted-host=gitea.bearcatlog.com git+https://gitea.bearcatlog.com/BryantStudio/chassis-agent.git@main`
|