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

Make all built-in TelemetryInitializers public to enable easy removal#611

Merged
cijothomas merged 3 commits intodevelopfrom
cithomas/publicinitializers
Mar 1, 2018
Merged

Make all built-in TelemetryInitializers public to enable easy removal#611
cijothomas merged 3 commits intodevelopfrom
cithomas/publicinitializers

Conversation

@cijothomas
Copy link
Copy Markdown
Contributor

TelemetryInitializers being internal makes it difficult to remove an individual one. (need reflection magic to achieve this currently)
Fix Issue # .
#351
#346

  • I ran Unit Tests locally.

For significant contributions please make sure you have completed the following items:

  • Changes in public surface reviewed

  • Design discussion issue #

  • CHANGELOG.md updated with one line description of the fix, and a link to the original issue.

  • The PR will trigger build, unit tests, and functional tests automatically. If your PR was submitted from fork - mention one of committers to initiate the build for you.
    If you want to to re-run the build/tests, the easiest way is to simply Close and Re-Open this same PR. (Just click 'close pull request' followed by 'open pull request' buttons at the bottom of the PR)

  • Please follow [these] (https://github.com/Microsoft/ApplicationInsights-aspnetcore/blob/develop/Readme.md) instructions to build and test locally.

@cijothomas
Copy link
Copy Markdown
Contributor Author

@pakrym Please let me know if we have a strong reason now to keep this internal. @pharring Please take a look as I see you were active in the original issues posted about this.
@SergeyKanzhelev

@pakrym
Copy link
Copy Markdown
Contributor

pakrym commented Feb 28, 2018

Looks good to me

/// on telemetries.
/// </summary>
internal class AspNetCoreEnvironmentTelemetryInitializer: ITelemetryInitializer
public class AspNetCoreEnvironmentTelemetryInitializer: ITelemetryInitializer
Copy link
Copy Markdown
Member

@pharring pharring Feb 28, 2018

Choose a reason for hiding this comment

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

(This comment applies to all the newly public classes.)
Should these types be sealed? It's usually a good idea with public types that were not designed to be extended by users - especially if they have any virtual methods.
You can always unseal a public type later, but you can't go the other way 'round.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I agree it can be made sealed. However, similar ones in Web repo are not sealed.

https://github.com/Microsoft/ApplicationInsights-dotnet-server/blob/develop/Src/Web/Web.Shared.Net/SessionTelemetryInitializer.cs#L12

I'll limit my change to just making classes public for now. When we address (#612) this can be revisited.

/// A telemetry initializer that will gather Azure Web App Role Environment context information.
/// </summary>
internal class AzureWebAppRoleEnvironmentTelemetryInitializer : TelemetryInitializerBase
public class AzureWebAppRoleEnvironmentTelemetryInitializer : TelemetryInitializerBase
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

My comment about sealing applies more-so to those derived from TelemetryInitializerBase

@cijothomas
Copy link
Copy Markdown
Contributor Author

Thanks all for quick review. Will address Pauls comment about sealing these classes when we address #612

@cijothomas cijothomas merged commit 0ec3fac into develop Mar 1, 2018
@cijothomas cijothomas deleted the cithomas/publicinitializers branch April 11, 2018 21:52
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.

4 participants