Skip to content

Commit

Permalink
Merge pull request #904 from MicrosoftDocs/main
Browse files Browse the repository at this point in the history
1/2/2025 PM Publish
  • Loading branch information
Taojunshen authored Jan 2, 2025
2 parents a8b26f3 + 7f63744 commit 16cb436
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 193 deletions.
2 changes: 2 additions & 0 deletions articles/azure-monitor/app/api-custom-events-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ ms.reviewer: mmcc

# Application Insights API for custom events and metrics

[!INCLUDE [azure-monitor-app-insights-otel-available-notification](../includes/azure-monitor-app-insights-otel-available-notification.md)]

Insert a few lines of code in your application to find out what users are doing with it, or to help diagnose issues. You can send telemetry from device and desktop apps, web clients, and web servers. Use the [Application Insights](./app-insights-overview.md) core telemetry API to send custom events and metrics and your own versions of standard telemetry. This API is the same API that the standard Application Insights data collectors use.

[!INCLUDE [azure-monitor-log-analytics-rebrand](~/reusable-content/ce-skilling/azure/includes/azure-monitor-instrumentation-key-deprecation.md)]
Expand Down
6 changes: 5 additions & 1 deletion articles/azure-monitor/app/api-filtering-sampling.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ ms.reviewer: cithomas

# Filter and preprocess telemetry in the Application Insights SDK

[!INCLUDE [azure-monitor-app-insights-otel-available-notification](../includes/azure-monitor-app-insights-otel-available-notification.md)]

You can write code to filter, modify, or enrich your telemetry before it's sent from the SDK. The processing includes data that's sent from the standard telemetry modules, such as HTTP request collection and dependency collection.

