Skip to content

Instantly share code, notes, and snippets.

@jhorowitz
Created November 28, 2017 19:51
Show Gist options
  • Save jhorowitz/12cf90e142e70b61eaabd522da857a15 to your computer and use it in GitHub Desktop.
Save jhorowitz/12cf90e142e70b61eaabd522da857a15 to your computer and use it in GitHub Desktop.
Instana Issue Reproduction
import instana = require("instana-nodejs-sensor");
instana({
tracing: {
enabled: true,
},
serviceName: "Reproduction",
});
import * as opentracing from 'opentracing';
opentracing.initGlobalTracer(instana.opentracing.createTracer());
const tracer = opentracing.globalTracer();
/*
Issues:
1) The service name is set above but in Instana, the app is
labeled as repro from the package.json. It doesn't seem like
package.json should be overriding explicitly set service names
2) On the traces page, the Service column is blank despite
stating the service name from package.json on the app page.
A Service name will intermittently appear, but it will be the
same as the Call name and not actually the service name.
3) This is slightly off topic, but it made this reproduction harder
so I'll mention it: During Instana's initialization, all spans are lost.
Afaik, Instana doesn't have a callback alerting when it's ready
so there's no way to know when the app is being traced.
*/
function sendMockSpanAfterTimeout() {
tracer.startSpan("repro.example_span.with_timeout").finish();
}
tracer.startSpan("repro.example_span.no_timeout").finish();
setTimeout(sendMockSpanAfterTimeout, 30 * 1000);
// Set a timeout so the app doesn't quit
setTimeout(() => {}, 1000 * 60 * 24);
console.log("End of file reached");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment