Skip to content

Rust SDK — Agent Configuration

The agent can be configured programmatically or from YAML.

Programmatic Configuration

use phytrace_sdk::{PhyTraceConfig, SourceType};

let config = PhyTraceConfig::new("robot-001")
    .with_endpoint("https://api.phycloud.io/v1/events")
    .with_api_key("your-api-key")
    .with_source_type(SourceType::Amr)
    .with_fleet_id("warehouse-fleet")
    .with_site_id("site-nyc-01")
    .with_buffer_path("/tmp/phytrace-buffer")
    .with_buffer_max_size_mb(512)
    .with_batch_size(100)
    .with_retry_max(5);

YAML Configuration

let agent = PhyTraceAgent::from_config_file("phytrace-agent.yaml").await?;

See the Python SDK Agent docs for the full YAML schema — both SDKs use the same configuration format.