# Review related-log sampling when migrating to Application Insights .NET SDK 3.x

> Which trace-sampling relationships should a .NET SDK 3.x migration test preserve?

- Canonical URL: https://update.dsesecurity.com/updates/dse-20260909-421-review-related-log-sampling-when-migrating-to-application-insights-net-sdk-3-x/
- Publisher: Detection Systems & Engineering (DSE Security)
- Author: DSE Security Editorial Team
- Published: 2026-09-10T00:24:55+00:00
- Modified: 2026-09-10T02:04:57+00:00
- Last reviewed by DSE: 2026-09-09
- Resource type: Guide
- DSE priority: Information
- Topics: IT
- Reading time: 2 minutes

## What you need to know

Which trace-sampling relationships should a .NET SDK 3.x migration test preserve?

## Potentially affected

Applications migrating Application Insights .NET SDK 2.x instrumentation to the OpenTelemetry-based .NET SDK 3.x.

## DSE recommendation

Validate related logs alongside their parent trace rather than checking only aggregate telemetry arrival after the upgrade.

## Article

## Source facts

Application Insights .NET SDK 3.x applies the same sampling settings to requests and dependencies; it does not support separate settings for those two signals. Related logs inherit their parent trace’s sampling decision by default, with EnableTraceBasedLogsSampler available to disable that behavior. Microsoft prohibits mixing 2.x and 3.x packages, or using SDK 3.x alongside the Azure Monitor OpenTelemetry Distro in one application. [Microsoft Learn](https://learn.microsoft.com/en-us/azure/azure-monitor/app/migrate-to-opentelemetry).

## Applicability

This concerns the .NET SDK 3.x migration path, not every OpenTelemetry collector or language SDK. Keep the intended sampling policy explicit before comparing old and new telemetry populations.

## DSE recommendation

Validate related logs alongside their parent trace rather than checking only aggregate telemetry arrival after the upgrade. Identify a representative request, its dependency and its related log records in the migration test. Have the application owner decide whether the default trace-related log policy matches the intended diagnostic use. Do not change the switch merely to increase visible records without considering the desired correlation and volume.

## Verification

Review the resolved package set and effective sampling configuration in a controlled environment. Exercise repeatable sample requests and compare the observed parent-child relationships with the approved policy. Include any intentional independent-log behavior in the test expectation. Preserve the configuration and representative outcomes before rollout; a nonempty destination table alone should not be reported as proof that the migration retained its intended trace and log relationships.

## Official references

[Microsoft Learn: Application Insights OpenTelemetry migration](https://learn.microsoft.com/en-us/azure/azure-monitor/app/migrate-to-opentelemetry). Source reviewed September 9, 2026.

## Primary reference

- Name: Migrate Application Insights Classic API Software Development Kits (SDKs) to Azure Monitor OpenTelemetry - Azure Monitor | Microsoft Learn
- Authority: Microsoft Learn
- URL: https://learn.microsoft.com/en-us/azure/azure-monitor/app/migrate-to-opentelemetry
- Source publication date: Not stated by the source

## Citation and use

Preferred citation: “Review related-log sampling when migrating to Application Insights .NET SDK 3.x,” DSE Security, https://update.dsesecurity.com/updates/dse-20260909-421-review-related-log-sampling-when-migrating-to-application-insights-net-sdk-3-x/
Publishing principles: https://update.dsesecurity.com/updates/dse-updates-editorial-methodology/
Usage and citation policy: https://update.dsesecurity.com/usage/
Copyright © 2026 Detection Systems & Engineering. All rights reserved.
