Skip to content

ServerTelemetryChannel for .Net Core Apps #654

Closed

Description

ServerTelemetryChannel was enabled for .NET Core Applications starting 2.5.0-beta1 (https://github.com/Microsoft/ApplicationInsights-dotnet/releases/tag/v2.5.0-beta1)
This enabled .NET Core apps to use full functionalities provided by ServerTelemetryChannel including persistent storage, retries, adaptive sampling etc.
However, for non-windows users, this release caused an issue. (microsoft/ApplicationInsights-aspnetcore#551)

ServerTelemetryChannel relied on windows specific mechanisms to determine (and secure) local storage folder where telemetry items are stored when it cannot be sent to Application Insights due to temporary network issues. A workaround is currently made (#655).
With the above fix in place, starting with beta2 following is the way for Non-Windows users to fully use persistent storage capabilities.

  1. Create a local storage folder manually, and specify this in ServerTelemetryChannel.StorageFolder. Please make sure that the process running your application has write access to this folder, but also make sure this folder is protected from other users to avoid telemetry being read by unintended users.
    Following code snippet in ConfigureServices() method in you Startup.cs class shows how to use channel with custom storage folder.
services.AddSingleton(typeof(ITelemetryChannel), new ServerTelemetryChannel () {StorageFolder = "/tmp/myfolder"});

If the above is not done, telemetry will still be collected and sent, but in case of network issues, items will get dropped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions