This is actually a known issue… i’ve seen that heap churn wreck Go services before. The RawMessage trick helps, but you’re still paying the unmarshalling tax for every single event. honestly, if you’re just pulling aggregates, why even use the event stream? it’s overkill and slow.
just hit /api/v2/analytics/conversations/queues directly. you’ll get a flat JSON response with exactly the metrics you need, no nested garbage to parse. here’s the powershell equivalent i use for quick checks, same logic applies to your go client.
$resp = Invoke-RestMethod -Uri "https://api.mypurecloud.com/api/v2/analytics/conversations/queues" -Headers @{ Authorization = "Bearer $token" } -Method Get
$resp.groups | Select-Object -ExpandProperty metrics
it cuts the cpu load in half. no reflection, no nested structs. just get the data and move on. stop fighting the sdk overhead.