You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can am able find only examples like below only which uses NodeSDK
// telemetry.js
import { NodeSDK } from '@opentelemetry/sdk-node';
import { Resource } from '@opentelemetry/resources';
import { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions';
import { HttpInstrumentation } from '@opentelemetry/instrumentation-http';
import { ExpressInstrumentation } from '@opentelemetry/instrumentation-express';
import { GraphQLInstrumentation } from '@opentelemetry/instrumentation-graphql';
import { AzureMonitorTraceExporter } from '@azure/monitor-opentelemetry-exporter';
import { ConsoleSpanExporter, SimpleSpanProcessor } from '@opentelemetry/sdk-trace-base';
// Set up the NodeSDK with the necessary resources and instrumentations
const sdk = new NodeSDK({
resource: new Resource({
[SemanticResourceAttributes.SERVICE_NAME]: 'your-service-name',
}),
spanProcessor: new SimpleSpanProcessor(new AzureMonitorTraceExporter()), // Replace or add exporters as needed
instrumentations: [
new HttpInstrumentation(),
new ExpressInstrumentation(),
new GraphQLInstrumentation(),
],
});
// Initialize the SDK
sdk.start().then(() => {
console.log('OpenTelemetry initialized');
}).catch((error) => {
console.log('Error initializing OpenTelemetry', error);
> #});/
How can we register the instrumentation without using NodeSDK only only using Appinsigshts?
The text was updated successfully, but these errors were encountered:
remember to call registerInstrumentations after you call ai.start() otherwise trace.getTracerProvider() will return a Noop Trace Provider resulting in Non recording Traces.
Hi
I am trying to understand how we can use below instrumentation libraryies with applicaitoninsights-3.x.x version
@opentelemetry/instrumentation-http @opentelemetry/instrumentation-express @opentelemetry/instrumentation-graphql
I can am able find only examples like below only which uses NodeSDK
How can we register the instrumentation without using NodeSDK only only using Appinsigshts?
The text was updated successfully, but these errors were encountered: