nearform / otlp-blueprint

Open Telemetry + Jaeger + 3-tier application Blueprint
7 stars 1 forks source link

Feat(180): backend metrics support #249

Closed brainrepo closed 1 year ago

brainrepo commented 1 year ago

closes #180

claudia-codes commented 1 year ago

How do you tests this?

brainrepo commented 1 year ago

@claudia-codes

brainrepo commented 1 year ago

hey @brainrepo it seems after the tracing refactor it doesn't work as expected. When you go to jaeger (once docker compose is up) go to http://0.0.0.0:16686/ you should see traces from front-end app correlated with back-end requests, but it's not the case.

I didn't dive into the refactor logic, but if you'll be stuck we can pair on that if needed :)

Hi @zimny, I found a solution. To share the context correctly, registerInstrumentations have to be called from the global scope and not from a plugin, doing that the traces are correlated, but I can't find the reason why, in the docs, this edge case is not mentioned, would you happen to have any clue?
Ps. All the examples available run registerInstrumentations from the global scope.

zimny commented 1 year ago

Yes, it's normal as open telemetry is doing some sort of monkey patching and it has to be started "first". This workaround seems ok for me. Good to go!