Sitelet https://github.com/microsoft/ApplicationInsights-dotnet/issues/1648
Skip to content

Endpoint configuration broken for ServerTelemetryChannel and QuickPulseTelemetryModule (applies to SDK version 2.12.0) #1648

Description

  1. ServerTelemetryChannel
    When I added support for connection strings, I introduced a bug in ServerTelemetryChannel as reported here ServerTelemetryChannel does not respect what is passed via ApplicationInsights.config #1637

public void Initialize(TelemetryConfiguration configuration)
{
if (configuration == null)
{
throw new ArgumentNullException(nameof(configuration));
}
this.Transmitter.Initialize();
this.EndpointAddress = new Uri(configuration.EndpointContainer.Ingestion, "v2/track").AbsoluteUri;
// ApplyPolicies will synchronously get list of file names from disk and calculate size
// Creating task to improve application startup time
ExceptionHandler.Start(() => { return Task.Run(() => this.Transmitter.ApplyPolicies()); });
this.isInitialized = true;
}

ServerTelemetryChannel is erroneously overwriting the Endpoint address on Initialization.

  1. QuickPulseTelemetryModule
    QuickPulseTelemetryModule needs additional work to support manual configuration.

This example from the apmtips blog does not work for connection strings.

TelemetryConfiguration configuration = new TelemetryConfiguration();
configuration.InstrumentationKey = "9d3ebb4f-7a11-4fb1-91ac-7ca8a17a27eb";

QuickPulseTelemetryProcessor processor = null;

configuration.TelemetryProcessorChainBuilder
    .Use((next) =>
    {
        processor = new QuickPulseTelemetryProcessor(next);
        return processor;
    })
    .Build();

var QuickPulse = new QuickPulseTelemetryModule();
QuickPulse.Initialize(configuration);
QuickPulse.RegisterTelemetryProcessor(processor);

Activity

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

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions