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

Error not being shown in my dashboard on https://sentry.io #67630

Closed
flazouh opened this issue Mar 25, 2024 · 3 comments
Closed

Error not being shown in my dashboard on https://sentry.io #67630

flazouh opened this issue Mar 25, 2024 · 3 comments

Comments

@flazouh
Copy link

flazouh commented Mar 25, 2024

Environment

SaaS (https://sentry.io/)

Steps to Reproduce

create a chrome extension and do this code in your content.js:

import * as Sentry from '@sentry/browser'

window.onload = async () => {
  Sentry.init({
    dsn: 'https://1ae31a2cb3cc2c9061c68e9757945511@o4506972859072512.ingest.us.sentry.io/4506972863725568',
    integrations: [
      Sentry.browserTracingIntegration(),
      Sentry.replayIntegration({
        maskAllText: false,
        blockAllMedia: false,
      }),
    ],
    // Performance Monitoring
    tracesSampleRate: 1.0, //  Capture 100% of the transactions
    // Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled
    tracePropagationTargets: ['localhost', /^https:\/\/yourserver\.io\/api/],
    // Session Replay
    replaysSessionSampleRate: 0.1, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production.
    replaysOnErrorSampleRate: 1.0, // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur.
  })
}

Then throw an error manually with

<button
          type="button"
          onClick={() => {
            throw new Error('Sentry Test Error')
          }}
        >
          Break the world
</button>

Expected Result

see the error logged in the dashboard

Actual Result

Here is the jam where you can check the network tab, as you can see, the request are being sent to my sentry project.

https://jam.dev/c/96f0a77e-b565-4a88-a86d-cf81a8fc049c

Product Area

Issues

Link

https://sentry.io/organizations/fluent-pj/issues/

DSN

https://1ae31a2cb3cc2c9061c68e9757945511@o4506972859072512.ingest.us.sentry.io/4506972863725568

Version

No response

EDIT: one error randomly popped in the dashboard, but i've sent multiples

image
@getsantry
Copy link
Contributor

getsantry bot commented Mar 25, 2024

Assigning to @getsentry/support for routing ⏲️

@getsantry getsantry bot moved this to Waiting for: Support in GitHub Issues with 👀 2 Mar 25, 2024
@flazouh
Copy link
Author

flazouh commented Mar 25, 2024

Seems to work now.
image

@flazouh
Copy link
Author

flazouh commented Apr 1, 2024

Hi, so still some issues in here, I tried to put a throw exception in my code:

for (const api of apis) {
  try {
    const translation = await api.getTranslation(
      text,
      sourceLangID,
      targetLangID,
    )
    throw new Error('Not implemented')
  } catch (e) {
        Sentry.captureException(e)
}

And the following request is sent:
https://o4506972859072512.ingest.us.sentry.io/api/4506972863725568/envelope/?sentry_key=1ae31a2cb3cc2c9061c68e9757945511&sentry_version=7&sentry_client=sentry.javascript.browser%2F7.108.0

{
  "event_id": "19c89dc3853742aaaeaead196f45e15c",
  "sent_at": "2024-04-01T22:36:05.388Z",
  "sdk": {
    "name": "sentry.javascript.browser",
    "version": "7.108.0"
  },
  "trace": {
    "environment": "development",
    "public_key": "1ae31a2cb3cc2c9061c68e9757945511",
    "trace_id": "814e700829284c0787295edff1be4683",
    "sample_rate": "1",
    "sampled": "true"
  }
}
{
  "type": "event"
}
{
  "exception": {
    "values": [
      {
        "type": "Error",
        "value": "Not implemented",
        "stacktrace": {
          "frames": [
            {
              "filename": "chrome-extension://ehfifdpieloecbgndipmciaoahdodlme/background.js",
              "function": "translateText",
              "in_app": true,
              "lineno": 166019,
              "colno": 17
            }
          ]
        },
        "mechanism": {
          "type": "generic",
          "handled": true
        }
      }
    ]
  },
  "level": "error",
  "event_id": "19c89dc3853742aaaeaead196f45e15c",
  "platform": "javascript",
  "request": {
    "url": "chrome-extension://ehfifdpieloecbgndipmciaoahdodlme/background.js",
    "headers": {
      "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36"
    }
  },
  "timestamp": 1712010965.386,
  "environment": "development",
  "sdk": {
    "integrations": [
      "InboundFilters",
      "FunctionToString",
      "TryCatch",
      "Breadcrumbs",
      "GlobalHandlers",
      "LinkedErrors",
      "Dedupe",
      "HttpContext",
      "BrowserTracing",
      "Replay"
    ],
    "name": "sentry.javascript.browser",
    "version": "7.108.0",
    "packages": [
      {
        "name": "npm:@sentry/browser",
        "version": "7.108.0"
      }
    ]
  },
  "contexts": {
    "trace": {
      "data": {
        "sentry.origin": "auto.pageload.browser",
        "sentry.op": "pageload",
        "sentry.source": "url",
        "sentry.sample_rate": 1
      },
      "op": "pageload",
      "span_id": "9d02aaccc4f2e41d",
      "trace_id": "814e700829284c0787295edff1be4683",
      "origin": "auto.pageload.browser"
    }
  },
  "tags": {
    "transaction": "/background.js"
  },
  "breadcrumbs": [
    {
      "timestamp": 1712010965.097,
      "category": "console",
      "data": {
        "arguments": [
          "background-rpc-receiver.controller.ts",
          "handleMessage()",
          "calling function",
          "translateText"
        ],
        "logger": "console"
      },
      "level": "log",
      "message": "background-rpc-receiver.controller.ts handleMessage() calling function translateText"
    },
    {
      "timestamp": 1712010965.097,
      "category": "console",
      "data": {
        "arguments": [
          "DeeplTranslator.getTranslation",
          "Run!",
          "en",
          "ru"
        ],
        "logger": "console"
      },
      "level": "log",
      "message": "DeeplTranslator.getTranslation Run! en ru"
    },
    {
      "timestamp": 1712010965.383,
      "category": "fetch",
      "data": {
        "method": "POST",
        "url": "https://www2.deepl.com/jsonrpc",
        "__span": "a84483b4078f49af",
        "status_code": 200
      },
      "type": "http"
    },
    {
      "timestamp": 1712010965.384,
      "category": "console",
      "data": {
        "arguments": [
          "DeeplTranslator.getTranslation",
          "Беги!"
        ],
        "logger": "console"
      },
      "level": "log",
      "message": "DeeplTranslator.getTranslation Беги!"
    }
  ]
}

and response :

{"id":"19c89dc3853742aaaeaead196f45e15c"}

but in my dashboard, i don't see anything being sent!

image

I would appreciate some help, thanks in advance! :)

@getsantry getsantry bot moved this from Waiting for: Support to Waiting for: Product Owner in GitHub Issues with 👀 2 Apr 1, 2024
@flazouh flazouh closed this as completed Apr 1, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Apr 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

1 participant