highlight / highlight

highlight.io: The open source, full-stack monitoring platform. Error monitoring, session replay, logging, distributed tracing, and more.
https://app.highlight.io
Other
7.51k stars 357 forks source link

Active length of session is suspicious #8794

Open linear[bot] opened 3 months ago

linear[bot] commented 3 months ago

Not sure if the active length is accurate Example: https://app.highlight.io/1/sessions/xRSnNUJIjqSHG6COHuVdxAQ13FRz

Screenshot 2024-06-18 at 4.11.15 PM.png

linear[bot] commented 3 months ago

HIG-4745 Active length of session is suspicious

greptile-apps[bot] commented 3 months ago

To investigate the accuracy of the active length of a session, follow these steps:

  1. Backend Calculation:

    • Check the ActiveSessionSql struct in /backend/lambda-functions/digests/utils/utils.go for how ActiveLength is calculated and stored.
    • Similarly, review the InterestingSessionSql struct in /backend/lambda-functions/sessionInsights/utils/utils.go.
  2. Frontend Display:

    • Inspect the usePlayer hook in /frontend/src/pages/Player/PlayerHook/PlayerHook.tsx to understand how the active length is fetched and displayed.
  3. GraphQL Schema:

    • Review the Session type in /backend/private-graph/graph/model/models_gen.go to see how the active length is queried.
  4. Session Insights:

    • Ensure the session insights logic in /backend/lambda-functions/sessionInsights/utils/utils.go correctly processes and calculates the active length.
  5. Debugging:

    • Add logging in the relevant backend functions to trace the calculation of ActiveLength.
    • Verify the timestamps and events used to compute the active length are accurate and consistent.

By following these steps, you can pinpoint any discrepancies in the active length calculation and ensure its accuracy.

References

/backend/lambda-functions/digests/utils/utils.go /backend/lambda-functions/sessionInsights/utils/utils.go /backend/private-graph/graph/generated/generated.go /backend/private-graph/graph/model/models_gen.go /backend/private-graph/graph/schema.resolvers.go /frontend/src/pages/Player/PlayerHook/PlayerHook.tsx

Ask Greptile