Oddleif
Oddleif

Reputation: 791

How to set application insights operation_Name from javascript?

I am trying to set the operation_Name property from the javascript client for application insights. But I expect I pass in the wrong property name. Not found any relevant documentation. This has no effect:

AppInsights.trackPageView(name, url, { 'operation_Name': 'something' }, measurements, duration);

Any suggestions?

Upvotes: 2

Views: 2378

Answers (1)

Jeff Hopper
Jeff Hopper

Reputation: 486

This value is set in the Operation Context which can be modified using

 AppInsights.queue.push(() => {
    AppInsights.context.addTelemetryInitializer(envelope => {
      envelope.tags['ai.operation.name'] = 'FabrikamResidences';
    });
  });

Upvotes: 2

Related Questions