question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Traces send by http protocol fail in new Otel collector receiver

See original GitHub issue

What version of OpenTelemetry are you using?

0.23.0

What version of Node are you using?

v14.15.2

Please provide the code you used to setup the OpenTelemetry SDK

All code is here https://github.com/open-telemetry/opentelemetry-js/tree/main/examples/tracer-web

What did you do?

I used this project example and new Otel collector (0.29.0).

What did you expect to see?

Traces OK in collector

What did you see instead?

All traces send to the Otel Collector failed (404).

Additional context

No additional.

What I think about this issue

Traces are send with beacon with a body string, so the content-type is text/plain. New collector (0.29.0) is less permissive and expect an application/json

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
jufabcommented, Jul 5, 2021

I think application/x-protobuf is for GRPC protocol. application/json is for HTTP protocol

or “Content-Type: application/json” request header when sending JSON encoded Protobuf payload

1reaction
niko-achillescommented, Jul 30, 2021

@mogest if you use opentelemetry-collector of version 0.29.0 then, an elegant workaround to fallback to xhr without mutating the navigator.sendBeacon property is to define the config of Collector Trace exporter as follows:

new CollectorTraceExporter({
        headers: {},
      })

or if you want to be explicit, update npm packages to version 0.24.0 :

new CollectorTraceExporter({
        headers: {
              "Content-Type": "application/json"
             },
      })

note opentelemetry-collector of version 0.29.0 is released and that workaround may not be needed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Building a Trace Receiver | OpenTelemetry
In order to properly test your trace receiver, you will need a distributed tracing backend so the Collector can send the telemetry to...
Read more >
OpenTelemetry troubleshooting - Logz.io Docs
This section contains some guidelines for handling errors that you may encounter when trying to collect traces with OpenTelemetry.
Read more >
OpenTelemetry Collector - architecture and configuration guide
OpenTelemetry Collector is a stand-alone service provided by ... For example, you can send traces to Jaeger and metrics to Prometheus.
Read more >
Troubleshoot the Collector - Splunk Documentation
The collector is improperly sized, resulting in the Splunk Distribution of OpenTelemetry Collector being unable to process and export the data as fast...
Read more >
Getting Started with the AWS X-Ray Exporter in the Collector
The receiver in the OpenTelemetry Collector is responsible for receiving data ... 4 # for example configure sending traces to AWS X-Ray in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found