Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: A setting to turn Dtrace off so that it can run on heroku #80

Closed
mypark opened this issue Feb 20, 2012 · 4 comments
Closed

Comments

@mypark
Copy link

mypark commented Feb 20, 2012

I'm getting a [Error: Cannot find module './DTraceProviderBindings'] error on heroku... Possibly because Dtrace is not supported on the heroku platform? Is there a suggested way of running restify on heroku? Perhaps being able to turn dtrace off?

@ggoodman
Copy link

This also appears to be a factor limiting its ability to install on Windows. I'm sure it would run fine without the DTrace magic.

+1

@adamhopkinson
Copy link

I'm also getting an error building dtrace, when all I need is vanilla Restify. Also planning on deploying to Heroku. I'd love the ability to install without dtrace, or at least turn it off. Thanks!

@mal
Copy link

mal commented Mar 6, 2012

I was running into the same issue so I cobbled a quick hack together; it's pretty very nasty but it gets the job done while a proper solution is worked out.

diff --git a/lib/index.js b/lib/index.js
index 2a63730..e1b1ac2 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -2,7 +2,6 @@

 var assert = require('assert');

-var d = require('dtrace-provider');
 var Logger = require('bunyan');
 var mime = require('mime');

@@ -24,6 +23,16 @@ var JsonClient = clients.JsonClient;
 var StringClient = clients.StringClient;


+///--- Fake DTrace
+
+!function(methods) {
+    var nop = function() {},
+        proto = nop.prototype;
+    methods.forEach(function(method) {
+        proto[method] = nop;
+    });
+    DTRACE = new nop;
+}(['addProbe', 'enable', 'fire']);

 ///--- Helpers

diff --git a/package.json b/package.json
index 6ff307b..f856a15 100644
--- a/package.json
+++ b/package.json
@@ -34,7 +34,6 @@
     "async": "0.1.18",
     "bunyan": "0.6.8",
     "formidable": "1.0.9",
-    "dtrace-provider": "0.0.6",
     "http-signature": "0.9.8",
     "lru-cache": "1.0.5",
     "mime": "1.2.5",

@mcavage
Copy link
Contributor

mcavage commented Mar 9, 2012

I've fixed this issue under #100 - to work "smoothly" it will require npm 1.1.5.

@mcavage mcavage closed this as completed Mar 9, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants