# Python

> <img width="35" class="img-initial otel-icon" src="/img/logos/32x32/Python_SDK.svg" alt="Python"> A language-specific implementation of OpenTelemetry in Python.

---

LLMS index: [llms.txt](/llms.txt)

---


这是 OpenTelemetry Python 的文档。 OpenTelemetry 是一个可观测性框架，这个框架提供了
API、SDK 以及一系列工具，用于辅助生成以及收集应用的遥测数据，比如链路、指标、日志。
通过本文档，你将了解如何开始使用 OpenTelemetry Python。

## 状态以及版本发布 {#status-and-releases}

OpenTelemetry Python 的当前主要功能组件状态如下：

| 链路                | 指标                 | 日志              |
| ------------------- | -------------------- | ----------------- |
| [Stable](/docs/specs/otel/versioning-and-stability/#stable) | [Stable](/docs/specs/otel/versioning-and-stability/#stable) | [Development](/docs/specs/otel/versioning-and-stability/#development) |

我们可以在 [Releases][] 中找到所有已发布的版本，包括[最新发布的版本][latest release]。 

[latest release]: <https://github.com/open-telemetry/opentelemetry-python/releases/latest>
[Releases]: <https://github.com/open-telemetry/opentelemetry-python/releases>
{{__hugo_ctx/}}


## Version support

OpenTelemetry-Python supports Python 3.9 and higher.

## Installation

The API and SDK packages are available on PyPI, and can be installed via pip:

```sh
pip install opentelemetry-api
pip install opentelemetry-sdk
```

In addition, there are several extension packages which can be installed
separately as:

```sh
pip install opentelemetry-exporter-{exporter}
pip install opentelemetry-instrumentation-{instrumentation}
```

These are for exporter and instrumentation libraries respectively. The Jaeger,
Zipkin, Prometheus, OTLP and OpenCensus Exporters can be found in the
[exporter](https://github.com/open-telemetry/opentelemetry-python/blob/main/exporter/)
directory of the repository. Instrumentations and additional exporters can be
found in the contrib repository
[instrumentation](https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation)
and
[exporter](https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/exporter)
directories.

## Extensions

To find related projects like exporters, instrumentation libraries, tracer
implementations, etc., visit the [Registry](/ecosystem/registry/?s=python).

### Installing Cutting-edge Packages

There is some functionality that has not yet been released to PyPI. In that
situation, you may want to install the packages directly from the repository.
This can be done by cloning the repository and doing an
[editable install](https://pip.pypa.io/en/stable/reference/pip_install/#editable-installs):

```sh
git clone https://github.com/open-telemetry/opentelemetry-python.git
cd opentelemetry-python
pip install -e ./opentelemetry-api -e ./opentelemetry-sdk -e ./opentelemetry-semantic-conventions
```

## Repositories and benchmarks

- Main repository: [opentelemetry-python][]
- Contrib repository: [opentelemetry-python-contrib][]

[opentelemetry-python]: https://github.com/open-telemetry/opentelemetry-python
[opentelemetry-python-contrib]:
  https://github.com/open-telemetry/opentelemetry-python-contrib

---

Section pages:

- [Getting Started](/zh/docs/languages/python/getting-started/): Get telemetry for your app in less than 5 minutes!
- [Instrumentation](/zh/docs/languages/python/instrumentation/): Manual instrumentation for OpenTelemetry Python
- [Using instrumentation libraries](/zh/docs/languages/python/libraries/)
- [Exporters](/zh/docs/languages/python/exporters/): Process and export your telemetry data
- [Propagation](/zh/docs/languages/python/propagation/): Context propagation for the Python SDK
- [Cookbook](/zh/docs/languages/python/cookbook/)
- [OpenTelemetry Distro](/zh/docs/languages/python/distro/)
- [Using mypy](/zh/docs/languages/python/mypy/)
- [Benchmarks](/zh/docs/languages/python/benchmarks/)
- [API reference](/zh/docs/languages/python/api/)
- [Examples](/zh/docs/languages/python/examples/)
- [Registry](/zh/docs/languages/python/registry/): Instrumentation libraries, exporters and other useful components for OpenTelemetry Python
