Do we still need install old plugins if use @opentelemetry/instrumentation-http? #1974
Answered
by
hongbo-miao
hongbo-miao
asked this question in
Q&A
-
This is current demo in the readme file at https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-instrumentation-http const { HttpInstrumentation } = require('@opentelemetry/instrumentation-http');
const { ConsoleSpanExporter, SimpleSpanProcessor } = require('@opentelemetry/tracing');
const { NodeTracerProvider } = require('@opentelemetry/node');
const provider = new NodeTracerProvider({
// be sure to disable old plugins
plugins: {
http: { enabled: false, path: '@opentelemetry/plugin-http' },
https: { enabled: false, path: '@opentelemetry/plugin-https' }
},
});
const httpInstrumentation = new HttpInstrumentation();
httpInstrumentation.enable();
provider.addSpanProcessor(new SimpleSpanProcessor(new ConsoleSpanExporter()));
provider.register(); Do we still need install |
Beta Was this translation helpful? Give feedback.
Answered by
hongbo-miao
Feb 26, 2021
Replies: 1 comment
-
Just tested locally, seems not, these would be good. const { HttpInstrumentation } = require('@opentelemetry/instrumentation-http');
const { ConsoleSpanExporter, SimpleSpanProcessor } = require('@opentelemetry/tracing');
const { NodeTracerProvider } = require('@opentelemetry/node');
const provider = new NodeTracerProvider();
const httpInstrumentation = new HttpInstrumentation();
httpInstrumentation.enable();
provider.addSpanProcessor(new SimpleSpanProcessor(new ConsoleSpanExporter()));
provider.register(); Please correct me if I am wrong. Thanks! |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
hongbo-miao
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just tested locally, seems not, these would be good.
Please correct me if I am wrong. Thanks!