> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Obs Collector • Rust AI Agent SDK

> ObsCollector: Observability collector trait

# ObsCollector

> Defined in the [**extras**](../modules/extras) module.

<Badge color="orange">Rust AI Agent SDK</Badge>

Observability collector trait

## Methods

### `record`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn record(&self, event: &str, data: &serde_json::Value) -> ()
```

Record an event

**Parameters:**

| Name    | Type                 |
| ------- | -------------------- |
| `event` | `&str`               |
| `data`  | `&serde_json::Value` |

### `flush`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn flush(&self) -> ()
```

Flush pending events

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-rust/praisonai/src/parity/extras.rs">
  `praisonai/src/parity/extras.rs` at line 0
</Card>
