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

Getting transport-otlp-http errors

Open miniengineer opened this issue 1 year ago • 18 comments

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

  • all packages are 1.8.0
  • @grafana/faro-react, @grafana/faro-transport-otlp-http, @grafana/faro-web-sdk, @grafana/faro-web-tracing;
  • Chrome

Demo

Context

miniengineer avatar Jul 03 '24 11:07 miniengineer