DataDog / dd-trace-js

JavaScript APM Tracer
https://docs.datadoghq.com/tracing/
Other
650 stars 306 forks source link

Instrumenting ConnectWebhandlers in Meteor #2356

Open ajax88 opened 2 years ago

ajax88 commented 2 years ago

Hi all - I was wondering what the best way to instrument the WebApp.connectHandlers provided by meteor. We use these connectHandlers to expose different webhooks, yet I don't see any tracing related to a connect service that I expect to see. Given that this seems to just be a wrapper around connect, I'm wondering why the built in dd-trace connect instrumentation does not work in this case. I'm guessing this must be due to some misunderstanding I have with the way dd-trace monkey-patches different packages. For context, I'm well aware of the inherent incompatibility that Meteor has with dd-trace due to the Fibers <> async_hooks incompatibility: https://github.com/DataDog/dd-trace-js/issues/1229; that being said, I don't believe my current question should be affected by this.

I'm happy to provide more context here, just let me know what would be good to know. Thanks!

ajax88 commented 2 years ago

To add to this a bit, it seems like connect should be instrumented based on the tracer configuration I'm seeing here:

DATADOG TRACER CONFIGURATION - {"date":"2022-09-08T14:48:09.945Z","os_name":"Darwin","os_version":"21.3.0","architecture":"x64","version":"0.29.1","lang":"nodejs","lang_version":"12.20.1","env":"localhost","enabled":true,"scope_manager":"async_resource","service":"tradewing","agent_url":"http://127.0.0.1:8126","debug":false,"analytics_enabled":true,"sample_rate":1,"sampling_rules":[],"tags":{"service":"tradewing","env":"localhost","version":""},"log_injection_enabled":true,"runtime_metrics_enabled":false,"integrations_loaded":["bluebird@3.5.1","connect","mongodb@3.6.5","winston@3.2.1","fs","graphql@14.7.0","http","net","dns","express@4.18.0","https","mongoose@5.13.4","ioredis@4.17.3"]}