AS AgentScopeAPI 手册 / API Reference

TracerRegistry

@Deprecated(forRemoval = true, since = "2.0.0") @SuppressWarnings("deprecation") public class TracerRegistry
源码Source 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()
staticsynchronized

启用追踪钩子。

Enables the global Reactor hook for tracing context propagation.

源码Source io/agentscope/core/tracing/TracerRegistry.java:83–135

disableTracingHook

public static synchronized void disableTracingHook()
staticsynchronized

禁用追踪钩子。

Disables the global Reactor hook for tracing context propagation.

源码Source io/agentscope/core/tracing/TracerRegistry.java:141–146

register

public static void register(Tracer tracer)
static

设置注册。

Registers a tracer for the legacy global tracing path.

参数Parameters
名称Name类型Type说明Description
tracerTracer追踪器(类型 `Tracer`)。The tracer.
源码Source io/agentscope/core/tracing/TracerRegistry.java:156–163

resetToNoop

public static void resetToNoop()
static

重置 resetToNoop。

Resets the to noop.

源码Source io/agentscope/core/tracing/TracerRegistry.java:165–170

get

public static Tracer get()
static

按条件读取数据。

Returns the get.

返回Returns Tracer
返回追踪器。Returns tracer.
源码Source io/agentscope/core/tracing/TracerRegistry.java:172–174
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.