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

Support for .NET 8 #2996

Merged
merged 39 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
f1d55cc
.NET8 support
Kielek Oct 5, 2023
a5ea566
fixes
Kielek Oct 5, 2023
ed3c78a
CI
Kielek Oct 5, 2023
837f337
global Json
Kielek Oct 5, 2023
4fdf849
add .NET8 to testing frameworks
Kielek Oct 5, 2023
8f7e0c1
Additional store for .NET8
Kielek Oct 5, 2023
dedd7e6
Fix additional store
Kielek Oct 9, 2023
2949616
Fix logs instrumentation on .NET8
Kielek Oct 10, 2023
998a59f
CentOS build-container test fix
Kielek Oct 10, 2023
8579d58
Add wokaround for breaking change in DuckTyping
Kielek Oct 10, 2023
94c09f0
Merge branch 'main' into net8
Kielek Oct 13, 2023
4d6b7bb
Bump .NET 8 to rc.2
Kielek Oct 13, 2023
2942b82
Cento Workflow
Kielek Oct 13, 2023
e945df1
RuntimeIdentifiers mapping
Kielek Oct 13, 2023
869a65d
SelfContainted application - fix compilation
Kielek Oct 16, 2023
4e2467d
Merge branch 'main' into net8
Kielek Oct 16, 2023
88c1b73
PR feedback - change reference condition
Kielek Oct 16, 2023
2aed10f
handle Centos tests
Kielek Oct 16, 2023
83ae8cb
Merge branch 'main' into net8
Kielek Oct 17, 2023
2e39f28
fix fotnet format
Kielek Oct 17, 2023
bbd8a50
Changelog and docs
Kielek Oct 17, 2023
c0bc26e
Merge branch 'main' into net8
Kielek Oct 18, 2023
d2d0049
drop wrongly commited file
Kielek Oct 18, 2023
026512f
Merge branch 'main' into net8
Kielek Oct 18, 2023
a5d3d82
Merge branch 'main' into net8
Kielek Oct 25, 2023
bff68e5
Add .NET8 to TestApplication.Worker
Kielek Oct 25, 2023
f9099ae
Fix minimal test api on .net8 on linux
Kielek Oct 26, 2023
d44d135
Merge branch 'main' into net8
Kielek Oct 27, 2023
e36b959
Merge branch 'main' into net8
Kielek Nov 6, 2023
c958ff6
Merge branch 'main' into net8
Kielek Nov 15, 2023
c9cb513
remove global.json
Kielek Nov 15, 2023
e63278d
Update .NET SDK to 8.0.100/7.0.404/6.0.417
Kielek Nov 15, 2023
2ba83ab
Remove workaround for .NET8 rc version
Kielek Nov 15, 2023
da0e3c3
remove centos workaround related to global.json
Kielek Nov 15, 2023
ec84e4f
Typo fix
Kielek Nov 15, 2023
12b9c09
Add .NET8 installation
Kielek Nov 15, 2023
a8162be
Merge branch 'main' into net8
Kielek Nov 15, 2023
0bb04f9
Move changelog entry to unreleased section
Kielek Nov 15, 2023
e49b06d
Merge branch 'main' into net8
Kielek Nov 15, 2023
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
33 changes: 33 additions & 0 deletions .github/workflows/build-centos-native-container.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build on Centos Native Container

on:
workflow_call:

env:
NUGET_PACKAGES: ${{ github.workspace }}/packages
DOTNET_CLI_TELEMETRY_OPTOUT: 1

jobs:
build-centos-native-container:
strategy:
fail-fast: false
runs-on: ubuntu-20.04
timeout-minutes: 60
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0 # fetching all, needed to correctly calculate version
- name: Build native library in Docker container
run: |
set -e
docker build -t mybuildimage -f "./docker/centos.dockerfile" ./docker
docker run -e OS_TYPE=linux-glibc --rm --mount type=bind,source="${GITHUB_WORKSPACE}",target=/project mybuildimage \
/bin/sh -c 'git config --global --add safe.directory /project && ./build.sh BuildNativeWorkflow'

