[Work Item #13] Extend the library to make use of Application Insights logging. - #16
Open
scott-wi wants to merge 1 commit into
Open
[Work Item #13] Extend the library to make use of Application Insights logging.#16scott-wi wants to merge 1 commit into
scott-wi wants to merge 1 commit into
Conversation
22 tasks
SummarySummary
CoverageClearHostedEndpoint.Tests - 95.1%
ClearHostedService.Tests - 100%
ClearMeasure.HostedEndpoint - 82%
ClearMeasure.HostedService - 85.6%
NServiceBus.Core - 20.6%
NServiceBus.Persistence.Sql - 5.6%
Serilog.Extensions.Logging - 3.7%
|
11 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #13
User Experience Design
User Flow:
N/A
UI Components:
Error States:
N/A
Accessibility:
Technical Design
Affected Components:
src/ClearHostedService/Configuration/LoggingOptions.cssrc/ClearHostedService/ClearHostedService.cssrc/ClearHostedService/ClearMeasure.HostedService.csprojsrc/ClearHostedService/Infrastructure/TelemetryConverters/CloudRoleNameConverter.cssrc/ClearHostedService/Infrastructure/TelemetryConverters/CloudInstanceConverter.cssrc/ClearHostedEndpoint/Configuration/EndpointOptions.cssrc/ClearHostedEndpoint/ClearHostedEndpoint.cssrc/ClearHostedEndpoint/Infrastructure/Behaviors/TimingBehavior.csImplementation Steps:
src/ClearHostedService/ClearMeasure.HostedService.csprojto addSerilog.Sinks.ApplicationInsightsNuGet package dependencysrc/ClearHostedService/Configuration/LoggingOptions.csto replaceApplicationInsightsInstrumentationKeyproperty withApplicationInsightsConnectionStringproperty and add properties for application name and cloud instancesrc/ClearHostedService/Infrastructure/TelemetryConverters/CloudRoleNameConverter.csto implement ITelemetryConverter for setting CloudRoleName from application namesrc/ClearHostedService/Infrastructure/TelemetryConverters/CloudInstanceConverter.csto implement ITelemetryConverter for setting CloudInstance from machine name or resource group + instance namesrc/ClearHostedService/ClearHostedService.csin theConfigureLogging()method to wire up Application Insights sink with connection string from configuration and register telemetry converters when Application Insights is enabledsrc/ClearHostedEndpoint/Configuration/EndpointOptions.csto addEnableTimingBehaviorboolean property (default: false) for NServiceBus handler timing metricssrc/ClearHostedEndpoint/Infrastructure/Behaviors/TimingBehavior.csto implement NServiceBus pipeline behavior that logs handler execution time using Serilog with Application Insights contextsrc/ClearHostedEndpoint/ClearHostedEndpoint.csin theCreateEndpointConfiguration()method to conditionally register TimingBehavior whenEndpointOptions.EnableTimingBehavioris trueDependencies:
Serilog.Sinks.ApplicationInsights(version 4.0.0 or later) - for Application Insights sink integration with SerilogDatabase Migrations: None
Tests:
src/ClearHostedService.Tests/Infrastructure/TelemetryConverterTests.cssrc/ClearHostedService.Tests/Infrastructure/LoggingConfigurationTests.cssrc/ClearHostedEndpoint.Tests/Infrastructure/TimingBehaviorTests.cssrc/ClearHostedEndpoint.Tests/Infrastructure/EndpointTimingIntegrationTests.csTest Design
Acceptance Tests: None required
Rationale: Backend-only change - This is purely infrastructure-level logging configuration with no user-facing behavior. All testing is covered by the unit and integration tests specified in the technical design.