# `Tinkex.Telemetry.Reporter.Serializer`
[🔗](https://github.com/North-Shore-AI/tinkex/blob/v0.4.0/lib/tinkex/telemetry/reporter/serializer.ex#L1)

Event serialization and sanitization for telemetry.

Handles:
  * Converting typed event structs to wire format maps
  * Sanitizing data for JSON serialization (atoms to strings, etc)
  * Platform detection

# `build_request`

```elixir
@spec build_request(list(), map()) :: map()
```

Build a telemetry request payload from events and state.

Returns a map with session_id, platform, sdk_version, and serialized events.

# `event_to_map`

```elixir
@spec event_to_map(struct() | map()) :: map()
```

Convert a typed event struct to a wire format map.

Delegates to the appropriate `to_map/1` function based on event type.

# `platform`

```elixir
@spec platform() :: String.t()
```

Get the platform string (os_type/os_flavor).

Example: "unix/linux"

# `sanitize`

```elixir
@spec sanitize(term()) :: term()
```

Sanitize a value for JSON serialization.

Converts:
  * Structs to maps (via Map.from_struct)
  * Atoms to strings
  * Lists recursively
  * Maps recursively (keys and values)
  * Numbers, binaries, booleans, nil - pass through
  * Everything else - inspect

---

*Consult [api-reference.md](api-reference.md) for complete listing*