- name: Publish native library Linux build
uses: actions/[email protected]
with:
name: bin-centos-native
path: bin/tracer-home
if: (${{ job.status }} != 'cancelled')
continue-on-error: true
6 changes: 2 additions & 4 deletions .github/workflows/build-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ jobs:
include:
- base-image: alpine
os-type: linux-musl
- base-image: centos
os-type: linux-glibc
runs-on: ubuntu-20.04
timeout-minutes: 60
steps:
Expand All @@ -35,10 +33,10 @@ jobs:
docker build -t mybuildimage -f "./docker/${{ matrix.base-image }}.dockerfile" ./docker
docker run --mount type=bind,source="${GITHUB_WORKSPACE}",target=/project --rm mybuildimage /bin/sh -c '
set -e
dotnet publish -f net7.0 -c Release ./test/test-applications/integrations/TestApplication.Smoke
dotnet publish -f net8.0 -c Release ./test/test-applications/integrations/TestApplication.Smoke
export OTEL_DOTNET_AUTO_HOME="${PWD}/bin/tracer-home"
. ./instrument.sh
./test/test-applications/integrations/bin/TestApplication.Smoke/Release/net7.0/publish/TestApplication.Smoke
./test/test-applications/integrations/bin/TestApplication.Smoke/Release/net8.0/publish/TestApplication.Smoke
test "$(ls -A /var/log/opentelemetry/dotnet )"
'
- name: Publish Linux build
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/build-nuget-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ jobs:
- uses: actions/[email protected]
with:
dotnet-version: |
6.0.416
7.0.403
6.0.417
7.0.404
8.0.100

- name: Check for NuGet packages cache
uses: actions/[email protected]
Expand All @@ -45,11 +46,11 @@ jobs:
name: bin-windows-2022
path: bin/ci-artifacts/bin-windows-2022

- name: Download CentOS Artifacts from build job
- name: Download Ubuntu Artifacts from build job
uses: actions/[email protected]
with:
name: bin-centos
path: bin/ci-artifacts/bin-centos
name: bin-ubuntu-20.04
path: bin/ci-artifacts/bin-ubuntu-20.04

- name: Download Alpine Artifacts from build job
uses: actions/[email protected]
Expand Down
24 changes: 18 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ jobs:
- uses: actions/[email protected]
with:
dotnet-version: |
6.0.416
7.0.403
6.0.417
7.0.404
8.0.100
- name: Check for NuGet packages cache
uses: actions/[email protected]
id: nuget-cache
Expand All @@ -48,6 +49,17 @@ jobs:

- run: ./build.cmd BuildWorkflow --no-restore ${{ steps.nuget-cache.outputs.cache-hit != 'true' }}

- name: Download native CentOS Artifacts from build job
if: ${{ matrix.machine == 'ubuntu-20.04' }}
uses: actions/[email protected]
with:
name: bin-centos-native
path: bin/ci-artifacts/bin-centos-native
- name: Replace Ubuntu native code by Centos artifacts
run: |
rm ./bin/tracer-home/linux-x64/OpenTelemetry.AutoInstrumentation.Native.so
cp ./bin/ci-artifacts/bin-centos-native/linux-x64/OpenTelemetry.AutoInstrumentation.Native.so ./bin/tracer-home/linux-x64/OpenTelemetry.AutoInstrumentation.Native.so
if: ${{ matrix.machine == 'ubuntu-20.04' }}
- run: brew install coreutils
if: ${{ runner.os == 'macOS' }}
- name: Create test directory
Expand All @@ -57,10 +69,10 @@ jobs:
shell: bash
run: |
set -e
dotnet publish -f net7.0 -c Release ./test/test-applications/integrations/TestApplication.Smoke
dotnet publish -f net8.0 -c Release ./test/test-applications/integrations/TestApplication.Smoke
export OTEL_DOTNET_AUTO_HOME="${PWD}/bin/tracer-home"
. ./instrument.sh
./test/test-applications/integrations/bin/TestApplication.Smoke/Release/net7.0/publish/TestApplication.Smoke
./test/test-applications/integrations/bin/TestApplication.Smoke/Release/net8.0/publish/TestApplication.Smoke
test "$(ls -A '${{ matrix.log-dir }}' )"
- name: Test the PowerShell module instructions from README.md
if: ${{ runner.os == 'Windows' }}
Expand All @@ -70,12 +82,12 @@ jobs:
Import-Module "${PWD}/bin/installation-scripts/OpenTelemetry.DotNet.Auto.psm1"
[System.Environment]::SetEnvironmentVariable("OTEL_DOTNET_AUTO_INSTALL_DIR", "${PWD}/bin/tracer-home", [System.EnvironmentVariableTarget]::Machine)
Register-OpenTelemetryForCurrentSession -OTelServiceName "MyServiceDisplayName"
./test/test-applications/integrations/bin/TestApplication.Smoke/Release/net7.0/TestApplication.Smoke.exe
./test/test-applications/integrations/bin/TestApplication.Smoke/Release/net8.0/TestApplication.Smoke.exe
if (-not $?) { throw "dotnet help returned exit code: $LASTEXITCODE" }
if (-not (Test-Path $log_path)) { throw "Log file does not exist. Instrumentation test failed." }
Remove-Item $log_path
Unregister-OpenTelemetryForCurrentSession
./test/test-applications/integrations/bin/TestApplication.Smoke/Release/net7.0/TestApplication.Smoke.exe
./test/test-applications/integrations/bin/TestApplication.Smoke/Release/net8.0/TestApplication.Smoke.exe
if (-not $?) { throw "dotnet help returned exit code: $LASTEXITCODE" }
if (Test-Path $log_path) { throw "Log file exists. Instrumentation unregister failed." }
- name: Upload binaries
Expand Down
38 changes: 23 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,16 @@ env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1

jobs:
build:
uses: ./.github/workflows/build.yml

build-container:
uses: ./.github/workflows/build-container.yml

build-centos-native:
uses: ./.github/workflows/build-centos-native-container.yml

build:
needs: build-centos-native
uses: ./.github/workflows/build.yml

build-nuget-packages:
needs: [ build, build-container ]
uses: ./.github/workflows/build-nuget-packages.yml
Expand All @@ -27,7 +31,7 @@ jobs:
strategy:
fail-fast: false
matrix:
test-tfm: [ net7.0, net6.0, net462 ]
test-tfm: [ net8.0, net7.0, net6.0, net462 ]
machine: [ windows-2022, ubuntu-20.04, macos-11 ]
exclude:
- test-tfm: net462
Expand All @@ -49,8 +53,9 @@ jobs:
- uses: actions/[email protected]
with:
dotnet-version: |
6.0.416
7.0.403
6.0.417
7.0.404
8.0.100
- name: Check for NuGet packages cache
uses: actions/[email protected]
id: nuget-cache
Expand Down Expand Up @@ -94,8 +99,9 @@ jobs:
- uses: actions/[email protected]
with:
dotnet-version: |
6.0.416
7.0.403
6.0.417
7.0.404
8.0.100
- name: Check for NuGet packages cache
uses: actions/[email protected]
id: nuget-cache
Expand Down Expand Up @@ -125,8 +131,9 @@ jobs:
- uses: actions/[email protected]
with:
dotnet-version: |
6.0.416
7.0.403
6.0.417
7.0.404
8.0.100
- name: Check for NuGet packages cache
uses: actions/[email protected]
id: nuget-cache
Expand All @@ -150,7 +157,7 @@ jobs:
path: test-artifacts/

test-build-container:
needs: build-container
needs: [build, build-container]
strategy:
fail-fast: false
matrix:
Expand All @@ -159,10 +166,10 @@ jobs:
build-source: alpine
os-type: linux-musl
- base-image: centos
build-source: centos
build-source: ubuntu-20.04
os-type: linux-glibc
- base-image: debian
build-source: centos
build-source: ubuntu-20.04
os-type: linux-glibc
runs-on: ubuntu-20.04
timeout-minutes: 60
Expand Down Expand Up @@ -199,8 +206,9 @@ jobs:
- uses: actions/[email protected]
with:
dotnet-version: |
6.0.416
7.0.403
6.0.417
7.0.404
8.0.100
- name: Check for NuGet packages cache
uses: actions/[email protected]
id: nuget-cache
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dotnet-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ jobs:
- name: check out code
uses: actions/[email protected]

- name: Setup .NET 7.0
- name: Setup .NET 8
uses: actions/[email protected]
with:
dotnet-version: 7.0.403
dotnet-version: 8.0.100

