Skip to content

Conversation

@rossgrambo
Copy link
Member

Why this PR?

This change adds support for using OpenTelemetry with Azure Monitor Exporter instead of Application Insights.

Visible Changes

  1. There is a new package, Microsoft.FeatureManagement.Telemetry.AzureMonitor. This package looks very similar to Microsoft.FeatureManagement.Telemetry.ApplicationInsights and works similarly.
  2. There is a new example. Named VariantAndAzureMonitorDemo. It is a clone of VariantAndTelemetry demo but uses OTel and Azure Monitor.

Migrating from .ApplicationInsights to .AzureMonitor

Package

Microsoft.FeatureManagement.Telemetry.AzureMonitor
// instead of
Microsoft.FeatureManagement.Telemetry.ApplicationInsights

Builder extension

builder.Services.AddFeatureManagement()
    .AddAzureMonitorTelemetry();
// instead of
builder.Services.AddFeatureManagement()
    .AddApplicationInsightsTelemetry();

Emitting events

_logger.LogInformation("{microsoft.custom_event.name} {ImageRating}", "Vote", rating);
// instead of
_telemetry.TrackEvent(
  "Vote",
  properties: null,
  metrics: new Dictionary<string, double>
  {
    { "ImageRating", rating }
  });

*Note: Even better, use High-performance logging, like the LoggerExtension.cs in the example.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for using OpenTelemetry with Azure Monitor Exporter as an alternative to Application Insights for feature flag telemetry. The implementation uses structured logging instead of direct TelemetryClient calls, making it more flexible and aligned with modern .NET logging patterns.

Key changes:

  • New Microsoft.FeatureManagement.Telemetry.AzureMonitor package with OpenTelemetry-based telemetry
  • New test project Tests.FeatureManagement.Telemetry.AzureMonitor with comprehensive test coverage
  • New example application VariantAndAzureMonitorDemo demonstrating the usage

Reviewed changes

Copilot reviewed 38 out of 91 changed files in this pull request and generated 4 comments.

File Description
src/Microsoft.FeatureManagement.Telemetry.AzureMonitor/*.cs Core implementation of Azure Monitor telemetry using OpenTelemetry processors and structured logging
src/Microsoft.FeatureManagement.Telemetry.AzureMonitor/*.csproj Package configuration with OpenTelemetry dependencies
tests/Tests.FeatureManagement.Telemetry.AzureMonitor/*.cs Test suite covering telemetry logging and processor ordering
examples/VariantAndAzureMonitorDemo/* Demo application showing migration from Application Insights to Azure Monitor

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Successfully merging this pull request may close these issues.

2 participants