faro-web-sdk icon indicating copy to clipboard operation
faro-web-sdk copied to clipboard

pushError loses context data

Open codecapitano opened this issue 1 year ago • 5 comments

Description

Context data attached to a error via the context object gets lost in the backend when using Grafana Agent.

aro.api.pushError(error, {
  type: 'network',
  context: {
      message: 'React error boundary',
      componentStackTrace: {...}
    },
});

The issue was reported on the Faro community Slack. I tested it with the Faro Receiver in cloud and the Grafana Agent. Faro receiver works well, but when using the Agent the context attributes do not appear in the Loki log.

Steps to reproduce

I started the Demo app which uses the Grafana Agent and sent a custom error with context attributes attached. The context attributes did not show up in the error log.

Then I started the fe-o11y plugin, which is using the Faro receiver, locally and sent a custom error with context attributes attached as well. The context attributes showed up in the error log as excpected.

Expected behavior

Context attributes should appear in the Loki log.

Actual behavior

context attributes do not appear in the Loki log.

Environment

  • SDK version: 1.3.8
  • SDK instrumentations:
  • Device type:
  • Device name:
  • OS:
  • Browser:

Demo

Context

codecapitano avatar Feb 16 '24 15:02 codecapitano

Having this exact same issue, any updates / fixes in sight?

sebastianbaron avatar Jun 13 '24 17:06 sebastianbaron

Anyone looking at this?

We think we are running into the same issue.

andreieftimie avatar Jul 22 '24 09:07 andreieftimie

I have same problem. But, i lose context for kind=exception at initializeFaro Sended payload data: image My log, context compression lose: timestamp="2024-07-22 10:30:15.394 +0000 UTC" kind=exception type=Error value="Request failed with status code 401" stacktrace="..." hash=... sdk_version=1.8.1 app_name=... app_release=... [email protected] user_id=... session_id=... session_attr_previousSession=... page_url="..." browser_name=Chrome browser_version=126.0.0.0 browser_os="Mac OS 10.15.7" browser_mobile=false view_name=default

gnvcor avatar Jul 22 '24 11:07 gnvcor

Found the issue: https://github.com/grafana/alloy/pull/1413

codecapitano avatar Aug 02 '24 08:08 codecapitano

The fix will be release with Alloy v1.4

codecapitano avatar Aug 08 '24 12:08 codecapitano