Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TelemetryChannel for Linux #551

Closed
nburoojy opened this issue Nov 14, 2017 · 8 comments

Comments

Projects
None yet
3 participants
@nburoojy
Copy link

commented Nov 14, 2017

Hi,

Is this library supported in Linux environments?

I tried to run v 2.1.1 on Linux and got an exception about a missing ServerTelemetryChannel

I noticed this PR by @iusafaro and @cijothomas to enable ServerTelemetryChannel by default
#530

So I tried 2.2.0-beta1 and get an exception about the platform (probably that it's Linux)

Unhandled Exception: System.PlatformNotSupportedException: Windows Principal functionality is not supported on this platform.
   at System.Security.Principal.WindowsIdentity.GetCurrent()
   at Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.Implementation.ApplicationFolderProvider..ctor(IDictionary environment, String folderName)
   at Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.Implementation.Transmitter.Initialize()
   at Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.ServerTelemetryChannel.Initialize(TelemetryConfiguration configuration)
   at Microsoft.Extensions.DependencyInjection.TelemetryConfigurationOptionsSetup.Configure(TelemetryConfiguration configuration)
   at Microsoft.Extensions.DependencyInjection.TelemetryConfigurationOptions..ctor(IEnumerable`1 configureOptions)
--- End of stack trace from previous location where exception was thrown ---

Thanks!

@cijothomas cijothomas self-assigned this Nov 14, 2017

@cijothomas cijothomas added the bug label Nov 14, 2017

@cijothomas cijothomas added this to the 2.2-beta2 milestone Nov 14, 2017

@cijothomas

This comment has been minimized.

Copy link
Contributor

commented Nov 14, 2017

@nburoojy Thanks for reporting the isssue!
The exception stack you have pasted is arising from the recent change introduced in beta1.
Question - did you have trouble with it in 2.1.1?

@frohikey

This comment has been minimized.

Copy link

commented Nov 14, 2017

I got the same problem on OSX 10.12.6.

2.2.0-beta1 - the same exception as @nburoojy posted
2.1.1 - everything's ok

@cijothomas

This comment has been minimized.

Copy link
Contributor

commented Nov 14, 2017

Thanks @frohikey for reporting the issue!
2.2.0-beta1 enables ServerTelemetryChannel, and this module uses local folder to store the telemetry data before sending to Application Insights Service. There is a code which was Windows-specific and causes the exception/application crash.

We are working to release the fix in beta2.

@nburoojy

This comment has been minimized.

Copy link
Author

commented Nov 14, 2017

On 2.1.1 I get this exception

Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.AI.ServerTelemetryChannel, Version=2.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.

   at Microsoft.Extensions.DependencyInjection.TelemetryConfigurationOptionsSetup.AddTelemetryChannelAndProcessors(TelemetryConfiguration configuration)
   at Microsoft.Extensions.DependencyInjection.TelemetryConfigurationOptionsSetup.Configure(TelemetryConfiguration configuration)
   at Microsoft.Extensions.DependencyInjection.TelemetryConfigurationOptions..ctor(IEnumerable`1 configureOptions)
@nburoojy

This comment has been minimized.

Copy link
Author

commented Nov 14, 2017

Thanks @cijothomas

@cijothomas

This comment has been minimized.

Copy link
Contributor

commented Nov 14, 2017

@nburoojy 2.1.1 does not support ServerTelemetryChannel. It only has InMemoryChannel. 2.2.0-beta1 is the first version which support ServerTelemetryChannel (and it appears broken in non-windows).
https://github.com/Microsoft/ApplicationInsights-aspnetcore/releases

@cijothomas

This comment has been minimized.

Copy link
Contributor

commented Nov 20, 2017

Additional information:
ServerTelemetryChannel is compiled against NET Standard 1.3, and as of now there is .net API to set file permissions in non-windows. (dotnet/corefx#15289)
So for non-windows, channel will not able to secure the temp folder where it stores telemetry (when network issues occur).
This means channel will continue to work normally, except that items will be dropped if there are network issues.
Even with the fix, persistent storage won't come automatically for non-windows customers. To make use of persistent storage, create directory and give the directory location to ServerTelemetryChannel.StorageFolder.

@cijothomas cijothomas closed this Dec 30, 2017

@cijothomas

This comment has been minimized.

Copy link
Contributor

commented May 3, 2018

microsoft/ApplicationInsights-dotnet#654 - Workaround is here:
For quick reference, here the line to be added in ConfigureServices method of Startup class.

services.AddSingleton(typeof(ITelemetryChannel), new ServerTelemetryChannel () {StorageFolder = "/tmp/myfolder"});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.