faro-web-sdk: Getting transport-otlp-http errors
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
Steps to reproduce
- Add previously mentioned faro libraries to React project
- Use the configuration pasted above
- Open application in Chrome and try to send logs & traces
- 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
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 2
- Comments: 18
Hi @miniengineer I’ll release the updates otlp-http-transport today. I initially planned to get more things into he release but gut pulled away by conflicting priorities.
In general contributions are always welcome. 🎉 Please don’t hesitate to contribute. We are always here to help in case you’ve questions etc.
@miniengineer unfortunatey I can’t reproduce the issue, but found that the otlp-http-transport didn’t consume the request body which an lead to several issues like hanging requests, memory leaks etc.
We’ll release the update soon. Since I couldn’t reproduce the issue it would be helpful if you can observer any positive impacts.
Heads up since you are using the otlp-http-transport, we are going to release a new Faro version with updated otel dependencies.
We aligned semantic attributes with the current otel spec.
You can read about the changes in the CHANGELOG
Hey @miniengineer
So Faro as web-sdk and a OTEL collector.
I don’t have a satisfactory answer yet, but yes these thing can happen e.g because of network or server issue etc. Can you check the the server logs / the collector logs if there are any hints?
Do you see any related warnings in the browser console?