Skip to content
This repository has been archived by the owner on Jun 10, 2020. It is now read-only.

Enable ServerTelemetryChannel in .net core by the default #530

Merged
merged 13 commits into from Sep 25, 2017

Conversation

iusafaro
Copy link
Contributor

Enable ServerTelemetryChannel in .net core by the default

this.ValidateBasicDependency(assemblyName, "/Home/About/5", InProcessServer.UseApplicationInsights);
const string RequestPath = "/Home/About/5";

using (var server = new InProcessServer(assemblyName))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason of moving this line (using (var server = new InProcessServer(assemblyName))) from base class to each of the subclasses?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was in base class only for dependencies, but for requests and exceptions, it was out of it in individual cases - i moved it out of here for dependencies as well to be more consistent in all methods.

Copy link
Contributor

@cijothomas cijothomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add changelog.md to indicate the new default channel.
Minor questions in comments as well.

  1. Move the fake endpoint to a constant.
  2. Is there a reason of moving this line (using (var server = new InProcessServer(assemblyName))) from base class to each of the subclasses?

var machineName = Environment.GetEnvironmentVariable("COMPUTERNAME");
this.url = "http://" + machineName + ":" + random.Next(5000, 14000).ToString();
this.backChannel = this.Start(assemblyName);

this.listener = new TelemetryHttpListenerObservable("http://localhost:4001/v2/track/");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets make this a constant.

@cijothomas
Copy link
Contributor

Due to some reason build is not triggered automatically! Can you trigger one against this PR. ?

Copy link
Contributor

@SergeyKanzhelev SergeyKanzhelev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@cijothomas cijothomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please trigger 10-20 builds to confirm race condition test failures are resolved before merge.

@KEMBL
Copy link

KEMBL commented Sep 30, 2017

Hello guys,

thank you for enabling of ServerTelemetryChannel in NETCOREAPP2_0, but how to access it now?

in non-Core it is possible like this:

	var channel = new Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.ServerTelemetryChannel();
	channel.StorageFolder = "./CacheFolder/";
	channel.Initialize(TelemetryConfiguration.Active);

how to get the same in core?

@cijothomas
Copy link
Contributor

@KEMBL
Can you open an GH issue, so that the question gets monitored.

Can you retrieve channel like this hostingEngine.Services.GetService()) ?

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

Successfully merging this pull request may close these issues.

None yet

6 participants