Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pushError loses context data #486

Closed
codecapitano opened this issue Feb 16, 2024 · 6 comments
Closed

pushError loses context data #486

codecapitano opened this issue Feb 16, 2024 · 6 comments
Labels
bug Report a bug

Comments

@codecapitano
Copy link
Collaborator

codecapitano commented Feb 16, 2024

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 codecapitano added the bug Report a bug label Feb 16, 2024
@eskirk eskirk changed the title pushError looses context data pushError loses context data Feb 16, 2024
@sebastianbaron
Copy link

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

@andreieftimie
Copy link

Anyone looking at this?

We think we are running into the same issue.

@gnvcor
Copy link

gnvcor commented Jul 22, 2024

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=... user_email=demo@demo.demo 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

@codecapitano
Copy link
Collaborator Author

Found the issue: grafana/alloy#1413

@codecapitano
Copy link
Collaborator Author

The fix will be release with Alloy v1.4

@codecapitano
Copy link
Collaborator Author

Alloy v1.4 i already released. Closing this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Report a bug
Projects
None yet
Development

No branches or pull requests

4 participants