Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/Component.BuildTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ on:
required: false
type: string
tfm-list:
default: '[ "net462", "net8.0", "net9.0" ]'
default: '[ "net462", "net8.0", "net9.0", "net10.0" ]'
required: false
type: string
test-case-filter:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails
matrix:
os: [ windows-latest, ubuntu-22.04 ]
version: [ net462, net8.0 ]
version: [ net462, net8.0, net10.0 ]
exclude:
- os: ubuntu-22.04
version: net462
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ jobs:
with:
project-name: OpenTelemetry.Instrumentation.AspNetCore
code-cov-name: Instrumentation.AspNetCore
tfm-list: '[ "net8.0", "net9.0" ]'
tfm-list: '[ "net8.0", "net9.0", "net10.0" ]'

build-test-instrumentation-aws:
needs: detect-changes
Expand All @@ -239,7 +239,7 @@ jobs:
with:
project-name: OpenTelemetry.Instrumentation.AWS
code-cov-name: Instrumentation.AWS
tfm-list: '[ "net472", "net8.0", "net9.0" ]'
tfm-list: '[ "net472", "net8.0", "net9.0", "net10.0" ]'

build-test-instrumentation-cassandra:
needs: detect-changes
Expand Down Expand Up @@ -315,7 +315,7 @@ jobs:
with:
project-name: OpenTelemetry.Instrumentation.EventCounters
code-cov-name: Instrumentation.EventCounters
tfm-list: '[ "net8.0", "net9.0" ]'
tfm-list: '[ "net8.0", "net9.0", "net10.0" ]'

build-test-instrumentation-grpccore:
needs: detect-changes
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
fail-fast: false
matrix:
version: [net8.0]
version: [net8.0, net10.0]
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

Expand All @@ -30,7 +30,7 @@ jobs:
strategy:
fail-fast: false
matrix:
version: [net8.0]
version: [net8.0, net10.0]
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/verifyaotcompat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails
matrix:
os: [ ubuntu-22.04, windows-latest ]
version: [ net8.0, net9.0 ]
version: [ net8.0, net9.0, net10.0 ]

