faro-web-sdk
faro-web-sdk copied to clipboard
pushError loses context data
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
Having this exact same issue, any updates / fixes in sight?
Anyone looking at this?
We think we are running into the same issue.
I have same problem.
But, i lose context for kind=exception at initializeFaro
Sended payload data:
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
Found the issue: https://github.com/grafana/alloy/pull/1413
The fix will be release with Alloy v1.4