mod plugin_component#

module plugin_component#

Built-in observability plugin component.

This module packages NeMo Relay’s first-party observability exporters behind the shared plugin configuration system. Each exporter section is opt-in: omitted sections and sections with enabled = false validate but do not register subscribers or construct exporters.

The plugin intentionally infers subscriber names from the component namespace so configuration remains portable across bindings. Agent Trajectory Observability Format (ATOF), OpenTelemetry, and OpenInference each register one global subscriber when enabled. Agent Trajectory Interchange Format (ATIF) uses a global dispatcher that detects top-level agent scopes and creates one scope-local exporter for each trajectory run. Coding-agent turns that need bounded traces are represented as agent scopes with role metadata.

Variables

const OBSERVABILITY_PLUGIN_KIND: &str#

The plugin kind registered by the core crate.

Functions

fn deregister_observability_component() -> bool#

Deregisters the observability component kind from the core plugin registry.

This helper exists primarily for tests and specialized embedding scenarios. It removes the plugin kind from future registry lookups but does not clear an already active plugin configuration.

fn observability_config_schema() -> serde_json::Value#

Returns the JSON Schema for the observability component configuration.

fn register_observability_component() -> PluginResult<()>#

Registers the observability component kind in the core plugin registry.

Calling this function more than once is safe. The core plugin APIs call it automatically before listing, looking up, validating, or initializing plugin components, so applications normally do not need to invoke it directly.

Structs and Unions

struct AtifSectionConfig#

Per-trajectory ATIF exporter config.

When enabled, this section creates a dispatcher that opens a separate crate::observability::atif::AtifExporter for each top-level agent or turn scope. The {session_id} placeholder in AtifSectionConfig::filename_template is required so concurrent sibling trajectories cannot overwrite each other’s files.

enabled: bool#

Whether ATIF export is active.

agent_name: String#

Human-readable agent name.

agent_version: String#

Agent version string.

model_name: String#

Default model name.

tool_definitions: Option<Vec<Json>>#

Tool definitions available to the agent.

extra: Option<Json>#

Extra ATIF agent metadata.

output_directory: Option<PathBuf>#

Directory containing trajectory JSON files.

filename_template: String#

Filename template. {session_id} is replaced with the top-level trajectory scope UUID.

Traits implemented

impl Default for AtifSectionConfig#
struct AtofSectionConfig#

Filesystem-backed ATOF JSONL exporter config.

When enabled, this section wraps crate::observability::atof::AtofExporter and writes the raw ATOF event stream as JSONL. The exporter uses the current working directory and a timestamped filename when no explicit path settings are supplied.

enabled: bool#

Whether ATOF JSONL export is active.

output_directory: Option<PathBuf>#

Directory containing the JSONL output file.

filename: Option<String>#

Output filename. Defaults to the underlying ATOF exporter timestamped filename.

mode: String#

File open mode: append or overwrite.

Traits implemented

impl Default for AtofSectionConfig#
struct ComponentSpec#

Top-level observability component wrapper.

Use this wrapper when constructing a PluginComponentSpec from Rust instead of hand-writing the generic plugin component shape. The component kind is always OBSERVABILITY_PLUGIN_KIND.

enabled: bool#

Whether the observability component should be activated.

config: ObservabilityConfig#

Observability config for this top-level component.

Implementations

impl ComponentSpec#

Functions

fn new(config: ObservabilityConfig) -> Self#

Creates an enabled observability component spec.

The returned component can be converted into the generic plugin config entry with PluginComponentSpec::from(...).

struct ObservabilityConfig#

Canonical config document for the observability plugin component.

Every section is optional. A missing section has the same activation behavior as a section with enabled = false: it contributes no runtime subscribers and performs no export work.

version: u32#

Observability config schema version.

atof: Option<AtofSectionConfig>#

Filesystem-backed raw ATOF JSONL export.

atif: Option<AtifSectionConfig>#

Per-top-level-agent ATIF trajectory export.

opentelemetry: Option<OtlpSectionConfig>#

OpenTelemetry trace export.

openinference: Option<OtlpSectionConfig>#

OpenInference trace export.

policy: ConfigPolicy#

Observability-local unsupported-config policy.

Traits implemented

impl Default for ObservabilityConfig#
struct OtlpSectionConfig#

Shared OTLP exporter config for OpenTelemetry and OpenInference.

The opentelemetry and openinference sections share the same shape but construct different subscriber implementations. Both sections are disabled by default and use http_binary transport unless configured otherwise.

enabled: bool#

Whether the subscriber is active.

transport: String#

OTLP transport: http_binary or grpc.

endpoint: Option<String>#

OTLP endpoint.

headers: HashMap<String, String>#

Extra exporter headers or metadata.

resource_attributes: HashMap<String, String>#

Extra resource attributes.

service_name: String#

service.name resource attribute.

service_namespace: Option<String>#

Optional service.namespace resource attribute.

service_version: Option<String>#

Optional service.version resource attribute.

instrumentation_scope: Option<String>#

Instrumentation scope name.

timeout_millis: u64#

Export timeout in milliseconds.

Traits implemented

impl Default for OtlpSectionConfig#