- name: dotnet format
run: dotnet format .\OpenTelemetry.AutoInstrumentation.sln --no-restore --verify-no-changes
24 changes: 13 additions & 11 deletions .github/workflows/release-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@ jobs:
- uses: actions/[email protected]
with:
dotnet-version: |
6.0.416
7.0.403
6.0.417
7.0.404
Kielek marked this conversation as resolved.
Show resolved Hide resolved
8.0.100
- name: Test the PowerShell module instructions from README.md
shell: powershell
run: |
mkdir testapp
cd testapp
dotnet new console
dotnet publish -f net7.0 -c Release
dotnet publish -f net8.0 -c Release
$module_url = "https://github.com/${{ github.repository }}/releases/download/${{ github.event.release.tag_name }}/OpenTelemetry.DotNet.Auto.psm1"
$dl_path = Join-Path $env:temp "OpenTelemetry.DotNet.Auto.psm1"
$log_path = "C:\ProgramData\OpenTelemetry .NET AutoInstrumentation\logs\*"
Expand All @@ -28,12 +29,12 @@ jobs:
Install-OpenTelemetryCore
$install_dir = Get-OpenTelemetryInstallDirectory
Register-OpenTelemetryForCurrentSession -OTelServiceName "MyServiceDisplayName"
./bin/Release/net7.0/publish/testapp
./bin/Release/net8.0/publish/testapp
if (-not $?) { throw "dotnet help returned exit code: $LASTEXITCODE" }
if (-not (Test-Path $log_path)) { throw "Log file does not exist. Instrumentation test failed." }
Remove-Item $log_path
Unregister-OpenTelemetryForCurrentSession
./bin/Release/net7.0/publish/testapp
./bin/Release/net8.0/publish/testapp
if (-not $?) { throw "dotnet help returned exit code: $LASTEXITCODE" }
if (Test-Path $log_path) { throw "Log file exists. Instrumentation unregister failed." }
Uninstall-OpenTelemetryCore
Expand All @@ -55,8 +56,9 @@ jobs:
- uses: actions/[email protected]
with:
dotnet-version: |
6.0.416
7.0.403
6.0.417
7.0.404
8.0.100
- run: brew install coreutils
if: ${{ runner.os == 'macOS' }}
- name: Create test directory
Expand All @@ -69,13 +71,13 @@ jobs:
mkdir testapp
cd testapp
dotnet new console
dotnet publish -f net7.0 -c Release
dotnet publish -f net8.0 -c Release
curl -sSfL https://github.com/${{ github.repository }}/releases/download/${{ github.event.release.tag_name }}/otel-dotnet-auto-install.sh -O
sh ./otel-dotnet-auto-install.sh
test "$(ls -A "$HOME/.otel-dotnet-auto")"
curl -sSfL https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/instrument.sh -O
. ./instrument.sh
./bin/Release/net7.0/publish/testapp
./bin/Release/net8.0/publish/testapp
test "$(ls -A '${{ matrix.log-dir }}' )"

shell-scripts-container:
Expand All @@ -95,12 +97,12 @@ jobs:
mkdir testapp
cd testapp
dotnet new console
dotnet publish -f net7.0 -c Release
dotnet publish -f net8.0 -c Release
curl -sSfL https://github.com/${{ github.repository }}/releases/download/${{ github.event.release.tag_name }}/otel-dotnet-auto-install.sh -O
sh ./otel-dotnet-auto-install.sh
test "$(ls -A "$HOME/.otel-dotnet-auto")"
curl -sSfL https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/instrument.sh -O
. ./instrument.sh
./bin/Release/net7.0/publish/testapp
./bin/Release/net8.0/publish/testapp
test "$(ls -A /var/log/opentelemetry/dotnet )"
'
10 changes: 7 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@ env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1

jobs:
build:
uses: ./.github/workflows/build.yml

build-container:
uses: ./.github/workflows/build-container.yml

build-centos-native:
uses: ./.github/workflows/build-centos-native-container.yml

build:
needs: build-centos-native
uses: ./.github/workflows/build.yml

build-nuget-packages:
needs: [ build, build-container ]
uses: ./.github/workflows/build-nuget-packages.yml
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/verify-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ jobs:
- uses: actions/[email protected]
with:
dotnet-version: |
6.0.416
7.0.403
6.0.417
7.0.404
8.0.100
- run: ./build.cmd BuildTracer ManagedTests --containers ${{ matrix.containers }} --test-project "${{ github.event.inputs.testProject }}" --test-name '"${{ github.event.inputs.testName }}"' --test-count ${{ github.event.inputs.count }}
- name: Upload logs
uses: actions/[email protected]
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ This component adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.h

### Added

- Add support for .NET 8.
- Added support for [System.Data.SqlClient](https://www.nuget.org/packages/System.Data.SqlClient/)
(NuGet package) traces instrumentation from `4.8.5`.
- Ability to update installation via PS module (`OpenTelemetry.DotNet.Auto.psm1`).
Expand Down
Loading
Loading