grafana / faro-web-sdk

The Grafana Faro Web SDK, part of the Grafana Faro project, is a highly configurable web SDK for real user monitoring (RUM) that instruments browser frontend applications to capture observability signals. Frontend telemetry can then be correlated with backend and infrastructure data for full-stack observability.
https://grafana.com/oss/faro/
Apache License 2.0
688 stars 62 forks source link

Getting transport-otlp-http errors #639

Open miniengineer opened 1 week ago

miniengineer commented 1 week ago

Description

Hi 👋 We're using faro libraries to send logs and traces to our collectors.

We're seeing some errors in the console (check them below) and partialSuccess on network requests.

These are the packages we use:

"@grafana/faro-react": "^1.8.0",
"@grafana/faro-transport-otlp-http": "^1.8.0",
"@grafana/faro-web-sdk": "^1.8.0",
"@grafana/faro-web-tracing": "^1.8.0",

And this is our configuration

initializeFaro({
  app: {
    name: 'our-app/browser',
    version: '2023.test',
  },
  transports: [
    new OtlpHttpTransport({
      logsURL: 'collectorURL/logs',
      tracesURL: 'collectorURLtraces',
    }),
  ],

  instrumentations: [
    // Load the default Web instrumentations
    ...getWebInstrumentations(),

    // Tracing Instrumentation is needed if you want to use the React Profiler
    new TracingInstrumentation({
      instrumentationOptions: {
        propagateTraceHeaderCorsUrls: [/.*/],
      },
    }),

    new ReactIntegration({
      // Only needed if you want to use the React Router instrumentation
      router: createReactRouterV6Options({
        createRoutesFromChildren,
        matchRoutes,
        Routes,
        useLocation,
        useNavigationType,
      }),
    }),
  ],
});

These are the errors we see in the console

Screen Shot 2024-07-03 at 17 27 49

Steps to reproduce

  1. Add previously mentioned faro libraries to React project
  2. Use the configuration pasted above
  3. Open application in Chrome and try to send logs & traces
  4. Tada!

Expected behavior

All traces and metrics should be captured and response should be FullSuccess

Actual behavior

Some logs and metrics are captured but some are lost. And we keep getting those errors in the console.

Environment

Demo

Context

janantharaj commented 1 week ago

I'm seeing these issues as well, sporadically, with our service which uses Faro. We're on 1.7.2 and running in Chrome.

prajon84 commented 17 hours ago

cc: @codecapitano : Can you have a look into this issue? 🙏