* [Filtering](./api-filtering-sampling.md#filtering) can modify or discard telemetry before it's sent from the SDK by implementing `ITelemetryProcessor`. For example, you could reduce the volume of telemetry by excluding requests from robots. Unlike sampling, You have full control over what is sent or discarded, but it affects any metrics based on aggregated logs. Depending on how you discard items, you might also lose the ability to navigate between related items.
Expand Down Expand Up @@ -96,10 +98,12 @@ To filter telemetry, you write a telemetry processor and register it with `Telem

> [!WARNING]
> Take care to match the type name and any property names in the .config file to the class and property names in the code. If the .config file references a nonexistent type or property, the SDK may silently fail to send any telemetry.
>

Alternatively, you can initialize the filter in code. In a suitable initialization class, for example, AppStart in `Global.asax.cs`, insert your processor into the chain:

> [!NOTE]
> The following code sample is obsolete, but is made available here for posterity. Consider [getting started with OpenTelemetry](opentelemetry-enable.md) or [migrating to OpenTelemetry](opentelemetry-dotnet-migrate.md).

```csharp
var builder = TelemetryConfiguration.Active.DefaultTelemetrySink.TelemetryProcessorChainBuilder;
builder.Use((next) => new SuccessfulDependencyFilter(next));
Expand Down
176 changes: 0 additions & 176 deletions articles/azure-monitor/app/codeless-app-service.md
Original file line number Diff line number Diff line change
Expand Up @@ -772,182 +772,6 @@ If you're missing telemetry, follow these steps to confirm that autoinstrumentat
If your app uses Django and is either failing to start or using incorrect settings, make sure to set the `DJANGO_SETTINGS_MODULE` environment variable. See the [Django Instrumentation](#django-instrumentation) section for details.

For the latest updates and bug fixes, [consult the release notes](web-app-extension-release-notes.md).

---

## Release notes

This section contains the release notes for Azure App Service based on ANT release for runtime instrumentation with Application Insights.

To find which version of the extension you're currently using, go to `https://<yoursitename>.scm.azurewebsites.net/ApplicationInsights`.

## [ASP.NET Core](#tab/aspnetcore)

#### 2.8.44

* Upgraded to [ApplicationInsights .NET SDK to 2.20.1](https://github.com/microsoft/ApplicationInsights-dotnet/tree/autoinstrumentation/2.20.1).

#### 2.8.43

* Separate .NET/.NET Core, Java, and Node.js package into different App Service Windows Site Extension.

#### 2.8.42

* Added self-contained deployments and .NET 6.0 support using [.NET Startup Hook](https://github.com/dotnet/runtime/blob/main/docs/design/features/host-startup-hook.md).

#### 2.8.41

* Removed out-of-support version (2.1). Supported versions are 3.1 and 5.0.

#### 2.8.39

* Added .NET Core 5.0 support.

#### 2.8.38

* Removed out-of-support versions (2.0, 2.2, 3.0). Supported versions are 2.1 and 3.1.

#### 2.8.37

* AppSvc Windows extension: Made .NET Core work with any version of System.Diagnostics.DiagnosticSource.dll.

#### 2.8.36

* AppSvc Windows extension: Enabled Inter-op with AI SDK in .NET Core.

#### 2.8.35

* AppSvc Windows extension: Added .NET Core 3.1 support.

#### 2.8.33

* .NET, .NET core, Java, and Node.js agents and the Windows Extension: Support for sovereign clouds. Connections strings can be used to send data to sovereign clouds.

#### 2.8.31

* The ASP.NET Core agent fixed an issue with the Application Insights SDK. If the runtime loaded the incorrect version of `System.Diagnostics.DiagnosticSource.dll`, the codeless extension doesn't crash the application and backs off. To fix the issue, customers should remove `System.Diagnostics.DiagnosticSource.dll` from the bin folder or use the older version of the extension by setting `ApplicationInsightsAgent_EXTENSIONVERSION=2.8.24`. If they don't, application monitoring isn't enabled.

#### 2.8.26

* Fixed issue related to updated Application Insights SDK. The agent doesn't try to load `AiHostingStartup` if the ApplicationInsights.dll is already present in the bin folder. It resolves issues related to reflection via Assembly\<AiHostingStartup\>.GetTypes().

* Known issues: Exception `System.IO.FileLoadException: Could not load file or assembly 'System.Diagnostics.DiagnosticSource, Version=4.0.4.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'` could be thrown if another version of `DiagnosticSource` dll is loaded. It could happen, for example, if `System.Diagnostics.DiagnosticSource.dll` is present in the publish folder. As mitigation, use the previous version of extension by setting app settings in app services: ApplicationInsightsAgent_EXTENSIONVERSION=2.8.24.

#### 2.8.24

* Repackaged version of 2.8.21.

#### 2.8.23

* Added ASP.NET Core 3.0 codeless monitoring support.

* Updated ASP.NET Core SDK to [2.8.0](https://github.com/microsoft/ApplicationInsights-aspnetcore/releases/tag/2.8.0) for runtime versions 2.1, 2.2 and 3.0. Apps targeting .NET Core 2.0 continue to use 2.1.1 of the SDK.

#### 2.8.14

* Updated ASP.NET Core SDK version from 2.3.0 to the latest (2.6.1) for apps targeting .NET Core 2.1, 2.2. Apps targeting .NET Core 2.0 continue to use 2.1.1 of the SDK.

#### 2.8.12

* Support for ASP.NET Core 2.2 apps.

* Fixed a bug in ASP.NET Core extension causing injection of SDK even when the application is already instrumented with the SDK. For 2.1 and 2.2 apps, the presence of ApplicationInsights.dll in the application folder now causes the extension to back off. For 2.0 apps, the extension backs off only if ApplicationInsights is enabled with a `UseApplicationInsights()` call.

* Permanent fix for incomplete HTML response for ASP.NET Core apps. This fix is now extended to work for .NET Core 2.2 apps.

* Added support to turn off JavaScript injection for ASP.NET Core apps (`APPINSIGHTS_JAVASCRIPT_ENABLED=false appsetting`). For ASP.NET core, the JavaScript injection is in "Opt-Out" mode by default, unless explicitly turned off. (The default setting is done to retain current behavior.)

* Fixed ASP.NET Core extension bug that caused injection even if ikey wasn't present.

* Fixed a bug in the SDK version prefix logic that caused an incorrect SDK version in telemetry.

* Added SDK version prefix for ASP.NET Core apps to identify how telemetry was collected.

* Fixed SCM- ApplicationInsights page to correctly show the version of the preinstalled extension.

#### 2.8.10

* Fix for incomplete HTML response for ASP.NET Core apps.

## [.NET](#tab/net)

#### 2.8.44

* Upgraded to [ApplicationInsights .NET SDK to 2.20.1](https://github.com/microsoft/ApplicationInsights-dotnet/tree/autoinstrumentation/2.20.1).

#### 2.8.43

* Separate .NET/.NET Core, Java, and Node.js package into different App Service Windows Site Extension.

#### 2.8.33

* .NET, .NET core, Java, and Node.js agents and the Windows Extension: Support for sovereign clouds. Connections strings can be used to send data to sovereign clouds.

#### 2.8.24

* Repackaged version of 2.8.21.

## [Java](#tab/java)

#### 2.8.43

* Separate .NET/.NET Core, Java, and Node.js package into different App Service Windows Site Extension.

#### 2.8.42

* Upgraded to [Java Agent 3.2.0](https://github.com/microsoft/ApplicationInsights-Java/releases/tag/3.2.0) from 2.5.1.

#### 2.8.40

* Upgraded to [Java Agent 3.1.1 (GA)](https://github.com/microsoft/ApplicationInsights-Java/releases/tag/3.1.1) from 3.0.2.

#### 2.8.38

* Upgraded to [Java Agent 3.0.2 (GA)](https://github.com/microsoft/ApplicationInsights-Java/releases/tag/3.0.2) from 2.5.1.

#### 2.8.33

* .NET, .NET core, Java, and Node.js agents and the Windows Extension: Support for sovereign clouds. Connections strings can be used to send data to sovereign clouds.

#### 2.8.24

* Repackaged version of 2.8.21.

## [Node.js](#tab/nodejs)

#### 2.8.43

* Separate .NET/.NET Core, Java, and Node.js package into different App Service Windows Site Extension.

#### 2.8.42

* Updated AI SDK to [2.1.8](https://github.com/microsoft/ApplicationInsights-node.js/releases/tag/2.1.8) from 2.1.7. Added support for User and System assigned Microsoft Entra managed identities.

#### 2.8.41

* Updated AI SDK to [2.1.7](https://github.com/microsoft/ApplicationInsights-node.js/releases/tag/2.1.7) from 2.1.3.

#### 2.8.40

* Updated AI SDK to [2.1.3](https://github.com/microsoft/ApplicationInsights-node.js/releases/tag/2.1.3) from 1.8.8.

#### 2.8.38

* Updated AI SDK to [1.8.8](https://github.com/microsoft/ApplicationInsights-node.js/releases/tag/1.8.8) from 1.8.7.

#### 2.8.33

* .NET, .NET core, Java, and Node.js agents and the Windows Extension: Support for sovereign clouds. Connections strings can be used to send data to sovereign clouds.

#### 2.8.24

* Repackaged version of 2.8.21.

## [Python (Preview)](#tab/python)

Release notes for Python will show here.

---

## Next steps

Expand Down
2 changes: 2 additions & 0 deletions articles/azure-monitor/app/java-standalone-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ ms.reviewer: mmcc

This article shows you how to configure Azure Monitor Application Insights for Java.

For more information, see [Get started with OpenTelemetry](opentelemetry-enable.md) which includes [sample applications](opentelemetry-enable.md#sample-applications).

## Connection string and role name

Connection string and role name are the most common settings you need to get started:
Expand Down
5 changes: 4 additions & 1 deletion articles/azure-monitor/app/opentelemetry-add-modify.md
Original file line number Diff line number Diff line change
Expand Up @@ -1272,6 +1272,9 @@ span.recordException(e);

#### [Node.js](#tab/nodejs)

The Node.js SDK will only export these manually recorded span-based exceptions to Application Insights as exceptions if they are recorded on the children of
remote, internal spans, or if the exception is recorded on a top level span.

```javascript
// Import the Azure Monitor OpenTelemetry plugin and OpenTelemetry API
const { useAzureMonitor } = require("@azure/monitor-opentelemetry");
Expand All @@ -1287,7 +1290,7 @@ const tracer = trace.getTracer("testTracer");
let span = tracer.startSpan("hello");

// Try to throw an error
try{
try {
throw new Error("Test Error");
}

Expand Down
39 changes: 25 additions & 14 deletions articles/azure-monitor/app/opentelemetry-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,20 @@ Use one of the following two ways to configure the connection string:
// Create a new OpenTelemetry tracer provider.
// It is important to keep the TracerProvider instance active throughout the process lifetime.
var tracerProvider = Sdk.CreateTracerProviderBuilder()
.AddAzureMonitorTraceExporter(options =>
{
options.ConnectionString = "<Your Connection String>";
});
.AddAzureMonitorTraceExporter(options =>
{
options.ConnectionString = "<Your Connection String>";
})
.Build();

// Create a new OpenTelemetry meter provider.
// It is important to keep the MetricsProvider instance active throughout the process lifetime.
var metricsProvider = Sdk.CreateMeterProviderBuilder()
.AddAzureMonitorMetricExporter(options =>
{
options.ConnectionString = "<Your Connection String>";
});
})
.Build();

// Create a new logger factory.
// It is important to keep the LoggerFactory instance active throughout the process lifetime.
Expand Down Expand Up @@ -232,14 +234,16 @@ var resourceBuilder = ResourceBuilder.CreateDefault().AddAttributes(resourceAttr
var tracerProvider = Sdk.CreateTracerProviderBuilder()
// Set ResourceBuilder on the TracerProvider.
.SetResourceBuilder(resourceBuilder)
.AddAzureMonitorTraceExporter();
.AddAzureMonitorTraceExporter()
.Build();

// Create a new OpenTelemetry meter provider and set the resource builder.
// It is important to keep the MetricsProvider instance active throughout the process lifetime.
var metricsProvider = Sdk.CreateMeterProviderBuilder()
// Set ResourceBuilder on the MeterProvider.
.SetResourceBuilder(resourceBuilder)
.AddAzureMonitorMetricExporter();
.AddAzureMonitorMetricExporter()
.Build();

// Create a new logger factory and add the OpenTelemetry logger provider with the resource builder.
// It is important to keep the LoggerFactory instance active throughout the process lifetime.
Expand Down Expand Up @@ -358,7 +362,8 @@ var tracerProvider = Sdk.CreateTracerProviderBuilder()
{
// Set the sampling ratio to 10%. This means that 10% of all traces will be sampled and sent to Azure Monitor.
options.SamplingRatio = 0.1F;
});
})
.Build();
```

### [Java](#tab/java)
Expand Down Expand Up @@ -567,15 +572,17 @@ We support the credential classes provided by [Azure Identity](https://github.co
.AddAzureMonitorTraceExporter(options =>
{
options.Credential = credential;
});
})
.Build();

// Create a new OpenTelemetry meter provider and set the credential.
// It is important to keep the MetricsProvider instance active throughout the process lifetime.
var metricsProvider = Sdk.CreateMeterProviderBuilder()
.AddAzureMonitorMetricExporter(options =>
{
options.Credential = credential;
});
})
.Build();

// Create a new logger factory and add the OpenTelemetry logger provider with the credential.
// It is important to keep the LoggerFactory instance active throughout the process lifetime.
Expand Down Expand Up @@ -745,7 +752,8 @@ var tracerProvider = Sdk.CreateTracerProviderBuilder()
// Set the Azure Monitor storage directory to "C:\\SomeDirectory".
// This is the directory where the OpenTelemetry SDK will store any trace data that cannot be sent to Azure Monitor immediately.
options.StorageDirectory = "C:\\SomeDirectory";
});
})
.Build();

// Create a new OpenTelemetry meter provider and set the storage directory.
// It is important to keep the MetricsProvider instance active throughout the process lifetime.
Expand All @@ -755,7 +763,8 @@ var metricsProvider = Sdk.CreateMeterProviderBuilder()
// Set the Azure Monitor storage directory to "C:\\SomeDirectory".
// This is the directory where the OpenTelemetry SDK will store any metric data that cannot be sent to Azure Monitor immediately.
options.StorageDirectory = "C:\\SomeDirectory";
});
})
.Build();

// Create a new logger factory and add the OpenTelemetry logger provider with the storage directory.
// It is important to keep the LoggerFactory instance active throughout the process lifetime.
Expand Down Expand Up @@ -914,13 +923,15 @@ You might want to enable the OpenTelemetry Protocol (OTLP) Exporter alongside th
// It is important to keep the TracerProvider instance active throughout the process lifetime.
var tracerProvider = Sdk.CreateTracerProviderBuilder()
.AddAzureMonitorTraceExporter()
.AddOtlpExporter();
.AddOtlpExporter()
.Build();

// Create a new OpenTelemetry meter provider and add the Azure Monitor metric exporter and the OTLP metric exporter.
// It is important to keep the MetricsProvider instance active throughout the process lifetime.
var metricsProvider = Sdk.CreateMeterProviderBuilder()
.AddAzureMonitorMetricExporter()
.AddOtlpExporter();
.AddOtlpExporter()
.Build();
```

### [Java](#tab/java)
Expand Down
2 changes: 1 addition & 1 deletion articles/azure-monitor/app/opentelemetry-dotnet-migrate.md
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ builder.Services.Configure<HttpClientTraceInstrumentationOptions>(options =>

##### Customizing SqlClientInstrumentationOptions

We vendor the [SQLClient](https://www.nuget.org/packages/OpenTelemetry.Instrumentation.SqlClient) instrumentation within our package while it's still in beta. When it reaches a stable release, we include it as a standard package reference. Until then, to customize the SQLClient instrumentation, add the `OpenTelemetry.Instrumentation.SqlClient` package reference to your project and use its public API.
We provide the [SQLClient](https://www.nuget.org/packages/OpenTelemetry.Instrumentation.SqlClient) instrumentation within our package while it's still in beta. When it reaches a stable release, we'll include it as a standard package reference. Until then, to customize the SQLClient instrumentation, add the `OpenTelemetry.Instrumentation.SqlClient` package reference to your project and use its public API.

```
dotnet add package --prerelease OpenTelemetry.Instrumentation.SqlClient
Expand Down

0 comments on commit 16cb436

Please sign in to comment.