You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- ❌ **`CreateFromConfiguration(string config)`** - Static method that created a TelemetryConfiguration from XML configuration string. Use `CreateDefault()` or the parameterless constructor and set properties directly.
111
+
109
112
### Properties with Changed Behavior
110
113
- ✅ **`ConnectionString`** - Still exists but behavior differs
111
114
-**2.x**: String property
112
115
-**3.x**: Setting this calls OpenTelemetry configuration internally
113
-
- ✅ **`DisableTelemetry`** - Still exists but does not disable flow of telemetry (will be fixed later)
114
116
115
117
### Methods with changed Behavior
116
118
- CreateDefault() returns an internal static configuration instead of a new TelemetryConfiguration()
@@ -139,11 +141,8 @@ Most TelemetryContext modules have now been marked internal or removed. The prop
139
141
### Properties Retained
140
142
141
143
The following remain **public**:
142
-
- ✅ `Cloud` (RoleName, RoleInstance)
143
-
- Note: These are settable via resource attributes (service.name & service.instance.id) in OpenTelemetry; we are working on fixing functionality for setting the same via CloudContext.
144
144
- ✅ `User` (Id, AuthenticatedUserId, UserAgent)
145
-
- ✅ `Operation` (Name, SyntheticSource)
146
-
- Note: A future work item is to make sure SyntheticSource can be read from properly and emitted in the telemetry item.
145
+
- ✅ `Operation` (Name)
147
146
- ✅ `Location` (Ip)
148
147
- ✅ `GlobalProperties`
149
148
@@ -197,6 +196,11 @@ The following extension methods remain with identical signatures:
197
196
- ❌ **`ExceptionTrackingMiddleware`** - Middleware class removed
- ✅ **`TracesPerSecond`** (double?) - Gets or sets the number of traces per second for rate-limited sampling (default sampling mode). Replaces `EnableAdaptiveSampling`.
236
240
- ✅ **`SamplingRatio`** (float?) - Gets or sets the sampling ratio for traces (0.0 to 1.0). A value of 1.0 means all telemetry is sent. Replaces `EnableAdaptiveSampling`.
241
+
- ✅ **`EnableTraceBasedLogsSampler`** (bool?) - Gets or sets whether trace-based log sampling is enabled (default: true). When enabled, logs are sampled based on the sampling decision of the associated trace.
237
242
238
243
### JavaScriptSnippet Constructor Change
239
244
**2.x:**
@@ -286,20 +291,21 @@ The following extension methods remain with identical signatures:
286
291
- ❌ **`EndpointAddress`** - No longer configurable (`ConnectionString` contains endpoints)
287
292
- ❌ **`DependencyCollectionOptions`** - Removed (non-functional, use OpenTelemetry instrumentation options)
288
293
- ❌ **`EnableAdaptiveSampling`** - Removed, rate limited sampling is now the default.
294
+
- ❌ **`EnableDebugLogger`** - Removed
289
295
290
296
### Properties Retained
291
297
- ✅ **`ConnectionString`** - Primary configuration method (maps to `AzureMonitorExporterOptions.ConnectionString`)
292
298
- ✅ **`ApplicationVersion`** - Still configurable
293
299
- ✅ **`EnableDependencyTrackingTelemetryModule`** - Still configurable
294
300
- ✅ **`EnablePerformanceCounterCollectionModule`** - Still configurable
295
301
- ✅ **`EnableQuickPulseMetricStream`** - Maps to `AzureMonitorExporterOptions.EnableLiveMetrics`
296
-
- ✅ **`EnableDebugLogger`** - Still configurable though has no effect
297
302
- ✅ **`AddAutoCollectedMetricExtractor`** - Still configurable
- ✅ **`TracesPerSecond`** (double?) - Gets or sets the number of traces per second for rate-limited sampling (default sampling mode). Replaces `EnableAdaptiveSampling`.
302
307
- ✅ **`SamplingRatio`** (float?) - Gets or sets the sampling ratio for traces (0.0 to 1.0). A value of 1.0 means all telemetry is sent. Replaces `EnableAdaptiveSampling`.
308
+
- ✅ **`EnableTraceBasedLogsSampler`** (bool?) - Gets or sets whether trace-based log sampling is enabled (default: true). When enabled, logs are sampled based on the sampling decision of the associated trace.
303
309
304
310
## Migration Impact
305
311
- Any code depending on `InstrumentationKey` must migrate to `ConnectionString`
If you use NLog, log4Net or System.Diagnostics.Trace for diagnostic tracing in your application, you can have your logs sent to Application Insights, where you can explore and search them. Your logs will be merged with the other telemetry coming from your application, so that you can identify the traces associated with servicing each user request, and correlate them with other events and exception reports.
26
7
27
-
Read more:
28
-
-[Microsoft Docs: "Explore .NET trace logs in Application Insights"](https://docs.microsoft.com/azure/application-insights/app-insights-asp-net-trace-logs)
29
-
-[Microsoft Docs: "Diagnose sudden changes in your app telemetry"](https://docs.microsoft.com/azure/application-insights/app-insights-analytics-diagnostics#trace)
30
-
31
-
## ILogger
32
-
See [this](src/ILogger/Readme.md).
33
8
34
9
## NLog
35
10
@@ -78,7 +53,7 @@ For more information, see the [Azure.Identity documentation](https://learn.micro
***Configure ApplicationInsightsTarget using NLog Config API** :
114
78
If you configure NLog programmatically with the [NLog Config API](https://github.com/nlog/NLog/wiki/Configuration-API), then create Application Insights target in code and add it to your other targets:
Microsoft.ApplicationInsights.TraceListener nuget package modifies web.config and adds application insights listener.
154
-
155
-
For more information, see ["Microsoft Docs: "Tracing and Instrumenting Applications"](https://docs.microsoft.com/dotnet/framework/debug-trace-profile/tracing-and-instrumenting-applications)
`EventSourceTelemetryModule` allows you to configure EventSource events to be sent to Application Insights as traces.
182
-
183
-
For more information, see [Microsoft Docs: "Using EventSource Events"](https://docs.microsoft.com/azure/application-insights/app-insights-asp-net-trace-logs#using-eventsource-events).
184
-
185
-
186
-
## ETW
187
-
188
-
`EtwCollectorTelemetryModule` allows you to configure events from ETW providers to be sent to Application Insights as traces.
189
-
190
-
For more information, see [Microsoft Docs: "Using ETW Events"](https://docs.microsoft.com/azure/application-insights/app-insights-asp-net-trace-logs#using-etw-events).
191
-
192
-
193
-
## DiagnosticSource
194
-
195
-
You can configure `System.Diagnostics.DiagnosticSource` events to be sent to Application Insights as traces.
196
-
197
-
For more information, see [CoreFX: "Diagnostic Source Users Guide"](https://github.com/dotnet/corefx/blob/master/src/System.Diagnostics.DiagnosticSource/src/DiagnosticSourceUsersGuide.md).
198
-
199
-
To enable, edit the `TelemetryModules` section of the ApplicationInsights.config file:
0 commit comments