Skip to content

Commit

Permalink
move docker files to a new folder
Browse files Browse the repository at this point in the history
  • Loading branch information
eventhorizon-cli committed Jan 20, 2024
1 parent cc842d2 commit f0950ae
Show file tree
Hide file tree
Showing 13 changed files with 150 additions and 28 deletions.
19 changes: 18 additions & 1 deletion Mocha.sln
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
LICENSE = LICENSE
README.md = README.md
.github\workflows\dotnet-build.yml = .github\workflows\dotnet-build.yml
docker-compose.yml = docker-compose.yml
README.zh-CN.md = README.zh-CN.md
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mocha.Storage", "src\Mocha.Storage\Mocha.Storage.csproj", "{8EEB6697-B975-430D-9CC3-3048E76C5ECA}"
Expand All @@ -41,6 +41,21 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "mysql", "mysql", "{1DCDFC33
scripts\mysql\init.sql = scripts\mysql\init.sql
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docker", "docker", "{D598862A-999C-40FD-A190-EBD00376D077}"
ProjectSection(SolutionItems) = preProject
docker\docker-compose.yml = docker\docker-compose.yml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "distributor", "distributor", "{959DCB4E-A070-4C66-A27F-D83CB933F0D8}"
ProjectSection(SolutionItems) = preProject
docker\distributor\Dockerfile = docker\distributor\Dockerfile
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "jaeger-query", "jaeger-query", "{C7222A9C-C50C-4FF0-A02D-778A9BB4DD2C}"
ProjectSection(SolutionItems) = preProject
docker\jaeger-query\Dockerfile = docker\jaeger-query\Dockerfile
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -57,6 +72,8 @@ Global
{FC0D810E-4ACC-4567-95D8-D7F617E412FE} = {24F9E34A-D92A-4C0A-851F-1E864181BF97}
{DC281C3B-455F-4391-92EF-D5D99FC2B9AA} = {6983D239-07DA-4DFA-9AAA-F6876029FF8D}
{1DCDFC33-1401-4CCA-AAAE-FC150AD147F5} = {53AF2923-4CB8-44C8-885B-B0EEB8574FEB}
{959DCB4E-A070-4C66-A27F-D83CB933F0D8} = {D598862A-999C-40FD-A190-EBD00376D077}
{C7222A9C-C50C-4FF0-A02D-778A9BB4DD2C} = {D598862A-999C-40FD-A190-EBD00376D077}
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{DCA600F0-4D6C-44DA-A493-F63097CCE74E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
Mocha
=====

[![codecov](https://codecov.io/gh/dotnetcore/mocha/branch/main/graph/badge.svg)](https://app.codecov.io/gh/dotnetcore/mocha)
[![codecov](https://codecov.io/gh/dotnetcore/mocha/graph/badge.svg?token=v9OE7dV8ZS)](https://codecov.io/gh/dotnetcore/mocha)

[English](./README.md) | [简体中文](./README.zh-CN.md)

Mocha is an application performance monitor tools based on [OpenTelemetry](https://opentelemetry.io), which also provides a scalable platform for observability data analysis and storage.

## Quick Start
In the beta phase, we provide a Docker Compose file for users to experience our system locally.

[Quick Start 简体中文](./docs/quick-start/docker-compose/quick-start.zh-CN.md)
+ [Quick Start](./docs/quick-start/docker-compose/quick-start.en-US.md)

## Functional architecture
## Functional Architecture
![](./docs/assets/functional_architecture.png)

The set of features that Mocha will provide:
Expand All @@ -30,7 +32,7 @@ The set of features that Mocha will provide:
- Alert notifications
- Metrics/Logs/Traces data explore

## Technical architecture
## Technical Architecture
![](./docs/assets/technical_architecture.png)

The components of Mocha are as follows:
Expand Down
50 changes: 50 additions & 0 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
Mocha
=====

[![codecov](https://codecov.io/gh/dotnetcore/mocha/graph/badge.svg?token=v9OE7dV8ZS)](https://codecov.io/gh/dotnetcore/mocha)

[English](./README.md) | [简体中文](./README.zh-CN.md)

Mocha 是一个基于 [OpenTelemetry](https://opentelemetry.io) 的 APM 系统,同时提供可伸缩的可观测性数据分析和存储平台。

## 快速开始
现阶段,我们提供了 Docker Compose 文件,方便用户在本地体验我们的系统。

+ [快速开始](./docs/quick-start/docker-compose/quick-start.zh-CN.md)

# 平台功能
![](./docs/assets/functional_architecture.png)
Mocha 将要提供的功能集合:
- APM 和 分布式追踪
- 服务概览、R.E.D 指标和可用性监控
- 服务拓扑
- 调用监控,包括 HTTP、RPC、Cache、DB、MQ 等
- 调用链路查询和检索
- 基础设施监控
- 主机监控
- 容器和 Kubernetes 监控
- 主流中间件监控
- 日志
- 日志查询
- 日志聚合分析
- 报警
- 报警规则管理
- 报警通知
- M.T.L 数据探索 [Data Explore / Inspect]

# 技术架构
![](./docs/assets/technical_architecture.png)

Mocha 整体架构由下面的部分组成
- Mocha Distributor Cluster:作为 mocha 系统的数据入口,负责接收 OTel SDK 和 Collector 上报的数据,并通过一致性Hash 将数据路由到对应的 aggregator 节点上。为了保证数据不丢失,最终 Distributor 应该具备本地 FIFO 队列的能力。
- Mocha Streaming Cluster:mocha 的核心组件,通过读取预配置或者用户配置的 aggr rule dsl 生成对应的 streaming data flow 并执行。Streaming 是具备分布式 shuffle 的能力的有状态组件,需要将自身信息注册到ETCD中。
- Storage:mocha M.T.L 存储,可以选用开源存储组件,如 ClickHouse、ElasticSearch、victoriametrics 等。
- Mocha Querier + Grafana: 从存储查询数据并提供给 grafana 做展示。因此要兼容 promql / jeager / loki 等数据源的查询。
- Mocha Manager : 包括 manager server、dashboard和ETCE组件,集群元数据和 M.T.L 数据分析规则存储。
- OTel SDK / Collector : 开源 OpenTelemetry 采集套件。

## 参与贡献
参与贡献的最简单的方式是参与讨论并讨论问题。您也可以通过提交代码更改的拉取请求来进行贡献。

## 许可证
Mocha 是在 MIT 许可下发布的。有关详细信息,请参阅 [LICENSE](LICENSE) 文件。
File renamed without changes.
15 changes: 10 additions & 5 deletions docker-compose.yml → docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

version: "3.8"

name: mocha

services:
mysql:
image: mysql:8.2.0
Expand All @@ -17,8 +19,9 @@ services:
expose:
- "3306"
volumes:
- ./scripts/mysql/init.sql:/docker-entrypoint-initdb.d/init.sql
- ../scripts/mysql/init.sql:/docker-entrypoint-initdb.d/init.sql
# - ./mysql:/var/lib/mysql
restart: always
networks:
- mocha

Expand All @@ -29,13 +32,14 @@ services:
- "3000:3000"
# volumes:
# - ./grafana:/var/lib/grafana
restart: always
networks:
- mocha

distributor:
build:
context: .
dockerfile: ./src/Mocha.Distributor/Dockerfile
context: ..
dockerfile: ./docker/distributor/Dockerfile
container_name: mocha-distributor
ports:
- "4317:4317"
Expand All @@ -53,8 +57,8 @@ services:

jaeger-query:
build:
context: .
dockerfile: ./src/Mocha.Query.Jaeger/Dockerfile
context: ..
dockerfile: ./docker/jaeger-query/Dockerfile
container_name: mocha-jaeger-query
ports:
- "5775:5775"
Expand All @@ -66,6 +70,7 @@ services:
- Logging__LogLevel__Microsoft.EntityFrameworkCore=Warning
depends_on:
- mysql
restart: always
networks:
- mocha

Expand Down
File renamed without changes.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 53 additions & 0 deletions docs/quick-start/docker-compose/quick-start.en-US.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
## Start the Project

Execute the following command in the docker directory under the project root directory to start the project:

```bash
docker-compose up -d
```

After the startup is successful, you can see the following containers:

+ distributor: Provides gRPC API for receiving OTLP data
+ jaeger-query: Provides HTTP API for receiving Jaeger query protocol
+ mysql: Used to store data
+ grafana: Used to display data

## Send Trace Data

Configure the OTLP exporter of the SDK as `http://localhost:4317` to send data to the distributor.

## Configure Jaeger Data Source

We have implemented an API that supports the Jaeger query protocol, so you can configure the Jaeger data source directly in Grafana.

Visit http://localhost:3000/ to see the grafana login page. Both the username and password are admin.

After logging in, click the menu on the left, select Data Sources, and then click Add data source.

![](./asserts/add-jaeger-data-source.png)

![](./asserts/add-jaeger-data-source-2.png)

Select Jaeger.
![](./asserts/add-jaeger-data-source-3.png)

Configure the URL of the Jaeger data source as `http://jaeger-query:5775`.

![](./asserts/add-jaeger-data-source-4.png)

Click Save & Test. If the following information is displayed, the configuration is successful.

![](./asserts/add-jaeger-data-source-5.png)

If no data has been sent to the distributor yet, the following warning message will be displayed.

![](./asserts/add-jaeger-data-source-warning.png)

## Query Trace Data

Click the menu on the left, select Explore, and then select the Jaeger data source to see the Trace data.

![](./asserts/query-trace.png)

![](./asserts/query-trace-2.png)
15 changes: 11 additions & 4 deletions docs/quick-start/docker-compose/quick-start.zh-CN.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## 启动项目

在项目根目录下,执行以下命令启动项目:
在项目根目录下的docker目录中,执行以下命令启动项目:

```bash
docker-compose up -d
Expand All @@ -17,7 +17,7 @@ docker-compose up -d

将 SDK 的 OTLP exporter 配置为 `http://localhost:4317` 即可将数据发送到 distributor。

## Trace 数据的查询
## 配置 Jaeger 数据源

我们实现了支持 Jaeger 查询协议的 API,因此可以直接在 Grafana 中配置 Jaeger 数据源。

Expand All @@ -38,5 +38,12 @@ docker-compose up -d
点击 Save & Test,如果显示如下信息,则说明配置成功。
![](./asserts/add-jaeger-data-source-5.png)

这边建议先往 Distributor 发送一些数据,然后再点击 Save & Test,否则会报错。
![](./asserts/add-jaeger-data-source-error.png)
如果还没往 distributor 发送过数据,会显示如下警告信息。
![](./asserts/add-jaeger-data-source-warning.png)

## Trace 数据的查询

点击左侧的菜单,选择 Explore,然后选择 Jaeger 数据源,即可看到 Trace 数据。
![](./asserts/query-trace.png)

![](./asserts/query-trace-2.png)
6 changes: 0 additions & 6 deletions src/Mocha.Distributor/Mocha.Distributor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,4 @@
<ProjectReference Include="..\Mocha.Storage\Mocha.Storage.csproj"/>
</ItemGroup>

<ItemGroup>
<Content Include="..\..\.dockerignore">
<Link>.dockerignore</Link>
</Content>
</ItemGroup>

</Project>
10 changes: 2 additions & 8 deletions src/Mocha.Query.Jaeger/Mocha.Query.Jaeger.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,8 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Mocha.Core\Mocha.Core.csproj" />
<ProjectReference Include="..\Mocha.Storage\Mocha.Storage.csproj" />
</ItemGroup>

<ItemGroup>
<Content Include="..\..\.dockerignore">
<Link>.dockerignore</Link>
</Content>
<ProjectReference Include="..\Mocha.Core\Mocha.Core.csproj"/>
<ProjectReference Include="..\Mocha.Storage\Mocha.Storage.csproj"/>
</ItemGroup>

</Project>

0 comments on commit f0950ae

Please sign in to comment.