Skip to content
This repository has been archived by the owner on Dec 16, 2024. It is now read-only.

增加 library-guidelines.md 和 library-layout.md 的翻译。并更新结构和 open-telemetry/opentelemetry-specification 保持一致 #58

Merged
merged 3 commits into from
Mar 30, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
Empty file.
Binary file added specification/internal/img/library-design.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 specification/internal/img/library-full.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 specification/internal/img/library-minimal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
198 changes: 198 additions & 0 deletions specification/library-guidelines.md

Large diffs are not rendered by default.

97 changes: 97 additions & 0 deletions specification/library-layout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# OpenTelemetry工程结构
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# OpenTelemetry工程结构
# OpenTelemetry 工程结构


本文档展示了OpenTelemetry项目的基本的工程结构布局。对于包结构仅展示通用的部分,对某个特定语言的包结构不做强制要求。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
本文档展示了OpenTelemetry项目的基本的工程结构布局。对于包结构仅展示通用的部分,对某个特定语言的包结构不做强制要求。
本文档展示了 OpenTelemetry 项目的基本的工程结构布局。对于包结构仅展示通用的部分,对某个特定语言的包结构不做强制要求。

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修订。顺带看了下其他文档好像英文术语的单词都是首字母大写的?我也改成全部首字母大写了


## API 包结构

OpenTelemetry API推荐的包结构。

从最顶层目录开始的推荐包结构布局如下:

```
api
├── context
│ └── propagation
├── metrics
├── trace
│ └── propagation
├── baggage
│ └── propagation
├── internal
└── logs
```

> 选择全小写、驼峰命名还是蛇形命名规则取决于使用的语言。

### `/context`

本目录包含正在执行的context propagation的API。

### [/metrics](./metrics/api.md)

本目录包含用于记录应用Metrics数据的Metrics API。

### [/baggage](baggage/api.md)

本目录包含可以用于管理context propagation和与metrics相关的标签的 Baggage API.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

感觉中文英文句号没有统一,有些地方采用了中文有些地方英文

Copy link
Member Author

@owent owent Mar 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修订, 补了下issue。 #59


### [/trace](trace/api.md)

跟踪 API 包含一些主要的类:

- `Tracer` 用于所有的操作. 详见 [Tracer](trace/api.md#tracer) 章节.
- `Span` 是一个保存了当前执行的操作的可变对象. 详见 [Span](trace/api.md#span) 章节.

### `/internal` (_Optional_)

私有的库和应用代码.

### `/logs` (_In the future_)

> TODO: 日志操作

## SDK Package

OpenTelemetry SDK 推荐的包结构。

从最顶层目录开始的推荐包结构布局如下:

```
sdk
├── context
├── metrics
├── resource
├── trace
├── baggage
├── internal
└── logs
```

> 选择全小写、驼峰命名还是蛇形命名规则取决于使用的语言。

### `/sdk/context`

本目录包含api/context的SDK实现。

### `/sdk/metrics`

本目录包含api/metrics的SDK实现。

### [/sdk/resource](resource/sdk.md)

resource目录主要定义了[Resource](overview.md#resources)类型。该类型包含了统计和跟踪实体的信息。比如,
Kubernetes可以导出指向Kubernetes集群、命名空间、pod和容器名称的metrics。

### `/sdk/baggage`

### [/sdk/trace](trace/sdk.md)

本目录包含api/trace的SDK实现。

### `/sdk/internal` (_Optional_)

私有应用和库代码。

### `/sdk/logs` (_In the future_)

> TODO: 日志操作