SUI-Components / sui

Monorepo for SUI (Simple User Interface) packages.
169 stars 33 forks source link

feat(packages/sui-react-web-vitals): adding device perf params to logger.cwv tracks #1725

Closed ivanmlaborda closed 3 months ago

ivanmlaborda commented 7 months ago

Adding device perf params to logger.cwv tracks

Description

To distinguish interactions based on connection quality, and device performance in OpenSearch CWV logs we need to add these parameters to the logged data.

effectiveConnection, deviceMemory, hardwareConcurrency

example data sent to Mushroom imatge

This data can be calculated and setted in suiContextFactory in our webapps

const hardwareConcurrency = isClient && navigator.hardwareConcurrency
const effectiveConnection = isClient && navigator.connection?.effectiveType
const deviceMemory = isClient && navigator.deviceMemory

must be added to browser property in the Context

{
  ...
  browser: {
    ...
    effectiveConnection,
    deviceMemory,
    hardwareConcurrency
  }
}
nucliweb commented 7 months ago

With this #1724 you don't need change the web app.