honeycombio / microservices-demo

Apache License 2.0
33 stars 18 forks source link

instrumentation-load.js in frontend does not seem to work..? #97

Open howardyoo opened 1 month ago

howardyoo commented 1 month ago

symptom

Even though the instrumentation-load.js which covers the otel web instrumentation is loaded, it does not seem to emit any traces. steps to reproduce:

  1. open up the /src/frontend/dist/instrumentation-load.js

  2. modify the line that has the settings for receiving traces to the local opentelemetry collector - which should be able to receive the traces. change

    const exporter = new _opentelemetryExporterCollector.CollectorTraceExporter({
    url: 'https://microservicescollector.honeydemo.io:443/v1/traces'
    });

    into:

    const exporter = new _opentelemetryExporterCollector.CollectorTraceExporter({
    url: 'http://opentelemetry-collector:4319/v1/traces'
    });

    (port 4318 also works, as it is another http otel port)

  3. Run the microservice-demo.

  4. observe that there is no trace flowing into the designated dataset (which is microservices-browser)

I have tried similar approach using another bundled otel web sdk js that I made, and it was able to send traces properly to the endpoint, so I am suspecting that something in the instrumentation-load.js is not working properly (I'm not sure what, though). Anyway, thought it would be helpful to report it.