高性能C++实现LightStep追踪
项目描述
LightStep Streaming:我们的Python流式追踪器
流式Python追踪器是一个OpenTracing追踪器,它将数据发送到LightStep卫星。
此追踪器使用非阻塞I/O写入并发地向多个卫星发送数据。内存被仔细管理,以确保在报告过程中仅复制一次跨度,并将它们作为生成时流式传输到卫星,以避免内存溢出。流式Python追踪器是用C++编写的。这个C++核心周围有一个薄的Python包装器,因此库可以像其他Python模块一样导入。
设置
如果您不熟悉OpenTracing或LightStep,我们建议在继续之前先了解一下。
在安装之前,请确保您的系统满足以下要求
- Linux
- Python 2.7或>= 3.2.0(以及pip)
- opentracing PyPI模块(>=2.2.0)
要安装流式Python追踪器,请运行pip install lightstep-streaming
。
入门
OpenTracing的美丽之处在于所有跟踪器都遵循一个定义良好的API。唯一一个从跟踪器到跟踪器不同的步骤是设置步骤,当调用lightstep_streaming.Tracer
的构造函数时。以下是一个示例程序,说明如何使用Streaming Python Tracer创建一个新的Tracer对象。有关创建Tracer对象后如何使用该对象的更多详细信息,请参阅OpenTracing Python API指南。
import lightstep_streaming
tracer = lightstep_streaming.Tracer(
component_name='[your service name]',
access_token='[your LightStep access token]',
# Use these defaults unless you know what you're doing
use_stream_recorder=True,
collector_plaintext=True,
# You can put any number of Satellite endpoints in this list and the tracer
# will rotate through them and send spans to each one.
satellite_endpoints=[{'host': 'localhost', 'port': 8360}],
# Turns off verbose logging, which is really only useful for debugging.
verbose=False
)
# Generates one span
with tracer.start_active_span('[your operation name]'):
pass
# Makes sure that the tracer has sent the span to a Satellite
tracer.flush()
Streaming Python Tracer配置参数的完整列表可在tracer_configuration.schema.json中找到。如果您想查看源代码,可以在LightStep C++ Tracer仓库中找到。
项目详情
关闭
哈希(lightstep_streaming-0.14.0-cp32-abi3-manylinux1_x86_64.whl)
算法 | 哈希摘要 | |
---|---|---|
SHA256 | bd1e28655c6916c65886f0f494218098aa51b3dd55a879e750abc3b1d98c6f20 |
|
MD5 | 044ae3e9b7c4dcc4e0ef3192e474f2ca |
|
BLAKE2b-256 | 7504b26ef51829ad7b86cbde2c06060431abded440d2aeba4953255495039dc0 |
关闭
哈希(lightstep_streaming-0.14.0-cp27-cp27mu-manylinux1_x86_64.whl)
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 9dbea42825c2bf4dc9d773f936b067e9b24dbe6dcd6e0d26bbf85b7f8605aaad |
|
MD5 | 9149f6b7d20c6f86e8b986d5fbbe31a1 |
|
BLAKE2b-256 | 88e73f1c9eafb3525a4626f9ad95ba720c0caad23309b47edfcd905ee0a6f5c2 |
关闭
哈希(lightstep_streaming-0.14.0-cp27-cp27m-manylinux1_x86_64.whl)
算法 | 哈希摘要 | |
---|---|---|
SHA256 | b6bd25f88a5b34ccc695fa013f72feb626483fccd063e16c9dfd4d1b6450f86e |
|
MD5 | c74997696b3c7cb058da1a88f6ee7fb6 |
|
BLAKE2b-256 | 520b4257ef28a3a4ed5f506946d1bef9c64db8e87876b58607afeda1f257e83c |