Azure Monitor OpenTelemetry with Node.js to have graphql operation name

Parag Kale 25 Reputation points
2025-08-17T15:25:46.4433333+00:00

Hi,

I recently introduced Node.js azure observability to send telemetry to Azure monitor as mentioned in the documentation https://learn.microsoft.com/en-us/azure/azure-monitor/app/opentelemetry-configuration?tabs=nodejs

Below is the code snippet that was added for NextJS to track the api calls

import { useAzureMonitor } from 'applicationinsights';

import type { AzureMonitorOpenTelemetryOptions } from 'applicationinsights';

import { resourceFromAttributes } from '@opentelemetry/resources';

import { ATTR_SERVICE_NAME } from '@opentelemetry/semantic-conventions';

const connectionString = process.env.NEXT_PUBLIC_APP_INSIGHTS_CONNECTION_STRING;

if (connectionString) {

const serviceAttributes = {

[ATTR_SERVICE_NAME]: 'gtis2-nextjs-server',

};

const resource = resourceFromAttributes(serviceAttributes);

const options: AzureMonitorOpenTelemetryOptions = {

azureMonitorExporterOptions: {

  connectionString,

},

resource,

};

// eslint-disable-next-line react-hooks/rules-of-hooks

useAzureMonitor(options);

console.log(

`[Azure Observability] OpenTelemetry with Azure Monitor initialized successfully!`,

);

}

The app insights telemetry under gtis2-nextjs-server , I am only seeing POST /api/graphql. I want to see the graphql operation name as well. I am attaching the screenshotimage (1).jpg

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.