python的作用域代理
scopeagent的Python项目详细描述
python代理
python代理Scope
安装
pip install scopeagent
用法
首先,从作用域安装中获取api密钥。
然后,在启动命令前面加上scope-run
:
scope-run python run my_app.py
scope-run gunicorn myapp.wsgi
scope-run python -m unittest discover
参数
Flag | Required? | Default | Description | Environment variable |
---|---|---|---|---|
^{ | Y | API key tog use when sending data to Scope | ^{ | |
^{ | Y | API endpoint of the Scope installation to send data to | ^{ | |
^{ | N | ^{ | Service name to use when sending data to Scope | ^{ |
^{ | N | ^{ | Commit hash to use when sending data to Scope | ^{ |
^{ | N | ^{ | Repository URL to use when sending data to Scope | ^{ |
^{ | N | ^{ | Repository root path | ^{ |
如果通过环境变量在Circleci或Jenkins上运行,则将自动检测提交、存储库和源根信息。
高级使用
如果上述设置不适用于您的特定设置, 您还可以通过尽早运行以下命令来安装范围代理 在您的代码中(因为它需要修补支持的库):
importscopeagentagent=scopeagent.Agent(api_key="xxxxxxxx",api_endpoint="https://scope.mycompany.corp")agent.install()
支持的库
Name | Span/event creation | Extract | Inject |
---|---|---|---|
^{ | * | ||
^{ | * | * | |
^{ | * | * | |
^{ | * | ||
^{ | * | ||
^{ | * | * | * |
^{ | * |
开发
自动测试
以下环境变量用于数据库测试:
POSTGRES_DBURL
致谢
有些代码是从uber的opentracing-python-instrumentation (mit许可证)中复制出来的,或者是受其启发的。原始版权声明保存在复制的文件中。
许可证
版权所有©2019 Undefined Labs,Inc.保留所有权利。
该软件包括在开源许可下发布的第三方组件。查看NOTICE.md了解详细信息。