Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge 1.1.1 hotfix to main #43688

Merged
merged 7 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions eng/Packages.Data.props
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,11 @@

<ItemGroup Condition="$(MSBuildProjectName.StartsWith('Azure.Monitor.OpenTelemetry'))">
<!-- OpenTelemetry dependency approved for Azure.Monitor.OpenTelemetry.Exporter package only -->
<PackageReference Update="OpenTelemetry" Version="1.8.0" />
<PackageReference Update="OpenTelemetry.Exporter.InMemory" Version="1.8.0" />
<PackageReference Update="OpenTelemetry.Extensions.Hosting" Version="1.8.0" />
<PackageReference Update="OpenTelemetry.Instrumentation.AspNetCore" Version="1.7.0" />
<PackageReference Update="OpenTelemetry.Instrumentation.Http" Version="1.7.0" />
<PackageReference Update="OpenTelemetry" Version="1.8.1" />
<PackageReference Update="OpenTelemetry.Exporter.InMemory" Version="1.8.1" />
<PackageReference Update="OpenTelemetry.Extensions.Hosting" Version="1.8.1" />
<PackageReference Update="OpenTelemetry.Instrumentation.AspNetCore" Version="1.8.1" />
<PackageReference Update="OpenTelemetry.Instrumentation.Http" Version="1.8.1" />
<PackageReference Update="OpenTelemetry.PersistentStorage.FileSystem" Version="1.0.0" />
<PackageReference Update="Microsoft.AspNetCore.Http.Abstractions" Version="[2.1.1,6.0)" />
<PackageReference Update="Microsoft.AspNetCore.Http.Features" Version="[2.1.1,6.0)" />
Expand Down Expand Up @@ -334,7 +334,7 @@
<PackageReference Update="NSubstitute" Version="3.1.0" />
<PackageReference Update="NUnit" Version="3.13.2" />
<PackageReference Update="NUnit3TestAdapter" Version="4.4.2" />
<PackageReference Update="OpenTelemetry" Version="1.8.0" />
<PackageReference Update="OpenTelemetry" Version="1.8.1" />
<PackageReference Update="OpenTelemetry.Instrumentation.SqlClient" Version="1.6.0-beta.3" />
<PackageReference Update="Polly" Version="7.1.0" />
<PackageReference Update="Polly.Contrib.WaitAndRetry" Version="1.1.1" />
Expand Down
12 changes: 12 additions & 0 deletions sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,18 @@
resource detector to include the Azure Container Apps resource detector.
([#41803](https://github.com/Azure/azure-sdk-for-net/pull/41803))

## 1.1.1 (2024-04-26)

### Other Changes

* Update OpenTelemetry dependencies.
([#43432](https://github.com/Azure/azure-sdk-for-net/pull/43432))
- OpenTelemetry 1.8.1
- OpenTelemetry.Extensions.Hosting 1.8.1
- OpenTelemetry.Instrumentation.AspNetCore 1.8.1
- OpenTelemetry.Instrumentation.Http 1.8.1
- This update is a response to [CVE-2024-32028](https://nvd.nist.gov/vuln/detail/CVE-2024-32028)

## 1.1.0 (2024-01-25)

### Other Changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ If an app has a reference to the [OpenTelemetry.Instrumentation.AspNetCore](http
If an app references the [OpenTelemetry.Instrumentation.Http](https://www.nuget.org/packages/OpenTelemetry.Instrumentation.Http) or [OpenTelemetry.Instrumentation.SqlClient](https://www.nuget.org/packages/OpenTelemetry.Instrumentation.SqlClient) packages, it might be missing dependency telemetry. To resolve:

* Remove the respective package references (or)
* Add `AddHttpClientInstrumentation` or `AddSqlClientInstrumentation` to the TracerProvider configuration. Detailed guidance can be found in the OpenTelemetry documentation for [HTTP](https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/src/OpenTelemetry.Instrumentation.Http) and [SQL Client](https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/src/OpenTelemetry.Instrumentation.SqlClient).
* Add `AddHttpClientInstrumentation` or `AddSqlClientInstrumentation` to the TracerProvider configuration. Detailed guidance can be found in the OpenTelemetry documentation for [HTTP](https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/src/OpenTelemetry.Instrumentation.Http) and [SQL Client](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/tree/main/src/OpenTelemetry.Instrumentation.SqlClient).

**Note:** If all telemetries are missing or if the above troubleshooting steps do not help, please collect [self-diagnostics logs](https://github.com/open-telemetry/opentelemetry-dotnet/blob/main/src/OpenTelemetry/README.md#troubleshooting).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using Azure.Monitor.OpenTelemetry.AspNetCore.LiveMetrics;
using Azure.Monitor.OpenTelemetry.Exporter;
using Azure.Monitor.OpenTelemetry.Exporter.Internals.Platform;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Logging;
Expand Down Expand Up @@ -221,6 +222,25 @@ public static OpenTelemetryBuilder UseAzureMonitor(this OpenTelemetryBuilder bui
return new Manager(options, new DefaultPlatform());
});

builder.Services.AddOptions<AzureMonitorOptions>()
.Configure<IConfiguration>((options, config) =>
{
// This is a temporary workaround for hotfix GHSA-vh2m-22xx-q94f.
// https://github.com/open-telemetry/opentelemetry-dotnet/security/advisories/GHSA-vh2m-22xx-q94f
// We are disabling the workaround set by OpenTelemetry.Instrumentation.AspNetCore v1.8.1 and OpenTelemetry.Instrumentation.Http v1.8.1.
// The OpenTelemetry Community is deciding on an official stance on this issue and we will align with that final decision.
// TODO: FOLLOW UP ON: https://github.com/open-telemetry/semantic-conventions/pull/961 (2024-04-26)
if (config[EnvironmentVariableConstants.ASPNETCORE_DISABLE_URL_QUERY_REDACTION] == null)
{
config[EnvironmentVariableConstants.ASPNETCORE_DISABLE_URL_QUERY_REDACTION] = Boolean.TrueString;
}

if (config[EnvironmentVariableConstants.HTTPCLIENT_DISABLE_URL_QUERY_REDACTION] == null)
{
config[EnvironmentVariableConstants.HTTPCLIENT_DISABLE_URL_QUERY_REDACTION] = Boolean.TrueString;
}
});

return builder;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,23 @@ internal static class EnvironmentVariableConstants
/// When set to true, exporter will emit resources as metric telemetry.
/// </summary>
public const string EXPORT_RESOURCE_METRIC = "OTEL_DOTNET_AZURE_MONITOR_ENABLE_RESOURCE_METRICS";

/// <summary>
/// By default, OpenTelemetry.Instrumenation.AspNetCore v1.8.1 will redact query strings values from URLs.
/// This environment variable can be set to true to disable this behavior.
/// </summary>
/// <remarks>
/// <see href="https://github.com/open-telemetry/opentelemetry-dotnet/blob/main/src/OpenTelemetry.Instrumentation.AspNetCore/CHANGELOG.md#181"/>.
/// </remarks>
public const string ASPNETCORE_DISABLE_URL_QUERY_REDACTION = "OTEL_DOTNET_EXPERIMENTAL_ASPNETCORE_DISABLE_URL_QUERY_REDACTION";

/// <summary>
/// By default, OpenTelemetry.Instrumenation.Http v1.8.1 will redact query string values from URLs.
/// This environment variable can be set to true to disable this behavior.
/// </summary>
/// <remarks>
/// <see href="https://github.com/open-telemetry/opentelemetry-dotnet/blob/main/src/OpenTelemetry.Instrumentation.Http/CHANGELOG.md#181"/>.
/// </remarks>
public const string HTTPCLIENT_DISABLE_URL_QUERY_REDACTION = "OTEL_DOTNET_EXPERIMENTAL_HTTPCLIENT_DISABLE_URL_QUERY_REDACTION";
}
}