runs-on: ${{ matrix.os }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion build/Common.nonprod.props
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<MicrosoftNETTestSdkPkgVer>[17.14.1,18.0)</MicrosoftNETTestSdkPkgVer>
<OpenTelemetryExporterInMemoryPkgVer>$(OpenTelemetryCoreLatestVersion)</OpenTelemetryExporterInMemoryPkgVer>
<!-- OmniSharp/VS Code requires TargetFrameworks to be in descending order for IntelliSense and analysis. -->
<SupportedNetTargets>net9.0;net8.0</SupportedNetTargets>
<SupportedNetTargets>net10.0;net9.0;net8.0</SupportedNetTargets>
<XUnitRunnerVisualStudioPkgVer>[2.8.2,3.0)</XUnitRunnerVisualStudioPkgVer>
<XUnitPkgVer>[2.9.3,3.0)</XUnitPkgVer>
<WiremockNetPkgVer>[1.7.0,2.0)</WiremockNetPkgVer>
Expand Down
4 changes: 0 additions & 4 deletions build/Common.targets
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
<PackageReference Include="System.Text.Json"
Version="$(SystemTextJsonMinimumRequiredPkgVer)"
Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'" />

<PackageReference Include="System.Text.Json"
Version="$(SystemTextJsonLatestNet8OutOfBandPkgVer)"
Condition="'$(TargetFramework)' == 'net8.0'" />
</ItemGroup>

</Project>
9 changes: 9 additions & 0 deletions build/docker-compose.net10.0.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: '3.7'

services:
tests:
build:
args:
PUBLISH_FRAMEWORK: net10.0
TEST_SDK_VERSION: "10.0"
BUILD_SDK_VERSION: "10.0"
2 changes: 1 addition & 1 deletion build/docker-compose.net8.0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ services:
args:
PUBLISH_FRAMEWORK: net8.0
TEST_SDK_VERSION: "8.0"
BUILD_SDK_VERSION: "9.0"
BUILD_SDK_VERSION: "10.0"
2 changes: 1 addition & 1 deletion build/docker-compose.net9.0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ services:
args:
PUBLISH_FRAMEWORK: net9.0
TEST_SDK_VERSION: "9.0"
BUILD_SDK_VERSION: "9.0"
BUILD_SDK_VERSION: "10.0"
4 changes: 2 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"sdk": {
"rollForward": "latestFeature",
"rollForward": "latestMajor",
"allowPrerelease": false,
"version": "9.0.305"
"version": "10.0.100-rc.1.25451.107"
}
}
1 change: 1 addition & 0 deletions opentelemetry-dotnet-contrib.sln
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{824BD1DE
build\debug.snk = build\debug.snk
build\docker-compose.net8.0.yml = build\docker-compose.net8.0.yml
build\docker-compose.net9.0.yml = build\docker-compose.net9.0.yml
build\docker-compose.net10.0.yml = build\docker-compose.net10.0.yml
build\opentelemetry-icon-color.png = build\opentelemetry-icon-color.png
build\OpenTelemetryContrib.prod.ruleset = build\OpenTelemetryContrib.prod.ruleset
build\OpenTelemetryContrib.test.ruleset = build\OpenTelemetryContrib.test.ruleset
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ internal sealed class HttpHandlerDiagnosticListener : ListenerHandler
internal static readonly AssemblyName AssemblyName = typeof(HttpHandlerDiagnosticListener).Assembly.GetName();
internal static readonly bool IsNet7OrGreater = Environment.Version.Major >= 7;
internal static readonly bool IsNet9OrGreater = Environment.Version.Major >= 9;
internal static readonly bool IsNet10OrGreater = Environment.Version.Major >= 10;

// https://github.com/dotnet/runtime/blob/7d034ddbbbe1f2f40c264b323b3ed3d6b3d45e9a/src/libraries/System.Net.Http/src/System/Net/Http/DiagnosticsHandler.cs#L19
internal static readonly string ActivitySourceName = AssemblyName.Name + ".HttpClient";
Expand Down Expand Up @@ -178,7 +179,8 @@ public void OnStopActivity(Activity activity, object? payload)
var requestTaskStatus = GetRequestStatus(payload);

var currentStatusCode = activity.Status;
if (requestTaskStatus != TaskStatus.RanToCompletion)

if (!IsNet10OrGreater && requestTaskStatus != TaskStatus.RanToCompletion)
{
if (requestTaskStatus == TaskStatus.Canceled)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@
<Compile Include="$(RepoRoot)\src\Shared\PropertyFetcher.cs" Link="Includes\PropertyFetcher.cs" />
</ItemGroup>

<ItemGroup>
<!-- System.Private.Uri is indirect reference. It is needed to upgrade it directly to avoid https://github.com/advisories/GHSA-5f2m-466j-3848 -->
<PackageReference Include="System.Private.Uri" Version="4.3.2" />
</ItemGroup>

<ItemGroup>
<!--
When adding projects here please also update the verify-aot-compat job in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1212,7 +1212,6 @@ void ConfigureTestServices(IServiceCollection services)
Assert.Empty(hubActivity);
}

// note: this is always passing on Net9 or lower, because AddAspNetCoreInstrumentation only adds the subscription in Net10 or higher.
[Fact]
public async Task RazorComponentsActivitiesCanBeDisabled()
{
Expand Down Expand Up @@ -1260,6 +1259,57 @@ void ConfigureTestServices(IServiceCollection services)

Assert.Empty(blazorActivity);
}

#if NET10_0_OR_GREATER
[Fact]
public async Task RazorComponentsActivitiesAreEnabledByDefault()
{
var exportedItems = new List<Activity>();
void ConfigureTestServices(IServiceCollection services)
{
this.tracerProvider = Sdk.CreateTracerProviderBuilder()
.AddAspNetCoreInstrumentation()
.AddInMemoryExporter(exportedItems)
.Build();
}

using (var client = this.factory
.WithWebHostBuilder(builder =>
{
builder.ConfigureTestServices(ConfigureTestServices);
builder.ConfigureLogging(loggingBuilder => loggingBuilder.ClearProviders());
})
.CreateClient())
{
var fakeActivitySource = new ActivitySource("Microsoft.AspNetCore.Components");
var activity = fakeActivitySource.CreateActivity("Microsoft.AspNetCore.Components.HandleEvent", ActivityKind.Internal, parentId: null, null, null);
if (activity != null)
{
activity.Start();
activity.SetTag("aspnetcore.components.type", "BasicTests");
activity.SetTag("aspnetcore.components.method", "BlazorActivitiesCanBeDisabled");
activity.Stop();
}

try
{
using var response = await client.GetAsync(new Uri("/api/values", UriKind.Relative));
}
catch (Exception)
{
// ignore errors
}

WaitForActivityExport(exportedItems, 1);
}

var blazorActivity = exportedItems
.Where(a => a.DisplayName.StartsWith("Microsoft.AspNetCore.Components", StringComparison.InvariantCulture));

Assert.NotEmpty(blazorActivity);
}
#endif

#endif

public void Dispose()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.0"/>
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net10.0'" >
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="10.0.0-rc.1.25451.107" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="10.0.0-rc.1.25451.107"/>
</ItemGroup>

<ItemGroup>
<PackageReference Include="OpenTelemetry.Exporter.InMemory" Version="$(OpenTelemetryCoreLatestVersion)" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="$(OpenTelemetryCoreLatestVersion)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ instrumentation changes, the README files will be updated to reflect the change.

* [.NET 8](./README.net8.0.md)
* [.NET 9](./README.net9.0.md)
* [.NET 10](./README.net10.0.md)

For each test case a request is made to an ASP.NET Core application with a
particular routing configuration. ASP.NET Core offers a
Expand Down
Loading
Loading