Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Commit

Permalink
Fixed setting operation id in page view
Browse files Browse the repository at this point in the history
  • Loading branch information
norberttech committed Mar 3, 2019
1 parent c0df762 commit aedb900
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Twig/TelemetryExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,15 @@ public function appInsightsPHP(?string $userId = null): string
var appInsights=window.appInsights||function(a){
function b(a){c[a]=function(){var b=arguments;c.queue.push(function(){c[a].apply(c,b)})}}var c={config:a},d=document,e=window;setTimeout(function(){var b=d.createElement("script");b.src=a.url||"https://az416426.vo.msecnd.net/scripts/a/ai.0.js",d.getElementsByTagName("script")[0].parentNode.appendChild(b)});try{c.cookie=d.cookie}catch(a){}c.queue=[];for(var f=["Event","Exception","Metric","PageView","Trace","Dependency"];f.length;)b("track"+f.pop());if(b("setAuthenticatedUserContext"),b("clearAuthenticatedUserContext"),b("startTrackEvent"),b("stopTrackEvent"),b("startTrackPage"),b("stopTrackPage"),b("flush"),!a.disableExceptionTracking){f="onerror",b("_"+f);var g=e[f];e[f]=function(a,b,d,e,h){var i=g&&g(a,b,d,e,h);return!0!==i&&c["_"+f](a,b,d,e,h),i}}return c
}({
instrumentationKey:"%s"
instrumentationKey:"%s",
disableCorrelationHeaders: false
});
window.appInsights=appInsights;\n
window.appInsights.queue.push(function () {
appInsights.context.operation.id = '%s';
});
JS
, $this->client->getContext()->getInstrumentationKey()
, $this->client->getContext()->getInstrumentationKey(), $this->client->getContext()->getOperationContext()->getId()
);

$script .= sprintf("window.appInsights.context.operation.id=\"%s\";\n", $this->client->getContext()->getOperationContext()->getId());
Expand Down

0 comments on commit aedb900

Please sign in to comment.