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

Use DI container instead of TelemetryConfiguration.Active #15

Merged
merged 16 commits into from
Apr 13, 2015
Merged

Use DI container instead of TelemetryConfiguration.Active #15

merged 16 commits into from
Apr 13, 2015

Conversation

olegsych
Copy link
Member

Addresses issues #10 and #11.

…with scoped lifecycle (per-request) instead of singleton lifecycle (per-application).
…ed TelemetryConfiguration singleton and use this instance instead of TelemetryConfiguration.Active in the request-scoped TelemetryClient service.
@SergeyKanzhelev
Copy link
Contributor

So cool! Approved

- Extend AddApplicationInsightsTelemetry to register context and telemetry initializers.
…metryConfiguration.Active.InstrumentationKey because it is now set for the singleton instance in the container
…he container instead of the global TelemetryConfiguration.Active
…tance of TelemetryConfiguration (with default initializers and channel)
…from ActiveConfigurationManager because they are no longer needed
…caitonInsightsExtentions because it is only used there.

- Remove ActiveConfigurationManager because it is now empty.
… grouping method-specific tests and make additional tests easier to maintain.
…s TelemetryConfiguration service from the DI container instead of the global TelemetryConfiguration.Active instance.
…dynamic test isolation framework like NSubstitute or Moq.
@olegsych olegsych changed the title [Work in Progress] Use DI container instead of TelemetryConfiguration.Active Use DI container instead of TelemetryConfiguration.Active Apr 13, 2015
}
}

private static void AddInstrumentationKey(IConfiguration config, TelemetryConfiguration telemetryConfiguration)
Copy link
Member Author

Choose a reason for hiding this comment

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

This feels like an ITelemetryInitializer. Thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's very distinct step you want to make more explicitly than setting up telemetry initializers. Kind of initialization/configure step

@SergeyKanzhelev
Copy link
Contributor

It will be great if you will check in in smaller changesets. Looks good again, approved

olegsych and others added 4 commits April 13, 2015 14:07
olegsych added a commit that referenced this pull request Apr 13, 2015
Use DI container instead of TelemetryConfiguration.Active global instance.
@olegsych olegsych merged commit bd74c4f into microsoft:master Apr 13, 2015
@olegsych olegsych deleted the TelemetryClientScope branch April 13, 2015 21:49
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

2 participants