> ## 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.

# Telemetry Context • Rust AI Agent SDK

> TelemetryContext: Telemetry context for scoped tracking

# TelemetryContext

> Defined in the [**Telemetry Funcs**](../modules/telemetry_funcs) module.

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

Telemetry context for scoped tracking

## Fields

| Name         | Type                                  | Description  |
| ------------ | ------------------------------------- | ------------ |
| `name`       | `String`                              | Context name |
| `start_time` | `std::time::Instant`                  | Start time   |
| `properties` | `std::collections::HashMap&lt;String` | Properties   |
| `serde_json` | `:Value&gt;`                          | Properties   |

## Methods

### `new`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn new(name: impl Into<String>) -> Self
```

Create a new telemetry context

**Parameters:**

| Name   | Type                      |
| ------ | ------------------------- |
| `name` | `impl Into&lt;String&gt;` |

### `property`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn property(mut self, key: impl Into<String>, value: serde_json::Value) -> Self
```

Add a property

**Parameters:**

| Name    | Type                      |
| ------- | ------------------------- |
| `key`   | `impl Into&lt;String&gt;` |
| `value` | `serde_json::Value`       |

### `elapsed_ms`

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

Get elapsed time in milliseconds

### `complete`

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

Complete the context and track event

## Source

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

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Rust Context Management" icon="layer-group" href="/docs/rust/context-management" />

  <Card title="Rust Token Management" icon="coins" href="/docs/rust/token-management" />

  <Card title="Rust Telemetry" icon="signal" href="/docs/rust/telemetry" />

  <Card title="Rust Tracing" icon="chart-line" href="/docs/rust/tracing" />
</CardGroup>
