Skip to content
Discussion options

You must be logged in to vote

This is my actual code:

// instrumentation.ts


import { registerOTel } from '@vercel/otel';

export async function register() {
  if (process.env.NEXT_RUNTIME === 'nodejs') {
    const { spanProcessors } = await import('./instrumentation.node');
    registerOTel({ spanProcessors: spanProcessors });
  }
}

// instrumentation.node.js


import { AzureMonitorTraceExporter } from '@azure/monitor-opentelemetry-exporter';
import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-grpc';
import { BatchSpanProcessor } from '@opentelemetry/sdk-trace-node';

const spanProcessors = [new BatchSpanProcessor(new OTLPTraceExporter())];

if (process.env.APPLICATIONINSIGHTS_CONNECTION_STRING) {
  

Replies: 2 comments 34 replies

Comment options

You must be logged in to vote
27 replies
@KennethHoff
Comment options

@KennethHoff
Comment options

@enemyss
Comment options

@KennethHoff
Comment options

Answer selected by KennethHoff
@oising
Comment options

@KennethHoff
Comment options

@timfewi
Comment options

Comment options

You must be logged in to vote
7 replies
@oising
Comment options

@JamesNK
Comment options

@ByronMayne
Comment options

@JamesNK
Comment options

@ByronMayne
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
8 participants