TracerRegistry
@Deprecated(forRemoval = true, since = "2.0.0") @SuppressWarnings("deprecation") public class TracerRegistry
io/agentscope/core/tracing/TracerRegistry.java:47–175追踪器注册表,对智能体行为进行评测、追踪与可观测性分析。位于 io.agentscope.core.tracing 包。核心成员包括 enableTracingHook、disableTracingHook、register、resetToNoop、get。
Registry for the global Tracer instance.
Reactor global hook: This class provides methods to enable or disable
a global Reactor
hook (via #enableTracingHook() and #disableTracingHook())
that propagates
tracing context across Reactor operators. Enabling this hook affects
all Reactor
operations in the JVM, which may have performance implications even for code
unrelated to tracing.
Use with care, and only enable the hook if you require tracing context
propagation for all
Reactor pipelines.
Migration: New applications should configure an OpenTelemetry SDK through
OpenTelemetrySdk.builder().setTracerProvider(...).buildAndRegisterGlobal(), then attach
OtelTracingMiddleware to each agent. The middleware reads the globally registered
OpenTelemetry instance directly, so new code should not call #register(Tracer).
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public static synchronized void enableTracingHook()staticsynchronized | 启用追踪钩子。 Enables the global Reactor hook for tracing context propagation. |
public static synchronized void disableTracingHook()staticsynchronized | 禁用追踪钩子。 Disables the global Reactor hook for tracing context propagation. |
public static void register(Tracer tracer)static | 设置注册。 Registers a tracer for the legacy global tracing path. |
public static void resetToNoop()static | 重置 `resetToNoop`。 Resets the to noop. |
public static Tracer get()static | 按条件读取数据。 Returns the get. |
方法详情Method Detail
enableTracingHook
public static synchronized void enableTracingHook()
启用追踪钩子。
Enables the global Reactor hook for tracing context propagation.
io/agentscope/core/tracing/TracerRegistry.java:83–135disableTracingHook
public static synchronized void disableTracingHook()
禁用追踪钩子。
Disables the global Reactor hook for tracing context propagation.
io/agentscope/core/tracing/TracerRegistry.java:141–146register
public static void register(Tracer tracer)
设置注册。
Registers a tracer for the legacy global tracing path.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
tracer | Tracer | 追踪器(类型 `Tracer`)。The tracer. |
io/agentscope/core/tracing/TracerRegistry.java:156–163resetToNoop
public static void resetToNoop()
重置 resetToNoop。
Resets the to noop.
io/agentscope/core/tracing/TracerRegistry.java:165–170get
public static Tracer get()
按条件读取数据。
Returns the get.
Tracerio/agentscope/core/tracing/TracerRegistry.java:172–174