Agent-RL Observability SDK — lightweight OpenTelemetry-based tracing
Project description
agent-rl-observability
轻量级可观测性 SDK,基于 OpenTelemetry,为 Agent-RL 平台提供分布式追踪能力。
安装
pip install agent-rl-observability
# 启用自动埋点(httpx 等第三方库)
pip install agent-rl-observability[auto]
# 启用完整功能(含 FastAPI 可视化端点)
pip install agent-rl-observability[full]
快速开始
from observability import setup_otel, trace, trace_span
setup_otel()
@trace("my.service.action")
def my_function():
with trace_span("sub.operation"):
pass
功能
| 模块 | 说明 |
|---|---|
core |
OTel 初始化、装饰器、TraceContext 传播、配置 |
auto_instrumentation |
httpx / requests / aiohttp / aiomysql / redis / aiokafka 自动埋点 |
middleware |
FastAPI / Starlette ASGI 中间件 |
api |
Trace 查看、瀑布图可视化、耗时分析端点 |
collector_protocol |
与 Collector 服务的数据契约 |
配置
通过环境变量配置:
| 变量 | 默认值 | 说明 |
|---|---|---|
OTEL_SERVICE_NAME |
"unknown" |
服务名 |
OTEL_EXPORTER_OTLP_ENDPOINT |
"http://localhost:4318" |
OTLP 导出地址 |
OBS_DISABLED |
"false" |
禁用可观测性 |
架构
业务服务 ──OTLP──▶ Collector 服务 ──▶ OceanBase / 告警
↑
@trace / trace_span / AutoTraceMiddleware
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
agent_rl_observability-0.2.1.tar.gz
(113.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agent_rl_observability-0.2.1.tar.gz.
File metadata
- Download URL: agent_rl_observability-0.2.1.tar.gz
- Upload date:
- Size: 113.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e06ad682c854d9a8e26e10a3f3a5bec1ec8bd75a7787e45737d4c8488c007e11
|
|
| MD5 |
6422a1f3d40c265e2dc17d7f04e9fe53
|
|
| BLAKE2b-256 |
d5554f721213cc5e8066f9e880b6ac724a1a4643b1d04820ff2e3672458c0ffb
|
File details
Details for the file agent_rl_observability-0.2.1-py3-none-any.whl.
File metadata
- Download URL: agent_rl_observability-0.2.1-py3-none-any.whl
- Upload date:
- Size: 133.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
55126d36f7e42b0d1a2952cc14b6d4334a019b8a043a47d21e2bd606b7a9edb0
|
|
| MD5 |
a5055e8f0bde65b153506b0e538f75ee
|
|
| BLAKE2b-256 |
ca31b7d329ef3acd4591f9df7793f8a827b51c3642d081fd15f6ad6a3da37ea6
|