question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AI: Server telemetry channel was not initialized

See original GitHub issue

Hi AI Team,

I am trying to instrument my service using AI but I am not getting the server metrics in the server. This TRACE message shows up in the “Search” in AI portal but I can’t figure why or how to fix this. The only thing we did special is to override the cloudRoleName using customer initializer so we can see multiple instances of same service in the single application map.

Trace Message

AI: Server telemetry channel was not initialized. So persistent storage is turned off. You need to call ServerTelemetryChannel.Initialize(). Currently monitoring will continue but if telemetry cannot be sent it will be dropped. 

AI Portal

Live Metrics shows the server is listed but CPU, RAM etc… is N/A Server performance metrics - N/A, NOT OK Dependencies tracking - OK Custom events - OK

package.config

  <package id="Microsoft.ApplicationInsights" version="2.5.1" targetFramework="net461" />
  <package id="Microsoft.ApplicationInsights.Agent.Intercept" version="2.4.0" targetFramework="net461" />
  <package id="Microsoft.ApplicationInsights.DependencyCollector" version="2.5.1" targetFramework="net461" />
  <package id="Microsoft.ApplicationInsights.PerfCounterCollector" version="2.5.1" targetFramework="net461" />
  <package id="Microsoft.ApplicationInsights.WindowsServer" version="2.5.1" targetFramework="net461" />
  <package id="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel" version="2.5.1" targetFramework="net461" />

Program.cs

//active telemery for application performance monitoring
TelemetryConfiguration.Active.TelemetryInitializers.Add(new ServiceNameInitializer(serviceSettings.ServiceName));
TelemetryConfiguration.Active.DisableTelemetry = !serviceSettings.TelemetryAiEnabled;
TelemetryConfiguration.Active.InstrumentationKey = serviceSettings.TelemetryAiInstrumentationKey;

ServiceNameInitializer

    public class ServiceNameInitializer : ITelemetryInitializer
    {
        private readonly string _serviceName;
        public ServiceNameInitializer(string serviceName)
        {
            _serviceName = serviceName;
        }

        public void Initialize(ITelemetry telemetry)
        {
            telemetry.Context.Cloud.RoleName = _serviceName;
        }
    }

Additional Info:

I use Serilog sinks into AI and this perhaps explains why the server shows up in the Live Metrics maybe the Server Telemetry actually never worked in my case?

When I run the same service on my local machine, the server perf counters (RAM, CPU, etc) appears in AI portal.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
SergeyKanzhelevcommented, Apr 19, 2018

We figured out that this problem most likely caused by Application Insights Profiler, not Application Insights itself. There is no workaround except waiting for an update for Azure Web App extension.

@pharring do you have an estimation for this to be fixed?

0reactions
skyflyercommented, Nov 30, 2018

Thanks @pharring!

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - How to set Telemetry Channel for Application Insights ...
AI: Server telemetry channel was not initialized. So persistent storage is turned off. You need to call ServerTelemetryChannel.Initialize().
Read more >
Telemetry channels in Application Insights - Azure Monitor
This behavior occurs when ServerTelemetryChannel retries because of network failure or timeout, when the telemetry was delivered to the back ...
Read more >
Troubleshoot no data in Application Insights for .NET - Azure
I'm experiencing data loss in a console app or on a web app when the app is about to stop. The SDK channel...
Read more >
Azure cloud service AI TelemetryClient not working
I have a cloud service running in Azure and the TelemetryClient implemented for ApplicationInsights to report TrackTrace, TrackEvent, ...
Read more >
Telemetry channels update - APM tips
Persistence channel was removed. There will be no new versions of Application Insights SDK for devices. The suggested solution is to use ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found