Closed marcus13371337 closed 2 months ago
Telemetry can now be added through the Open Telemetry Instrumentation package. Here's an example:
import { AzureMonitorOpenTelemetryOptions, useAzureMonitor } from 'applicationinsights';
import { registerInstrumentations } from '@opentelemetry/instrumentation';
import { GraphQLInstrumentation } from '@opentelemetry/instrumentation-graphql';
import { DataloaderInstrumentation } from '@opentelemetry/instrumentation-dataloader';
const config: AzureMonitorOpenTelemetryOptions = {
azureMonitorExporterOptions: {
connectionString: process.env[process.env.APPLICATIONINSIGHTS_CONNECTION_STRING],
}
}
useAzureMonitor(config); // Must be BEFORE instrumentation registration
registerInstrumentations({
instrumentations: [
new GraphQLInstrumentation({ allowValues: true, }),
new DataloaderInstrumentation(),
],
});
Closing as the question was answered in this thread.
Nice with new versions, and that you are keeping up getting tracing into app services! However, I tried to go from
3.0.0-beta.6
to3.0.0-beta.9
. But I'm having a really hard time to converting my old config to your new format. As an example, how do I add a custom instrumentation? I.e what was described here in3.0.0-beta.6