[![Build Status][ci-img]][ci] [![Coverage Status][cov-img]][cov] [![PyPI version][pypi-img]][pypi]
# Jaeger Bindings for Python OpenTracing API
This is a client-side library that can be used to instrument Python apps
for distributed trace collection, and to send those traces to Jaeger.
See the [OpenTracing Python API](https://github.com/opentracing/opentracing-python)
for additional detail.
## Installation
```bash
apt-get install python-dev
pip install jaeger-client
```
## Getting Started
(under construction)
If your python code is already instrumented for OpenTracing,
you can simply switch to Jaeger's implementation with:
```python
import opentracing
from jaeger_client import Config
if __name__ == "__main__":
config = Config(config={}, # usually read from some yaml config
service_name='your-app-name')
tracer = config.initialize_tracer()
with opentracing.tracer.start_span('TestSpan') as span:
span.log_event('test message', payload={'life': 42})
tracer.close() # flush any buffered spans
```
## Configuration
(under construction)
See [Config class](jaeger_client/config.py).
## Debug Traces (Forced Sampling)
### Programmatically
The OpenTracing API defines a `sampling.priority` standard tag that
can be used to affect the sampling of a span and its children:
```python
from opentracing.ext import tags as ext_tags
span.set_tag(ext_tags.SAMPLING_PRIORITY, 1)
```
### Via HTTP Headers
Jaeger Tracer also understands a special HTTP Header `jaeger-debug-id`,
which can be set in the incoming request, e.g.
```sh
curl -H "jaeger-debug-id: some-correlation-id" http://myhost.com
```
When Jaeger sees this header in the request that otherwise has no
tracing context, it ensures that the new trace started for this
request will be sampled in the "debug" mode (meaning it should survive
all downsampling that might happen in the collection pipeline), and
the root span will have a tag as if this statement was executed:
```python
span.set_tag('jaeger-debug-id', 'some-correlation-id')
```
This allows using Jaeger UI to find the trace by this tag.
## License
[The MIT License](LICENSE).
[ci-img]: https://travis-ci.org/uber/jaeger-client-python.svg?branch=master
[ci]: https://travis-ci.org/uber/jaeger-client-python
[cov-img]: https://coveralls.io/repos/uber/jaeger-client-python/badge.svg?branch=master
[cov]: https://coveralls.io/github/uber/jaeger-client-python?branch=master
[pypi-img]: https://badge.fury.io/py/jaeger-client.svg
[pypi]: https://badge.fury.io/py/jaeger-client
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
jaeger-client-3.2.0.tar.gz (71个子文件)
jaeger-client-3.2.0
MANIFEST.in 236B
PKG-INFO 546B
requirements-dev.txt 14B
requirements-tests.txt 65B
jaeger_client
constants.py 3KB
local_agent_net.py 5KB
ioloop_util.py 3KB
reporter.py 8KB
utils.py 3KB
metrics.py 3KB
tracer.py 8KB
TUDPTransport.py 2KB
thrift_gen
agent
constants.py 262B
ttypes.py 438B
__init__.py 43B
Agent.py 5KB
__init__.py 0B
sampling
constants.py 262B
ttypes.py 8KB
SamplingManager.py 8KB
__init__.py 53B
zipkincore
constants.py 549B
ZipkinCollector.py 8KB
ttypes.py 21KB
__init__.py 53B
span.py 8KB
__init__.py 2KB
sampler.py 10KB
span_context.py 2KB
codecs.py 9KB
thrift.py 7KB
config.py 10KB
tests
test_utils.py 3KB
test_span.py 5KB
test_codecs.py 12KB
conftest.py 1KB
test_tracer_benchmark.py 4KB
test_config.py 3KB
test_thrift.py 6KB
__init__.py 0B
test_api.py 2KB
test_sampler.py 5KB
test_span_context.py 2KB
test_noop_tracer.py 2KB
test_TUDPTransport.py 2KB
test_metrics.py 2KB
test_crossdock.py 4KB
test_tracer.py 9KB
test_reporter.py 10KB
setup.cfg 449B
requirements.txt 37B
setup.py 2KB
jaeger_client.egg-info
PKG-INFO 546B
requires.txt 267B
not-zip-safe 1B
SOURCES.txt 2KB
top_level.txt 24B
dependency_links.txt 1B
Makefile 2KB
CHANGELOG.rst 1KB
README.md 2KB
crossdock
server
constants.py 38B
server.py 8KB
thriftrw_serializer.py 1KB
__init__.py 0B
serializer.py 3KB
thrift_gen
__init__.py 24B
tracetest
constants.py 262B
ttypes.py 18KB
__init__.py 51B
TracedService.py 13KB
共 71 条
- 1
资源评论
挣扎的蓝藻
- 粉丝: 13w+
- 资源: 15万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- MFC IE控件使用方式
- 基于STM32的电子罗盘
- 21108229王子涵.ipynb
- 基于STM32的压力检测系统
- 基于STM32的温度计,将手机与蓝牙连接,在android应用程序上显示当前温度
- 前端开发基础入门教程 JavaScript语言编程基础教程 共5个章节.rar
- MFC IE控件使用方式
- 前端开发基础入门教程 JavaScript语言编程基础教程 第5章 JS实战 共16页.pptx
- 前端开发基础入门教程 JavaScript语言编程基础教程 第4章 DHTML 共30页.pptx
- 前端开发基础入门教程 JavaScript语言编程基础教程 第3章 客户端JavaScript 共38页.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功