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

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

Closed
TimothyMothra opened this issue Jan 27, 2020 · 1 comment
Assignees

Comments

@TimothyMothra
Copy link
Member

  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);
@TimothyMothra
Copy link
Member Author

This needs to be released as a hotfix for 2.12 (2.12.1)
and will be included in 2.13-beta2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant