diff --git a/.github/workflows/add-labels.yml b/.github/workflows/add-labels.yml index 3566af9ec83..cae26b876b4 100644 --- a/.github/workflows/add-labels.yml +++ b/.github/workflows/add-labels.yml @@ -1,25 +1,55 @@ -name: 'Add labels for area found in bug issue descriptions' +name: 'Add labels to issues and pull requests' on: issues: - types: [opened] + types: [ opened ] + + pull_request_target: + branches: [ 'main*' ] permissions: issues: write + pull-requests: write jobs: - add-labels: - if: ${{ !github.event.issue.pull_request }} + add-labels-on-issues: + if: github.event_name == 'issues' && !github.event.issue.pull_request runs-on: ubuntu-latest + steps: - name: check out code uses: actions/checkout@v4 - - name: Add labels for areas found in bug issue descriptions + - name: Add labels for package found in bug issue descriptions shell: pwsh run: | - .\build\scripts\add-labels.ps1 -issueNumber $env:ISSUE_NUMBER -issueBody $env:ISSUE_BODY + Import-Module .\build\scripts\add-labels.psm1 + + AddLabelsOnIssuesForPackageFoundInBody ` + -issueNumber ${{ github.event.issue.number }} ` + -issueBody $env:ISSUE_BODY env: GH_TOKEN: ${{ github.token }} - ISSUE_NUMBER: ${{ github.event.issue.number }} ISSUE_BODY: ${{ github.event.issue.body }} + + add-labels-on-pull-requests: + if: github.event_name == 'pull_request_target' + + runs-on: ubuntu-latest + + steps: + - name: check out code + uses: actions/checkout@v4 + with: + ref: ${{ github.event.repository.default_branch }} # Note: Do not run on the PR branch we want to execute add-labels.psm1 from main on the base repo only because pull_request_target can see secrets + + - name: Add labels for files changed on pull requests + shell: pwsh + run: | + Import-Module .\build\scripts\add-labels.psm1 + + AddLabelsOnPullRequestsBasedOnFilesChanged ` + -pullRequestNumber ${{ github.event.pull_request.number }} ` + -labelPackagePrefix 'pkg:' + env: + GH_TOKEN: ${{ github.token }} diff --git a/.github/workflows/automation.yml b/.github/workflows/automation.yml index e85a3720aba..1385474892a 100644 --- a/.github/workflows/automation.yml +++ b/.github/workflows/automation.yml @@ -13,7 +13,7 @@ on: value: ${{ vars.AUTOMATION_EMAIL }} secrets: OPENTELEMETRYBOT_GITHUB_TOKEN: - required: true + required: false jobs: resolve-automation: diff --git a/.github/workflows/post-release.yml b/.github/workflows/post-release.yml index 6f26e1058a3..249fd360da9 100644 --- a/.github/workflows/post-release.yml +++ b/.github/workflows/post-release.yml @@ -7,21 +7,69 @@ on: required: true description: 'Release tag' type: string + release: - types: [published] + types: + - published + + issue_comment: + types: + - created jobs: automation: uses: ./.github/workflows/automation.yml secrets: inherit - post-release: + push-packages-and-publish-release: + runs-on: ubuntu-latest + + needs: automation + + if: | + github.event_name == 'issue_comment' + && github.event.issue.pull_request + && github.event.issue.locked == true + && github.event.comment.user.login != needs.automation.outputs.username + && contains(github.event.comment.body, '/PushPackages') + && startsWith(github.event.issue.title, '[release] Prepare release ') + && github.event.issue.pull_request.merged_at + && needs.automation.outputs.enabled + + env: + GH_TOKEN: ${{ secrets[needs.automation.outputs.token-secret-name] }} + + steps: + - name: check out code + uses: actions/checkout@v4 + with: + token: ${{ secrets[needs.automation.outputs.token-secret-name] }} + ref: ${{ github.event.repository.default_branch }} + + - name: Push packages and publish release + shell: pwsh + env: + NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }} + run: | + Import-Module .\build\scripts\post-release.psm1 + + PushPackagesPublishReleaseUnlockAndPostNoticeOnPrepareReleasePullRequest ` + -gitRepository '${{ github.repository }}' ` + -pullRequestNumber '${{ github.event.issue.number }}' ` + -botUserName '${{ needs.automation.outputs.username }}' ` + -commentUserName '${{ github.event.comment.user.login }}' ` + -artifactDownloadPath '${{ github.workspace }}/artifacts' ` + -pushToNuget '${{ secrets.NUGET_TOKEN != '' }}' + + post-release-published: runs-on: ubuntu-latest needs: - automation - if: needs.automation.outputs.enabled + if: | + needs.automation.outputs.enabled + && (github.event_name == 'release' || github.event_name == 'workflow_dispatch') env: GH_TOKEN: ${{ secrets[needs.automation.outputs.token-secret-name] }} @@ -35,6 +83,9 @@ jobs: ref: ${{ github.event.repository.default_branch }} token: ${{ secrets[needs.automation.outputs.token-secret-name] }} + - name: Setup dotnet + uses: actions/setup-dotnet@v4 + - name: Create GitHub Pull Request to update stable build version in props if: | (github.ref_type == 'tag' && startsWith(github.ref_name, 'core-') && !contains(github.ref_name, '-alpha') && !contains(github.ref_name, '-beta') && !contains(github.ref_name, '-rc')) diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml index 087081efbb1..bd8211e645e 100644 --- a/.github/workflows/prepare-release.yml +++ b/.github/workflows/prepare-release.yml @@ -67,7 +67,7 @@ jobs: && github.event.action == 'closed' && github.event.pull_request.user.login == needs.automation.outputs.username && github.event.pull_request.merged == true - && startsWith(github.event.pull_request.title, '[repo] Prepare release ') + && startsWith(github.event.pull_request.title, '[release] Prepare release ') && needs.automation.outputs.enabled env: @@ -89,7 +89,7 @@ jobs: -pullRequestNumber '${{ github.event.pull_request.number }}' ` -botUserName '${{ needs.automation.outputs.username }}' - create-release-tag-unlock-pr-post-notice: + create-release-tag-pr-post-notice: runs-on: ubuntu-latest needs: automation @@ -100,7 +100,7 @@ jobs: && github.event.issue.locked == true && github.event.comment.user.login != needs.automation.outputs.username && contains(github.event.comment.body, '/CreateReleaseTag') - && startsWith(github.event.issue.title, '[repo] Prepare release ') + && startsWith(github.event.issue.title, '[release] Prepare release ') && github.event.issue.pull_request.merged_at && needs.automation.outputs.enabled @@ -127,3 +127,4 @@ jobs: -botUserName '${{ needs.automation.outputs.username }}' ` -gitUserName '${{ needs.automation.outputs.username }}' ` -gitUserEmail '${{ needs.automation.outputs.email }}' + diff --git a/.github/workflows/publish-packages-1.0.yml b/.github/workflows/publish-packages-1.0.yml index 553b8bbfc62..7553bd66627 100644 --- a/.github/workflows/publish-packages-1.0.yml +++ b/.github/workflows/publish-packages-1.0.yml @@ -53,7 +53,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: ${{ github.ref_name }}-packages - path: '**/bin/**/*.*nupkg' + path: 'src/**/*.*nupkg' - name: Publish MyGet env: @@ -61,7 +61,7 @@ jobs: if: env.MYGET_TOKEN_EXISTS == 'true' # Skip MyGet publish if run on a fork without the secret run: | nuget setApiKey ${{ secrets.MYGET_TOKEN }} -Source https://www.myget.org/F/opentelemetry/api/v2/package - nuget push **/bin/**/*.nupkg -Source https://www.myget.org/F/opentelemetry/api/v2/package + nuget push src/**/*.nupkg -Source https://www.myget.org/F/opentelemetry/api/v2/package post-build: runs-on: ubuntu-latest diff --git a/Directory.Packages.props b/Directory.Packages.props index 6469f47b892..d7180a1c1ae 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -1,7 +1,7 @@ true - 1.8.1 + 1.9.0 - + @@ -81,35 +81,29 @@ - + - + - - + + - - - + + + - - - + - - - + - - - + diff --git a/OpenTelemetry.sln b/OpenTelemetry.sln index d7d059b58cb..61963889e01 100644 --- a/OpenTelemetry.sln +++ b/OpenTelemetry.sln @@ -328,7 +328,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "TagWriter", "TagWriter", "{ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{44982E0D-C8C6-42DC-9F8F-714981F27CE6}" ProjectSection(SolutionItems) = preProject - build\scripts\add-labels.ps1 = build\scripts\add-labels.ps1 + build\scripts\add-labels.psm1 = build\scripts\add-labels.psm1 build\scripts\finalize-publicapi.ps1 = build\scripts\finalize-publicapi.ps1 build\scripts\post-release.psm1 = build\scripts\post-release.psm1 build\scripts\prepare-release.psm1 = build\scripts\prepare-release.psm1 diff --git a/build/Common.prod.props b/build/Common.prod.props index 2f7b7cc900f..9f2c78486c3 100644 --- a/build/Common.prod.props +++ b/build/Common.prod.props @@ -3,6 +3,9 @@ $(MSBuildThisFileDirectory)/OpenTelemetry.prod.ruleset + + + true false diff --git a/build/Common.props b/build/Common.props index 7c1c5b5a473..77337cad20a 100644 --- a/build/Common.props +++ b/build/Common.props @@ -15,6 +15,10 @@ + + false + + net462 diff --git a/build/RELEASING.md b/build/RELEASING.md index d25f13b1355..f9075727bd6 100644 --- a/build/RELEASING.md +++ b/build/RELEASING.md @@ -1,6 +1,7 @@ # Release process -**Only for Maintainers.** +**Note: Approvers (collaborators) can perform much of the release process but +Maintainers (admins) are needed to merge PRs and for the push to NuGet.** 1. Decide the component(s) and tag name (version name) to be released. We use [MinVer](https://github.com/adamralph/minver) to do versioning, which @@ -40,15 +41,13 @@ * `OpenTelemetry.Shims.OpenTracing` - Defined by spec (stable but incomplete implementation) - * As of the `1.9.0` release cycle instrumentation packages and core - unstable packages always depend on the stable versions of core - packages. Before releasing a non-core component ensure the - `OTelLatestStableVer` property in `Directory.Packages.props` has been - updated to the latest stable core version. + * As of the `1.9.0` release cycle core unstable packages always depend on + the stable versions of core packages. Before releasing a non-core + component ensure the `OTelLatestStableVer` property in + `Directory.Packages.props` has been updated to the latest stable core + version. - 2. Prepare for release - - Run the [Prepare for a + 2. Run the [Prepare for a release](https://github.com/open-telemetry/opentelemetry-dotnet/actions/workflows/prepare-release.yml) workflow. Specify the `tag-prefix` and the `version` for the release. Make sure to run the workflow on the branch being released. This is typically @@ -91,11 +90,10 @@ comment and lock the PR. Post a comment with "/CreateReleaseTag" in the body. This will tell the [Prepare for a release](https://github.com/open-telemetry/opentelemetry-dotnet/actions/workflows/prepare-release.yml) - workflow to push the tag for the merge commit of the PR and to call the - [Build, pack, and publish to + workflow to push the tag for the merge commit of the PR which will trigger + the [Build, pack, and publish to MyGet](https://github.com/open-telemetry/opentelemetry-dotnet/actions/workflows/publish-packages-1.0.yml) - workflow. Once packages are available a comment will be posted on the PR - opened in step 2 with a link to the artifacts. + workflow.
Instructions for pushing tags manually @@ -127,51 +125,76 @@ 5. :stop_sign: Wait for the [Build, pack, and publish to MyGet](https://github.com/open-telemetry/opentelemetry-dotnet/actions/workflows/publish-packages-1.0.yml) - workflow to complete. + workflow to complete. When complete a trigger will automatically add a + comment on the PR opened by [Prepare for a + release](https://github.com/open-telemetry/opentelemetry-dotnet/actions/workflows/prepare-release.yml) + workflow in step 2. Use MyGet or download the packages using the provided + link to validate locally everything works. After validation has been + performed have a maintainer post a comment with "/PushPackages" in the body. + This will trigger the [Complete + release](https://github.com/open-telemetry/opentelemetry-dotnet/actions/workflows/prepare-release.yml) + workflow to push the packages to NuGet and publish the draft release created + by the [Build, pack, and publish to + MyGet](https://github.com/open-telemetry/opentelemetry-dotnet/actions/workflows/publish-packages-1.0.yml) + workflow. Comments will automatically be added on the PR opened by [Prepare + for a + release](https://github.com/open-telemetry/opentelemetry-dotnet/actions/workflows/prepare-release.yml) + workflow in step 2 as the process is run and the PR will be unlocked. - 6. Validate locally everything works using the MyGet packages pushed from the - release. Basic sanity checks :) +
+ Instructions for pushing packages to NuGet manually - 7. Download the artifacts from the drop attached to the workflow run. The - artifacts archive (`.zip`) contains all the NuGet packages (`.nupkg`) and - symbols (`.snupkg`) from the build which were pushed to MyGet. + 1. The [Build, pack, and publish to + MyGet](https://github.com/open-telemetry/opentelemetry-dotnet/actions/workflows/publish-packages-1.0.yml) + workflow pushes the packages to MyGet and attaches them as artifacts on + the workflow run. - 8. Extract the artifacts from the archive (`.zip`) into a local folder. + 2. Validate locally everything works using the packages pushed to MyGet or + downloaded from the drop attached to the workflow run. Basic sanity + checks :) - 9. Download latest [nuget.exe](https://www.nuget.org/downloads) into the same - folder from Step 8. + 3. Download the artifacts from the drop attached to the workflow run. The + artifacts archive (`.zip`) contains all the NuGet packages (`.nupkg`) and + symbols (`.snupkg`) from the build which were pushed to MyGet. -10. Create or regenerate an API key from nuget.org (only maintainers have - access). When creating API keys make sure it is set to expire in 1 day or - less. + 4. Extract the artifacts from the archive (`.zip`) into a local folder. -11. Run the following commands from PowerShell from local folder used in Step 8: + 5. Download latest [nuget.exe](https://www.nuget.org/downloads) into the + same folder from step 4. - ```powershell - .\nuget.exe setApiKey + 6. Create or regenerate an API key from nuget.org (only maintainers have + access). When creating API keys make sure it is set to expire in 1 day or + less. - get-childitem -Recurse | where {$_.extension -eq ".nupkg"} | foreach ($_) {.\nuget.exe push $_.fullname -Source https://api.nuget.org/v3/index.json} - ``` + 7. Run the following commands from PowerShell from local folder used in step + 4: -12. Validate that the package(s) are uploaded. Packages are available - immediately to maintainers on nuget.org but aren't publicly visible until - scanning completes. This process usually takes a few minutes. + ```powershell + .\nuget.exe setApiKey -13. Open the - [Releases](https://github.com/open-telemetry/opentelemetry-dotnet/releases) - page on the GitHub repository. The [Build, pack, and publish to - MyGet](https://github.com/open-telemetry/opentelemetry-dotnet/actions/workflows/publish-packages-1.0.yml) - workflow creates a draft release for the tag which was pushed. Edit the - draft Release and click `Publish release`. + get-childitem -Recurse | where {$_.extension -eq ".nupkg"} | foreach ($_) {.\nuget.exe push $_.fullname -Source https://api.nuget.org/v3/index.json} + ``` + + 8. Validate that the package(s) are uploaded. Packages are available + immediately to maintainers on nuget.org but aren't publicly visible until + scanning completes. This process usually takes a few minutes. + + 9. Open the + [Releases](https://github.com/open-telemetry/opentelemetry-dotnet/releases) + page on the GitHub repository. The [Build, pack, and publish to + MyGet](https://github.com/open-telemetry/opentelemetry-dotnet/actions/workflows/publish-packages-1.0.yml) + workflow creates a draft release for the tag which was pushed. Edit the + draft Release and click `Publish release`. +
-14. If a new stable version of the core packages was released, a PR should have + 6. If a new stable version of the core packages was released, a PR should have been automatically created by the [Complete release](https://github.com/open-telemetry/opentelemetry-dotnet/actions/workflows/post-release.yml) workflow to update the `OTelLatestStableVer` property in `Directory.Packages.props` to the just released stable version. Merge that PR once the build passes (this requires the packages be available on NuGet). -15. The [Complete + 7. The [Complete release](https://github.com/open-telemetry/opentelemetry-dotnet/actions/workflows/post-release.yml) workflow should have invoked the [Core version update](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/actions/workflows/core-version-update.yml) @@ -180,6 +203,6 @@ repository which opens a PR to update dependencies. Verify this PR was opened successfully. -16. Post an announcement in the [Slack + 8. Post an announcement in the [Slack channel](https://cloud-native.slack.com/archives/C01N3BC2W7Q). Note any big or interesting new features as part of the announcement. diff --git a/build/scripts/add-labels.ps1 b/build/scripts/add-labels.ps1 deleted file mode 100644 index 9b91ad9df87..00000000000 --- a/build/scripts/add-labels.ps1 +++ /dev/null @@ -1,12 +0,0 @@ -param( - [Parameter(Mandatory=$true)][int]$issueNumber, - [Parameter(Mandatory=$true)][string]$issueBody -) - -$match = [regex]::Match($issueBody, '^[#]+ Package\s*(OpenTelemetry(?:\.\w+)*)') -if ($match.Success -eq $false) -{ - Return -} - -gh issue edit $issueNumber --add-label $("pkg:" + $match.Groups[1].Value) diff --git a/build/scripts/add-labels.psm1 b/build/scripts/add-labels.psm1 new file mode 100644 index 00000000000..60c07bc4637 --- /dev/null +++ b/build/scripts/add-labels.psm1 @@ -0,0 +1,148 @@ +function AddLabelsOnIssuesForPackageFoundInBody { + param( + [Parameter(Mandatory=$true)][int]$issueNumber, + [Parameter(Mandatory=$true)][string]$issueBody + ) + + $match = [regex]::Match($issueBody, '^[#]+ Package\s*(OpenTelemetry(?:\.\w+)*)') + if ($match.Success -eq $false) + { + Return + } + + gh issue edit $issueNumber --add-label $("pkg:" + $match.Groups[1].Value) +} + +Export-ModuleMember -Function AddLabelsOnIssuesForPackageFoundInBody + +function AddLabelsOnPullRequestsBasedOnFilesChanged { + param( + [Parameter(Mandatory=$true)][int]$pullRequestNumber, + [Parameter(Mandatory=$true)][string]$labelPackagePrefix # 'pkg:' on main repo, 'comp:' on contrib repo + ) + + # Note: This function is intended to work on main repo and on contrib. Please + # keep them in sync. + + $repoLabels = gh label list --json name,id -L 200 | ConvertFrom-Json + + $filesChangedOnPullRequest = gh pr diff $pullRequestNumber --name-only + + $labelsOnPullRequest = (gh pr view $pullRequestNumber --json labels | ConvertFrom-Json).labels + + $visitedProjects = New-Object System.Collections.Generic.HashSet[string] + $labelsToAdd = New-Object System.Collections.Generic.HashSet[string] + $labelsToRemove = New-Object System.Collections.Generic.HashSet[string] + + # Note: perf label may be added but it is kind of a guess so we don't remove + # it automatically in order to also allow manual inclusion after reviewing files + $managedLabels = 'infra', 'documentation', 'dependencies' + $rootInfraFiles = 'global.json', 'NuGet.config', 'codeowners' + $documentationFiles = 'readme.md', 'contributing.md', 'releasing.md', 'versioning.md' + + foreach ($fileChanged in $filesChangedOnPullRequest) + { + $fileChanged = $fileChanged.ToLower() + $fullFileName = [System.IO.Path]::GetFileName($fileChanged) + $fileName = [System.IO.Path]::GetFileNameWithoutExtension($fileChanged) + $fileExtension = [System.IO.Path]::GetExtension($fileChanged) + + if ($fileChanged.StartsWith('src/') -or $fileChanged.StartsWith('test/')) + { + $match = [regex]::Match($fileChanged, '^(?:(?:src)|(?:test))\/(.*?)\/.+$') + if ($match.Success -eq $false) + { + continue + } + $rawProjectName = $match.Groups[1].Value + if ($rawProjectName.Contains(".benchmarks") -or $rawProjectName.Contains(".stress")) + { + $added = $labelsToAdd.Add("perf") + } + + $projectName = $rawProjectName.Replace(".tests", "").Replace(".benchmarks", "").Replace(".stress", "") + if ($visitedProjects.Contains($projectName)) + { + continue + } + + $added = $visitedProjects.Add($projectName); + + foreach ($repoLabel in $repoLabels) + { + if ($repoLabel.name.StartsWith($labelPackagePrefix)) + { + $package = $repoLabel.name.Substring($labelPackagePrefix.Length).ToLower() + if ($package.StartsWith('opentelemetry') -eq $false) + { + # Note: On contrib labels don't have "OpenTelemetry." prefix + $package = 'opentelemetry.' + $package + } + if ($package -eq $projectName) + { + $added = $labelsToAdd.Add($repoLabel.name) + break + } + } + } + } + + if ($documentationFiles.Contains($fullFileName) -or + $fileChanged.StartsWith('docs/') -or + $fileChanged.StartsWith('examples/')) + { + $added = $labelsToAdd.Add("documentation") + } + + if ($fileChanged.StartsWith('build/') -or + $fileChanged.StartsWith('.github/') -or + $rootInfraFiles.Contains($fullFileName) -or + $fileExtension -eq ".props" -or + $fileExtension -eq ".targets" -or + $fileChanged.StartsWith('test\openTelemetry.aotcompatibility')) + { + $added = $labelsToAdd.Add("infra") + } + + if ($fileChanged.StartsWith('test\benchmarks')) + { + $added = $labelsToAdd.Add("perf") + } + + if ($fullFileName -eq 'directory.packages.props') + { + $added = $labelsToAdd.Add("dependencies") + } + } + + foreach ($labelOnPullRequest in $labelsOnPullRequest) + { + if ($labelsToAdd.Contains($labelOnPullRequest.name)) + { + $removed = $labelsToAdd.Remove($labelOnPullRequest.name) + } + elseif ($labelOnPullRequest.name.StartsWith($labelPackagePrefix) -or + $managedLabels.Contains($labelOnPullRequest.name)) + { + $added = $labelsToRemove.Add($labelOnPullRequest.name) + } + } + + if ($labelsToAdd.Count -gt 0) + { + foreach ($label in $labelsToAdd) + { + gh pr edit $pullRequestNumber --add-label $label + } + } + + if ($labelsToRemove.Count -gt 0) + { + foreach ($label in $labelsToRemove) + { + gh pr edit $pullRequestNumber --remove-label $label + } + } +} + +Export-ModuleMember -Function AddLabelsOnPullRequestsBasedOnFilesChanged diff --git a/build/scripts/post-release.psm1 b/build/scripts/post-release.psm1 index 51010213cd5..ab7092cf4eb 100644 --- a/build/scripts/post-release.psm1 +++ b/build/scripts/post-release.psm1 @@ -114,7 +114,7 @@ function TryPostPackagesReadyNoticeOnPrepareReleasePullRequest { foreach ($pr in $prListResponse) { - if ($pr.author.login -ne $botUserName -or $pr.title -ne "[repo] Prepare release $tag") + if ($pr.author.login -ne $botUserName -or $pr.title -ne "[release] Prepare release $tag") { continue } @@ -137,6 +137,8 @@ function TryPostPackagesReadyNoticeOnPrepareReleasePullRequest { $body = @" The packages for [$tag](https://github.com/$gitRepository/releases/tag/$tag) are now available: $packagesUrl. + +Once these packages have been validated have a maintainer post a comment with "/PushPackages" in the body if you would like me to push to NuGet. "@ $pullRequestNumber = $pr.number @@ -150,11 +152,94 @@ The packages for [$tag](https://github.com/$gitRepository/releases/tag/$tag) are Export-ModuleMember -Function TryPostPackagesReadyNoticeOnPrepareReleasePullRequest +function PushPackagesPublishReleaseUnlockAndPostNoticeOnPrepareReleasePullRequest { + param( + [Parameter(Mandatory=$true)][string]$gitRepository, + [Parameter(Mandatory=$true)][string]$pullRequestNumber, + [Parameter(Mandatory=$true)][string]$botUserName, + [Parameter(Mandatory=$true)][string]$commentUserName, + [Parameter(Mandatory=$true)][string]$artifactDownloadPath, + [Parameter(Mandatory=$true)][string]$pushToNuget + ) + + $prViewResponse = gh pr view $pullRequestNumber --json author,title,comments | ConvertFrom-Json + + if ($prViewResponse.author.login -ne $botUserName) + { + throw 'PR author was unexpected' + } + + $match = [regex]::Match($prViewResponse.title, '^\[release\] Prepare release (.*)$') + if ($match.Success -eq $false) + { + throw 'Could not parse tag from PR title' + } + + $tag = $match.Groups[1].Value + + $commentUserPermission = gh api "repos/$gitRepository/collaborators/$commentUserName/permission" | ConvertFrom-Json + if ($commentUserPermission.permission -ne 'admin') + { + gh pr comment $pullRequestNumber ` + --body "I'm sorry @$commentUserName but you don't have permission to push packages. Only maintainers can push to NuGet." + return + } + + $foundComment = $false + $packagesUrl = '' + foreach ($comment in $prViewResponse.comments) + { + if ($comment.author.login -eq $botUserName -and $comment.body.StartsWith("The packages for [$tag](https://github.com/$gitRepository/releases/tag/$tag) are now available:")) + { + $foundComment = $true + break + } + } + + if ($foundComment -eq $false) + { + throw 'Could not find package push comment on pr' + } + + gh release download $tag ` + -p "$tag-packages.zip" ` + -D "$artifactDownloadPath" + + Expand-Archive -LiteralPath "$artifactDownloadPath/$tag-packages.zip" -DestinationPath "$artifactDownloadPath\" + + if ($pushToNuget -eq 'true') + { + gh pr comment $pullRequestNumber ` + --body "I am uploading the packages for ``$tag`` to NuGet and then I will publish the release." + + nuget push "$artifactDownloadPath/**/*.nupkg" -Source https://api.nuget.org/v3/index.json -ApiKey "$env:NUGET_TOKEN" -SymbolApiKey "$env:NUGET_TOKEN" + + if ($LASTEXITCODE -gt 0) + { + gh pr comment $pullRequestNumber ` + --body "Something went wrong uploading the packages for ``$tag`` to NuGet." + + throw 'nuget push failure' + } + } + else { + gh pr comment $pullRequestNumber ` + --body "I am publishing the release without uploading the packages to NuGet because a token wasn't configured." + } + + gh release edit $tag --draft=false + + gh pr unlock $pullRequestNumber +} + +Export-ModuleMember -Function PushPackagesPublishReleaseUnlockAndPostNoticeOnPrepareReleasePullRequest + function CreateStableVersionUpdatePullRequest { param( [Parameter(Mandatory=$true)][string]$gitRepository, [Parameter(Mandatory=$true)][string]$tag, [Parameter()][string]$targetBranch="main", + [Parameter()][string]$lineEnding="`n", [Parameter()][string]$gitUserName, [Parameter()][string]$gitUserEmail ) @@ -165,7 +250,7 @@ function CreateStableVersionUpdatePullRequest { throw 'Could not parse version from tag' } - $packageVersion = $match.Groups[1].Value + $version = $match.Groups[1].Value $branch="release/post-stable-${tag}-update" @@ -184,17 +269,38 @@ function CreateStableVersionUpdatePullRequest { throw 'git switch failure' } + $projectsAndDependenciesBefore = GetCoreDependenciesForProjects + (Get-Content Directory.Packages.props) ` - -replace '.*<\/OTelLatestStableVer>', "$packageVersion" | + -replace '.*<\/OTelLatestStableVer>', "$version" | Set-Content Directory.Packages.props + $projectsAndDependenciesAfter = GetCoreDependenciesForProjects + + $changedProjects = @{} + + $projectsAndDependenciesBefore.GetEnumerator() | ForEach-Object { + $projectDir = $_.Key + $projectDependenciesBefore = $_.Value + $projectDependenciesAfter = $projectsAndDependenciesAfter[$projectDir] + + $projectDependenciesBefore.GetEnumerator() | ForEach-Object { + $packageName = $_.Key + $packageVersionBefore = $_.Value + if ($projectDependenciesAfter[$packageName] -ne $packageVersionBefore) + { + $changedProjects[$projectDir] = $true + } + } + } + git add Directory.Packages.props 2>&1 | % ToString if ($LASTEXITCODE -gt 0) { throw 'git add failure' } - git commit -m "Update OTelLatestStableVer in Directory.Packages.props to $packageVersion." 2>&1 | % ToString + git commit -m "Update OTelLatestStableVer in Directory.Packages.props to $version." 2>&1 | % ToString if ($LASTEXITCODE -gt 0) { throw 'git commit failure' @@ -214,19 +320,177 @@ Merge once packages are available on NuGet and the build passes. ## Changes -* Sets ``OTelLatestStableVer`` in ``Directory.Packages.props`` to ``$packageVersion``. +* Sets ``OTelLatestStableVer`` in ``Directory.Packages.props`` to ``$version``. "@ - gh pr create ` - --title "[repo] Core stable release $packageVersion updates" ` + $createPullRequestResponse = gh pr create ` + --title "[release] Core stable release $version updates" ` --body $body ` --base $targetBranch ` --head $branch ` - --label infra + --label release + + Write-Host $createPullRequestResponse + + $match = [regex]::Match($createPullRequestResponse, "\/pull\/(.*)$") + if ($match.Success -eq $false) + { + throw 'Could not parse pull request number from gh pr create response' + } + + $pullRequestNumber = $match.Groups[1].Value + + if ($changedProjects.Count -eq 0) + { + Return + } + + $entry = @" +* Updated OpenTelemetry core component version(s) to ``$version``. + ([#$pullRequestNumber](https://github.com/$gitRepository/pull/$pullRequestNumber)) + + +"@ + + $lastLineBlank = $true + $changelogFilesUpdated = 0 + + foreach ($projectDir in $changedProjects.Keys) + { + $path = Join-Path -Path $projectDir -ChildPath "CHANGELOG.md" + + if ([System.IO.File]::Exists($path) -eq $false) + { + Write-Host "No CHANGELOG found in $projectDir" + continue + } + + $changelogContent = Get-Content -Path $path + + $started = $false + $isRemoving = $false + $content = "" + + foreach ($line in $changelogContent) + { + if ($line -like "## Unreleased" -and $started -ne $true) + { + $started = $true + } + elseif ($line -like "## *" -and $started -eq $true) + { + if ($lastLineBlank -eq $false) + { + $content += $lineEnding + } + $content += $entry + $started = $false + $isRemoving = $false + } + elseif ($started -eq $true -and ($line -like '*Update* OpenTelemetry SDK version to*' -or $line -like '*Updated OpenTelemetry core component version(s) to*')) + { + $isRemoving = $true + continue + } + + if ($line.StartsWith('* ')) + { + if ($isRemoving -eq $true) + { + $isRemoving = $false + } + + if ($lastLineBlank -eq $false) + { + $content += $lineEnding + } + } + + if ($isRemoving -eq $true) + { + continue + } + + $content += $line + $lineEnding + + $lastLineBlank = [string]::IsNullOrWhitespace($line) + } + + if ($started -eq $true) + { + # Note: If we never wrote the entry it means the file ended in the unreleased section + if ($lastLineBlank -eq $false) + { + $content += $lineEnding + } + $content += $entry + } + + Set-Content -Path $path -Value $content.TrimEnd() + + git add $path 2>&1 | % ToString + if ($LASTEXITCODE -gt 0) + { + throw 'git add failure' + } + + $changelogFilesUpdated++ + } + + if ($changelogFilesUpdated -gt 0) + { + git commit -m "Update CHANGELOGs for projects using OTelLatestStableVer." 2>&1 | % ToString + if ($LASTEXITCODE -gt 0) + { + throw 'git commit failure' + } + + git push -u origin $branch 2>&1 | % ToString + if ($LASTEXITCODE -gt 0) + { + throw 'git push failure' + } + } } Export-ModuleMember -Function CreateStableVersionUpdatePullRequest +function GetCoreDependenciesForProjects { + $projects = @(Get-ChildItem -Path 'src/*/*.csproj') + + $projectsAndDependencies = @{} + + foreach ($project in $projects) + { + # Note: dotnet restore may fail if the core packages aren't available yet but that is fine, we just want to generate project.assets.json for these projects. + $output = dotnet restore $project -p:RunningDotNetPack=true + + $projectDir = $project | Split-Path -Parent + + $content = (Get-Content "$projectDir/obj/project.assets.json" -Raw) + + $projectDependencies = @{} + + $matches = [regex]::Matches($content, '"(OpenTelemetry(?:.*))?": {[\S\s]*?"target": "Package",[\S\s]*?"version": "(.*)"[\S\s]*?}') + foreach ($match in $matches) + { + $packageName = $match.Groups[1].Value + $packageVersion = $match.Groups[2].Value + if ($packageName -eq 'OpenTelemetry' -or + $packageName -eq 'OpenTelemetry.Api' -or + $packageName -eq 'OpenTelemetry.Api.ProviderBuilderExtensions' -or + $packageName -eq 'OpenTelemetry.Extensions.Hosting' -or + $packageName -eq 'OpenTelemetry.Extensions.Propagators') + { + $projectDependencies[$packageName.ToString()] = $packageVersion.ToString() + } + } + $projectsAndDependencies[$projectDir.ToString()] = $projectDependencies + } + + return $projectsAndDependencies +} + function InvokeCoreVersionUpdateWorkflowInRemoteRepository { param( [Parameter(Mandatory=$true)][string]$remoteGitRepository, @@ -271,7 +535,7 @@ function TryPostReleasePublishedNoticeOnPrepareReleasePullRequest { foreach ($pr in $prListResponse) { - if ($pr.author.login -ne $botUserName -or $pr.title -ne "[repo] Prepare release $tag") + if ($pr.author.login -ne $botUserName -or $pr.title -ne "[release] Prepare release $tag") { continue } diff --git a/build/scripts/prepare-release.psm1 b/build/scripts/prepare-release.psm1 index 78a87549808..88e6f7ad11f 100644 --- a/build/scripts/prepare-release.psm1 +++ b/build/scripts/prepare-release.psm1 @@ -59,11 +59,11 @@ Note: This PR was opened automatically by the [prepare release workflow](https:/ } gh pr create ` - --title "[repo] Prepare release $tag" ` + --title "[release] Prepare release $tag" ` --body $body ` --base $targetBranch ` --head $branch ` - --label infra + --label release } Export-ModuleMember -Function CreatePullRequestToUpdateChangelogsAndPublicApis @@ -82,7 +82,7 @@ function LockPullRequestAndPostNoticeToCreateReleaseTag { throw 'PR author was unexpected' } - $match = [regex]::Match($prViewResponse.title, '^\[repo\] Prepare release (.*)$') + $match = [regex]::Match($prViewResponse.title, '^\[release\] Prepare release (.*)$') if ($match.Success -eq $false) { throw 'Could not parse tag from PR title' @@ -100,7 +100,7 @@ function LockPullRequestAndPostNoticeToCreateReleaseTag { @" I noticed this PR was merged. -Post a comment with "/CreateReleaseTag" in the body if you would like me to create the release tag ``$tag`` for [the merge commit](https://github.com/$gitRepository/commit/$commit) and then trigger the package workflow. +Post a comment with "/CreateReleaseTag" in the body if you would like me to create the release tag ``$tag`` for [the merge commit](https://github.com/$gitRepository/commit/$commit) which will trigger the package workflow. "@ gh pr comment $pullRequestNumber --body $body @@ -126,7 +126,7 @@ function CreateReleaseTagAndPostNoticeOnPullRequest { throw 'PR author was unexpected' } - $match = [regex]::Match($prViewResponse.title, '^\[repo\] Prepare release (.*)$') + $match = [regex]::Match($prViewResponse.title, '^\[release\] Prepare release (.*)$') if ($match.Success -eq $false) { throw 'Could not parse tag from PR title' @@ -161,8 +161,6 @@ function CreateReleaseTagAndPostNoticeOnPullRequest { throw 'git push failure' } - gh pr unlock $pullRequestNumber - $body = @" I just pushed the [$tag](https://github.com/$gitRepository/releases/tag/$tag) tag. diff --git a/examples/AspNetCore/otel-collector.yaml b/examples/AspNetCore/otel-collector.yaml index bcf0cb5d6d2..15df605c542 100644 --- a/examples/AspNetCore/otel-collector.yaml +++ b/examples/AspNetCore/otel-collector.yaml @@ -5,8 +5,8 @@ receivers: http: exporters: - logging: - loglevel: debug + debug: + verbosity: detailed prometheus: endpoint: ":9201" send_timestamps: true @@ -21,10 +21,10 @@ service: pipelines: traces: receivers: [otlp] - exporters: [logging,otlp] + exporters: [debug, otlp] metrics: receivers: [otlp] - exporters: [logging,prometheus] + exporters: [debug, prometheus] logs: receivers: [otlp] - exporters: [logging] + exporters: [debug] diff --git a/examples/Console/otlp-collector-example/config.yaml b/examples/Console/otlp-collector-example/config.yaml index 932f24a193d..8d0584b61fa 100644 --- a/examples/Console/otlp-collector-example/config.yaml +++ b/examples/Console/otlp-collector-example/config.yaml @@ -11,17 +11,17 @@ receivers: http: exporters: - logging: + debug: verbosity: detailed service: pipelines: traces: receivers: [otlp] - exporters: [logging] + exporters: [debug] metrics: receivers: [otlp] - exporters: [logging] + exporters: [debug] logs: receivers: [otlp] - exporters: [logging] + exporters: [debug] diff --git a/src/OpenTelemetry.Api.ProviderBuilderExtensions/.publicApi/Stable/PublicAPI.Shipped.txt b/src/OpenTelemetry.Api.ProviderBuilderExtensions/.publicApi/Stable/PublicAPI.Shipped.txt index ca48e185f6d..8c11dafee83 100644 --- a/src/OpenTelemetry.Api.ProviderBuilderExtensions/.publicApi/Stable/PublicAPI.Shipped.txt +++ b/src/OpenTelemetry.Api.ProviderBuilderExtensions/.publicApi/Stable/PublicAPI.Shipped.txt @@ -1,21 +1,30 @@ #nullable enable OpenTelemetry.IOpenTelemetryBuilder OpenTelemetry.IOpenTelemetryBuilder.Services.get -> Microsoft.Extensions.DependencyInjection.IServiceCollection! +OpenTelemetry.Logs.OpenTelemetryDependencyInjectionLoggerProviderBuilderExtensions +OpenTelemetry.Logs.OpenTelemetryDependencyInjectionLoggingServiceCollectionExtensions OpenTelemetry.Metrics.OpenTelemetryDependencyInjectionMeterProviderBuilderExtensions OpenTelemetry.Metrics.OpenTelemetryDependencyInjectionMetricsServiceCollectionExtensions OpenTelemetry.Trace.OpenTelemetryDependencyInjectionTracerProviderBuilderExtensions OpenTelemetry.Trace.OpenTelemetryDependencyInjectionTracingServiceCollectionExtensions -static OpenTelemetry.Metrics.OpenTelemetryDependencyInjectionMeterProviderBuilderExtensions.AddInstrumentation(this OpenTelemetry.Metrics.MeterProviderBuilder! meterProviderBuilder) -> OpenTelemetry.Metrics.MeterProviderBuilder! +static OpenTelemetry.Logs.OpenTelemetryDependencyInjectionLoggerProviderBuilderExtensions.AddInstrumentation(this OpenTelemetry.Logs.LoggerProviderBuilder! loggerProviderBuilder, System.Func! instrumentationFactory) -> OpenTelemetry.Logs.LoggerProviderBuilder! +static OpenTelemetry.Logs.OpenTelemetryDependencyInjectionLoggerProviderBuilderExtensions.AddInstrumentation(this OpenTelemetry.Logs.LoggerProviderBuilder! loggerProviderBuilder, System.Func! instrumentationFactory) -> OpenTelemetry.Logs.LoggerProviderBuilder! +static OpenTelemetry.Logs.OpenTelemetryDependencyInjectionLoggerProviderBuilderExtensions.AddInstrumentation(this OpenTelemetry.Logs.LoggerProviderBuilder! loggerProviderBuilder, T! instrumentation) -> OpenTelemetry.Logs.LoggerProviderBuilder! +static OpenTelemetry.Logs.OpenTelemetryDependencyInjectionLoggerProviderBuilderExtensions.AddInstrumentation(this OpenTelemetry.Logs.LoggerProviderBuilder! loggerProviderBuilder) -> OpenTelemetry.Logs.LoggerProviderBuilder! +static OpenTelemetry.Logs.OpenTelemetryDependencyInjectionLoggerProviderBuilderExtensions.ConfigureServices(this OpenTelemetry.Logs.LoggerProviderBuilder! loggerProviderBuilder, System.Action! configure) -> OpenTelemetry.Logs.LoggerProviderBuilder! +static OpenTelemetry.Logs.OpenTelemetryDependencyInjectionLoggingServiceCollectionExtensions.ConfigureOpenTelemetryLoggerProvider(this Microsoft.Extensions.DependencyInjection.IServiceCollection! services, System.Action! configure) -> Microsoft.Extensions.DependencyInjection.IServiceCollection! +static OpenTelemetry.Logs.OpenTelemetryDependencyInjectionLoggingServiceCollectionExtensions.ConfigureOpenTelemetryLoggerProvider(this Microsoft.Extensions.DependencyInjection.IServiceCollection! services, System.Action! configure) -> Microsoft.Extensions.DependencyInjection.IServiceCollection! static OpenTelemetry.Metrics.OpenTelemetryDependencyInjectionMeterProviderBuilderExtensions.AddInstrumentation(this OpenTelemetry.Metrics.MeterProviderBuilder! meterProviderBuilder, System.Func! instrumentationFactory) -> OpenTelemetry.Metrics.MeterProviderBuilder! static OpenTelemetry.Metrics.OpenTelemetryDependencyInjectionMeterProviderBuilderExtensions.AddInstrumentation(this OpenTelemetry.Metrics.MeterProviderBuilder! meterProviderBuilder, System.Func! instrumentationFactory) -> OpenTelemetry.Metrics.MeterProviderBuilder! static OpenTelemetry.Metrics.OpenTelemetryDependencyInjectionMeterProviderBuilderExtensions.AddInstrumentation(this OpenTelemetry.Metrics.MeterProviderBuilder! meterProviderBuilder, T! instrumentation) -> OpenTelemetry.Metrics.MeterProviderBuilder! +static OpenTelemetry.Metrics.OpenTelemetryDependencyInjectionMeterProviderBuilderExtensions.AddInstrumentation(this OpenTelemetry.Metrics.MeterProviderBuilder! meterProviderBuilder) -> OpenTelemetry.Metrics.MeterProviderBuilder! static OpenTelemetry.Metrics.OpenTelemetryDependencyInjectionMeterProviderBuilderExtensions.ConfigureServices(this OpenTelemetry.Metrics.MeterProviderBuilder! meterProviderBuilder, System.Action! configure) -> OpenTelemetry.Metrics.MeterProviderBuilder! static OpenTelemetry.Metrics.OpenTelemetryDependencyInjectionMetricsServiceCollectionExtensions.ConfigureOpenTelemetryMeterProvider(this Microsoft.Extensions.DependencyInjection.IServiceCollection! services, System.Action! configure) -> Microsoft.Extensions.DependencyInjection.IServiceCollection! static OpenTelemetry.Metrics.OpenTelemetryDependencyInjectionMetricsServiceCollectionExtensions.ConfigureOpenTelemetryMeterProvider(this Microsoft.Extensions.DependencyInjection.IServiceCollection! services, System.Action! configure) -> Microsoft.Extensions.DependencyInjection.IServiceCollection! -static OpenTelemetry.Trace.OpenTelemetryDependencyInjectionTracerProviderBuilderExtensions.AddInstrumentation(this OpenTelemetry.Trace.TracerProviderBuilder! tracerProviderBuilder) -> OpenTelemetry.Trace.TracerProviderBuilder! static OpenTelemetry.Trace.OpenTelemetryDependencyInjectionTracerProviderBuilderExtensions.AddInstrumentation(this OpenTelemetry.Trace.TracerProviderBuilder! tracerProviderBuilder, System.Func! instrumentationFactory) -> OpenTelemetry.Trace.TracerProviderBuilder! static OpenTelemetry.Trace.OpenTelemetryDependencyInjectionTracerProviderBuilderExtensions.AddInstrumentation(this OpenTelemetry.Trace.TracerProviderBuilder! tracerProviderBuilder, System.Func! instrumentationFactory) -> OpenTelemetry.Trace.TracerProviderBuilder! static OpenTelemetry.Trace.OpenTelemetryDependencyInjectionTracerProviderBuilderExtensions.AddInstrumentation(this OpenTelemetry.Trace.TracerProviderBuilder! tracerProviderBuilder, T! instrumentation) -> OpenTelemetry.Trace.TracerProviderBuilder! +static OpenTelemetry.Trace.OpenTelemetryDependencyInjectionTracerProviderBuilderExtensions.AddInstrumentation(this OpenTelemetry.Trace.TracerProviderBuilder! tracerProviderBuilder) -> OpenTelemetry.Trace.TracerProviderBuilder! static OpenTelemetry.Trace.OpenTelemetryDependencyInjectionTracerProviderBuilderExtensions.ConfigureServices(this OpenTelemetry.Trace.TracerProviderBuilder! tracerProviderBuilder, System.Action! configure) -> OpenTelemetry.Trace.TracerProviderBuilder! static OpenTelemetry.Trace.OpenTelemetryDependencyInjectionTracingServiceCollectionExtensions.ConfigureOpenTelemetryTracerProvider(this Microsoft.Extensions.DependencyInjection.IServiceCollection! services, System.Action! configure) -> Microsoft.Extensions.DependencyInjection.IServiceCollection! static OpenTelemetry.Trace.OpenTelemetryDependencyInjectionTracingServiceCollectionExtensions.ConfigureOpenTelemetryTracerProvider(this Microsoft.Extensions.DependencyInjection.IServiceCollection! services, System.Action! configure) -> Microsoft.Extensions.DependencyInjection.IServiceCollection! diff --git a/src/OpenTelemetry.Api.ProviderBuilderExtensions/.publicApi/Stable/PublicAPI.Unshipped.txt b/src/OpenTelemetry.Api.ProviderBuilderExtensions/.publicApi/Stable/PublicAPI.Unshipped.txt index a0f2e472dd6..e69de29bb2d 100644 --- a/src/OpenTelemetry.Api.ProviderBuilderExtensions/.publicApi/Stable/PublicAPI.Unshipped.txt +++ b/src/OpenTelemetry.Api.ProviderBuilderExtensions/.publicApi/Stable/PublicAPI.Unshipped.txt @@ -1,9 +0,0 @@ -OpenTelemetry.Logs.OpenTelemetryDependencyInjectionLoggerProviderBuilderExtensions -OpenTelemetry.Logs.OpenTelemetryDependencyInjectionLoggingServiceCollectionExtensions -static OpenTelemetry.Logs.OpenTelemetryDependencyInjectionLoggerProviderBuilderExtensions.AddInstrumentation(this OpenTelemetry.Logs.LoggerProviderBuilder! loggerProviderBuilder) -> OpenTelemetry.Logs.LoggerProviderBuilder! -static OpenTelemetry.Logs.OpenTelemetryDependencyInjectionLoggerProviderBuilderExtensions.AddInstrumentation(this OpenTelemetry.Logs.LoggerProviderBuilder! loggerProviderBuilder, System.Func! instrumentationFactory) -> OpenTelemetry.Logs.LoggerProviderBuilder! -static OpenTelemetry.Logs.OpenTelemetryDependencyInjectionLoggerProviderBuilderExtensions.AddInstrumentation(this OpenTelemetry.Logs.LoggerProviderBuilder! loggerProviderBuilder, System.Func! instrumentationFactory) -> OpenTelemetry.Logs.LoggerProviderBuilder! -static OpenTelemetry.Logs.OpenTelemetryDependencyInjectionLoggerProviderBuilderExtensions.AddInstrumentation(this OpenTelemetry.Logs.LoggerProviderBuilder! loggerProviderBuilder, T! instrumentation) -> OpenTelemetry.Logs.LoggerProviderBuilder! -static OpenTelemetry.Logs.OpenTelemetryDependencyInjectionLoggerProviderBuilderExtensions.ConfigureServices(this OpenTelemetry.Logs.LoggerProviderBuilder! loggerProviderBuilder, System.Action! configure) -> OpenTelemetry.Logs.LoggerProviderBuilder! -static OpenTelemetry.Logs.OpenTelemetryDependencyInjectionLoggingServiceCollectionExtensions.ConfigureOpenTelemetryLoggerProvider(this Microsoft.Extensions.DependencyInjection.IServiceCollection! services, System.Action! configure) -> Microsoft.Extensions.DependencyInjection.IServiceCollection! -static OpenTelemetry.Logs.OpenTelemetryDependencyInjectionLoggingServiceCollectionExtensions.ConfigureOpenTelemetryLoggerProvider(this Microsoft.Extensions.DependencyInjection.IServiceCollection! services, System.Action! configure) -> Microsoft.Extensions.DependencyInjection.IServiceCollection! diff --git a/src/OpenTelemetry.Api.ProviderBuilderExtensions/CHANGELOG.md b/src/OpenTelemetry.Api.ProviderBuilderExtensions/CHANGELOG.md index 9d22648cde4..fecd873f3a7 100644 --- a/src/OpenTelemetry.Api.ProviderBuilderExtensions/CHANGELOG.md +++ b/src/OpenTelemetry.Api.ProviderBuilderExtensions/CHANGELOG.md @@ -2,6 +2,14 @@ ## Unreleased +## 1.9.0 + +Released 2024-Jun-14 + +## 1.9.0-rc.1 + +Released 2024-Jun-07 + * The experimental APIs previously covered by `OTEL1000` (`LoggerProviderBuilder` `AddInstrumentation` & `ConfigureServices` extensions and `IServiceCollection.ConfigureOpenTelemetryLoggerProvider` extension) will diff --git a/src/OpenTelemetry.Api/.publicApi/Stable/PublicAPI.Shipped.txt b/src/OpenTelemetry.Api/.publicApi/Stable/PublicAPI.Shipped.txt index a87bb701214..7b02ca885de 100644 --- a/src/OpenTelemetry.Api/.publicApi/Stable/PublicAPI.Shipped.txt +++ b/src/OpenTelemetry.Api/.publicApi/Stable/PublicAPI.Shipped.txt @@ -52,6 +52,7 @@ ~static OpenTelemetry.Context.RuntimeContext.SetValue(string slotName, T value) -> void abstract OpenTelemetry.Context.RuntimeContextSlot.Get() -> T abstract OpenTelemetry.Context.RuntimeContextSlot.Set(T value) -> void +abstract OpenTelemetry.Logs.LoggerProviderBuilder.AddInstrumentation(System.Func! instrumentationFactory) -> OpenTelemetry.Logs.LoggerProviderBuilder! abstract OpenTelemetry.Metrics.MeterProviderBuilder.AddInstrumentation(System.Func! instrumentationFactory) -> OpenTelemetry.Metrics.MeterProviderBuilder! abstract OpenTelemetry.Metrics.MeterProviderBuilder.AddMeter(params string![]! names) -> OpenTelemetry.Metrics.MeterProviderBuilder! abstract OpenTelemetry.Trace.TracerProviderBuilder.AddInstrumentation(System.Func! instrumentationFactory) -> OpenTelemetry.Trace.TracerProviderBuilder! @@ -90,6 +91,12 @@ OpenTelemetry.Context.RuntimeContext OpenTelemetry.Context.RuntimeContextSlot OpenTelemetry.Context.RuntimeContextSlot.Dispose() -> void OpenTelemetry.Context.ThreadLocalRuntimeContextSlot +OpenTelemetry.Logs.IDeferredLoggerProviderBuilder +OpenTelemetry.Logs.IDeferredLoggerProviderBuilder.Configure(System.Action! configure) -> OpenTelemetry.Logs.LoggerProviderBuilder! +OpenTelemetry.Logs.LoggerProvider +OpenTelemetry.Logs.LoggerProvider.LoggerProvider() -> void +OpenTelemetry.Logs.LoggerProviderBuilder +OpenTelemetry.Logs.LoggerProviderBuilder.LoggerProviderBuilder() -> void OpenTelemetry.Metrics.IDeferredMeterProviderBuilder OpenTelemetry.Metrics.IDeferredMeterProviderBuilder.Configure(System.Action! configure) -> OpenTelemetry.Metrics.MeterProviderBuilder! OpenTelemetry.Metrics.MeterProvider @@ -104,8 +111,8 @@ OpenTelemetry.Trace.Link.Attributes.get -> System.Collections.Generic.IEnumerabl OpenTelemetry.Trace.Link.Context.get -> OpenTelemetry.Trace.SpanContext OpenTelemetry.Trace.Link.Equals(OpenTelemetry.Trace.Link other) -> bool OpenTelemetry.Trace.Link.Link() -> void -OpenTelemetry.Trace.Link.Link(in OpenTelemetry.Trace.SpanContext spanContext) -> void OpenTelemetry.Trace.Link.Link(in OpenTelemetry.Trace.SpanContext spanContext, OpenTelemetry.Trace.SpanAttributes? attributes) -> void +OpenTelemetry.Trace.Link.Link(in OpenTelemetry.Trace.SpanContext spanContext) -> void OpenTelemetry.Trace.SpanAttributes OpenTelemetry.Trace.SpanAttributes.Add(string! key, bool value) -> void OpenTelemetry.Trace.SpanAttributes.Add(string! key, bool[]? values) -> void @@ -145,10 +152,10 @@ OpenTelemetry.Trace.StatusCode.Error = 2 -> OpenTelemetry.Trace.StatusCode OpenTelemetry.Trace.StatusCode.Ok = 1 -> OpenTelemetry.Trace.StatusCode OpenTelemetry.Trace.StatusCode.Unset = 0 -> OpenTelemetry.Trace.StatusCode OpenTelemetry.Trace.TelemetrySpan -OpenTelemetry.Trace.TelemetrySpan.AddEvent(string! name) -> OpenTelemetry.Trace.TelemetrySpan! OpenTelemetry.Trace.TelemetrySpan.AddEvent(string! name, OpenTelemetry.Trace.SpanAttributes? attributes) -> OpenTelemetry.Trace.TelemetrySpan! -OpenTelemetry.Trace.TelemetrySpan.AddEvent(string! name, System.DateTimeOffset timestamp) -> OpenTelemetry.Trace.TelemetrySpan! OpenTelemetry.Trace.TelemetrySpan.AddEvent(string! name, System.DateTimeOffset timestamp, OpenTelemetry.Trace.SpanAttributes? attributes) -> OpenTelemetry.Trace.TelemetrySpan! +OpenTelemetry.Trace.TelemetrySpan.AddEvent(string! name, System.DateTimeOffset timestamp) -> OpenTelemetry.Trace.TelemetrySpan! +OpenTelemetry.Trace.TelemetrySpan.AddEvent(string! name) -> OpenTelemetry.Trace.TelemetrySpan! OpenTelemetry.Trace.TelemetrySpan.Context.get -> OpenTelemetry.Trace.SpanContext OpenTelemetry.Trace.TelemetrySpan.Dispose() -> void OpenTelemetry.Trace.TelemetrySpan.End() -> void @@ -202,8 +209,8 @@ static OpenTelemetry.Baggage.operator ==(OpenTelemetry.Baggage left, OpenTelemet static OpenTelemetry.Context.Propagation.PropagationContext.operator !=(OpenTelemetry.Context.Propagation.PropagationContext left, OpenTelemetry.Context.Propagation.PropagationContext right) -> bool static OpenTelemetry.Context.Propagation.PropagationContext.operator ==(OpenTelemetry.Context.Propagation.PropagationContext left, OpenTelemetry.Context.Propagation.PropagationContext right) -> bool static OpenTelemetry.Trace.ActivityExtensions.GetStatus(this System.Diagnostics.Activity! activity) -> OpenTelemetry.Trace.Status -static OpenTelemetry.Trace.ActivityExtensions.RecordException(this System.Diagnostics.Activity! activity, System.Exception? ex) -> void static OpenTelemetry.Trace.ActivityExtensions.RecordException(this System.Diagnostics.Activity! activity, System.Exception? ex, in System.Diagnostics.TagList tags) -> void +static OpenTelemetry.Trace.ActivityExtensions.RecordException(this System.Diagnostics.Activity! activity, System.Exception? ex) -> void static OpenTelemetry.Trace.ActivityExtensions.SetStatus(this System.Diagnostics.Activity! activity, OpenTelemetry.Trace.Status status) -> void static OpenTelemetry.Trace.Link.operator !=(OpenTelemetry.Trace.Link link1, OpenTelemetry.Trace.Link link2) -> bool static OpenTelemetry.Trace.Link.operator ==(OpenTelemetry.Trace.Link link1, OpenTelemetry.Trace.Link link2) -> bool diff --git a/src/OpenTelemetry.Api/.publicApi/Stable/PublicAPI.Unshipped.txt b/src/OpenTelemetry.Api/.publicApi/Stable/PublicAPI.Unshipped.txt index d50e30cadb4..e69de29bb2d 100644 --- a/src/OpenTelemetry.Api/.publicApi/Stable/PublicAPI.Unshipped.txt +++ b/src/OpenTelemetry.Api/.publicApi/Stable/PublicAPI.Unshipped.txt @@ -1,7 +0,0 @@ -abstract OpenTelemetry.Logs.LoggerProviderBuilder.AddInstrumentation(System.Func! instrumentationFactory) -> OpenTelemetry.Logs.LoggerProviderBuilder! -OpenTelemetry.Logs.IDeferredLoggerProviderBuilder -OpenTelemetry.Logs.IDeferredLoggerProviderBuilder.Configure(System.Action! configure) -> OpenTelemetry.Logs.LoggerProviderBuilder! -OpenTelemetry.Logs.LoggerProvider -OpenTelemetry.Logs.LoggerProvider.LoggerProvider() -> void -OpenTelemetry.Logs.LoggerProviderBuilder -OpenTelemetry.Logs.LoggerProviderBuilder.LoggerProviderBuilder() -> void diff --git a/src/OpenTelemetry.Api/CHANGELOG.md b/src/OpenTelemetry.Api/CHANGELOG.md index e340f5d5b22..f39d81b108e 100644 --- a/src/OpenTelemetry.Api/CHANGELOG.md +++ b/src/OpenTelemetry.Api/CHANGELOG.md @@ -2,6 +2,18 @@ ## Unreleased +## 1.9.0 + +Released 2024-Jun-14 + +* **Breaking change:** Revert space character encoding change from `+` to `%20` + for baggage item values from [#5303](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5303) + ([#5687](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5687)) + +## 1.9.0-rc.1 + +Released 2024-Jun-07 + * The experimental APIs previously covered by `OTEL1000` (`LoggerProvider`, `LoggerProviderBuilder`, & `IDeferredLoggerProviderBuilder`) will now be part of the public API and supported in stable builds. diff --git a/src/OpenTelemetry.Api/Context/Propagation/BaggagePropagator.cs b/src/OpenTelemetry.Api/Context/Propagation/BaggagePropagator.cs index e9dc29d950d..57bdb453b8f 100644 --- a/src/OpenTelemetry.Api/Context/Propagation/BaggagePropagator.cs +++ b/src/OpenTelemetry.Api/Context/Propagation/BaggagePropagator.cs @@ -1,6 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +using System.Net; using System.Text; using OpenTelemetry.Internal; @@ -93,7 +94,7 @@ public override void Inject(PropagationContext context, T carrier, Action void override OpenTelemetry.Exporter.ConsoleLogRecordExporter.Export(in OpenTelemetry.Batch batch) -> OpenTelemetry.ExportResult override OpenTelemetry.Exporter.ConsoleMetricExporter.Export(in OpenTelemetry.Batch batch) -> OpenTelemetry.ExportResult -static OpenTelemetry.Logs.ConsoleExporterLoggingExtensions.AddConsoleExporter(this OpenTelemetry.Logs.OpenTelemetryLoggerOptions loggerOptions) -> OpenTelemetry.Logs.OpenTelemetryLoggerOptions +static OpenTelemetry.Logs.ConsoleExporterLoggingExtensions.AddConsoleExporter(this OpenTelemetry.Logs.LoggerProviderBuilder loggerProviderBuilder, string name, System.Action configure) -> OpenTelemetry.Logs.LoggerProviderBuilder +static OpenTelemetry.Logs.ConsoleExporterLoggingExtensions.AddConsoleExporter(this OpenTelemetry.Logs.LoggerProviderBuilder loggerProviderBuilder, System.Action configure) -> OpenTelemetry.Logs.LoggerProviderBuilder +static OpenTelemetry.Logs.ConsoleExporterLoggingExtensions.AddConsoleExporter(this OpenTelemetry.Logs.LoggerProviderBuilder loggerProviderBuilder) -> OpenTelemetry.Logs.LoggerProviderBuilder static OpenTelemetry.Logs.ConsoleExporterLoggingExtensions.AddConsoleExporter(this OpenTelemetry.Logs.OpenTelemetryLoggerOptions loggerOptions, System.Action configure) -> OpenTelemetry.Logs.OpenTelemetryLoggerOptions -static OpenTelemetry.Metrics.ConsoleExporterMetricsExtensions.AddConsoleExporter(this OpenTelemetry.Metrics.MeterProviderBuilder builder) -> OpenTelemetry.Metrics.MeterProviderBuilder +static OpenTelemetry.Logs.ConsoleExporterLoggingExtensions.AddConsoleExporter(this OpenTelemetry.Logs.OpenTelemetryLoggerOptions loggerOptions) -> OpenTelemetry.Logs.OpenTelemetryLoggerOptions static OpenTelemetry.Metrics.ConsoleExporterMetricsExtensions.AddConsoleExporter(this OpenTelemetry.Metrics.MeterProviderBuilder builder, string name, System.Action configureExporterAndMetricReader) -> OpenTelemetry.Metrics.MeterProviderBuilder static OpenTelemetry.Metrics.ConsoleExporterMetricsExtensions.AddConsoleExporter(this OpenTelemetry.Metrics.MeterProviderBuilder builder, string name, System.Action configureExporter) -> OpenTelemetry.Metrics.MeterProviderBuilder static OpenTelemetry.Metrics.ConsoleExporterMetricsExtensions.AddConsoleExporter(this OpenTelemetry.Metrics.MeterProviderBuilder builder, System.Action configureExporterAndMetricReader) -> OpenTelemetry.Metrics.MeterProviderBuilder static OpenTelemetry.Metrics.ConsoleExporterMetricsExtensions.AddConsoleExporter(this OpenTelemetry.Metrics.MeterProviderBuilder builder, System.Action configureExporter) -> OpenTelemetry.Metrics.MeterProviderBuilder -static OpenTelemetry.Trace.ConsoleExporterHelperExtensions.AddConsoleExporter(this OpenTelemetry.Trace.TracerProviderBuilder builder) -> OpenTelemetry.Trace.TracerProviderBuilder +static OpenTelemetry.Metrics.ConsoleExporterMetricsExtensions.AddConsoleExporter(this OpenTelemetry.Metrics.MeterProviderBuilder builder) -> OpenTelemetry.Metrics.MeterProviderBuilder static OpenTelemetry.Trace.ConsoleExporterHelperExtensions.AddConsoleExporter(this OpenTelemetry.Trace.TracerProviderBuilder builder, string name, System.Action configure) -> OpenTelemetry.Trace.TracerProviderBuilder static OpenTelemetry.Trace.ConsoleExporterHelperExtensions.AddConsoleExporter(this OpenTelemetry.Trace.TracerProviderBuilder builder, System.Action configure) -> OpenTelemetry.Trace.TracerProviderBuilder +static OpenTelemetry.Trace.ConsoleExporterHelperExtensions.AddConsoleExporter(this OpenTelemetry.Trace.TracerProviderBuilder builder) -> OpenTelemetry.Trace.TracerProviderBuilder diff --git a/src/OpenTelemetry.Exporter.Console/.publicApi/Stable/PublicAPI.Unshipped.txt b/src/OpenTelemetry.Exporter.Console/.publicApi/Stable/PublicAPI.Unshipped.txt index be114835ccd..e69de29bb2d 100644 --- a/src/OpenTelemetry.Exporter.Console/.publicApi/Stable/PublicAPI.Unshipped.txt +++ b/src/OpenTelemetry.Exporter.Console/.publicApi/Stable/PublicAPI.Unshipped.txt @@ -1,3 +0,0 @@ -static OpenTelemetry.Logs.ConsoleExporterLoggingExtensions.AddConsoleExporter(this OpenTelemetry.Logs.LoggerProviderBuilder loggerProviderBuilder) -> OpenTelemetry.Logs.LoggerProviderBuilder -static OpenTelemetry.Logs.ConsoleExporterLoggingExtensions.AddConsoleExporter(this OpenTelemetry.Logs.LoggerProviderBuilder loggerProviderBuilder, string name, System.Action configure) -> OpenTelemetry.Logs.LoggerProviderBuilder -static OpenTelemetry.Logs.ConsoleExporterLoggingExtensions.AddConsoleExporter(this OpenTelemetry.Logs.LoggerProviderBuilder loggerProviderBuilder, System.Action configure) -> OpenTelemetry.Logs.LoggerProviderBuilder diff --git a/src/OpenTelemetry.Exporter.Console/CHANGELOG.md b/src/OpenTelemetry.Exporter.Console/CHANGELOG.md index f6a7ebb48b8..9e94df266e8 100644 --- a/src/OpenTelemetry.Exporter.Console/CHANGELOG.md +++ b/src/OpenTelemetry.Exporter.Console/CHANGELOG.md @@ -2,6 +2,14 @@ ## Unreleased +## 1.9.0 + +Released 2024-Jun-14 + +## 1.9.0-rc.1 + +Released 2024-Jun-07 + * The experimental APIs previously covered by `OTEL1000` (`LoggerProviderBuilder.AddConsoleExporter` extension) will now be part of the public API and supported in stable builds. diff --git a/src/OpenTelemetry.Exporter.InMemory/.publicApi/Stable/PublicAPI.Shipped.txt b/src/OpenTelemetry.Exporter.InMemory/.publicApi/Stable/PublicAPI.Shipped.txt index 499065e2d09..a79ca4f2cf5 100644 --- a/src/OpenTelemetry.Exporter.InMemory/.publicApi/Stable/PublicAPI.Shipped.txt +++ b/src/OpenTelemetry.Exporter.InMemory/.publicApi/Stable/PublicAPI.Shipped.txt @@ -14,11 +14,12 @@ OpenTelemetry.Metrics.MetricSnapshot.Unit.get -> string OpenTelemetry.Trace.InMemoryExporterHelperExtensions override OpenTelemetry.Exporter.InMemoryExporter.Dispose(bool disposing) -> void override OpenTelemetry.Exporter.InMemoryExporter.Export(in OpenTelemetry.Batch batch) -> OpenTelemetry.ExportResult +static OpenTelemetry.Logs.InMemoryExporterLoggingExtensions.AddInMemoryExporter(this OpenTelemetry.Logs.LoggerProviderBuilder loggerProviderBuilder, System.Collections.Generic.ICollection exportedItems) -> OpenTelemetry.Logs.LoggerProviderBuilder static OpenTelemetry.Logs.InMemoryExporterLoggingExtensions.AddInMemoryExporter(this OpenTelemetry.Logs.OpenTelemetryLoggerOptions loggerOptions, System.Collections.Generic.ICollection exportedItems) -> OpenTelemetry.Logs.OpenTelemetryLoggerOptions static OpenTelemetry.Metrics.InMemoryExporterMetricsExtensions.AddInMemoryExporter(this OpenTelemetry.Metrics.MeterProviderBuilder builder, string name, System.Collections.Generic.ICollection exportedItems, System.Action configureMetricReader) -> OpenTelemetry.Metrics.MeterProviderBuilder static OpenTelemetry.Metrics.InMemoryExporterMetricsExtensions.AddInMemoryExporter(this OpenTelemetry.Metrics.MeterProviderBuilder builder, string name, System.Collections.Generic.ICollection exportedItems, System.Action configureMetricReader) -> OpenTelemetry.Metrics.MeterProviderBuilder -static OpenTelemetry.Metrics.InMemoryExporterMetricsExtensions.AddInMemoryExporter(this OpenTelemetry.Metrics.MeterProviderBuilder builder, System.Collections.Generic.ICollection exportedItems) -> OpenTelemetry.Metrics.MeterProviderBuilder static OpenTelemetry.Metrics.InMemoryExporterMetricsExtensions.AddInMemoryExporter(this OpenTelemetry.Metrics.MeterProviderBuilder builder, System.Collections.Generic.ICollection exportedItems, System.Action configureMetricReader) -> OpenTelemetry.Metrics.MeterProviderBuilder -static OpenTelemetry.Metrics.InMemoryExporterMetricsExtensions.AddInMemoryExporter(this OpenTelemetry.Metrics.MeterProviderBuilder builder, System.Collections.Generic.ICollection exportedItems) -> OpenTelemetry.Metrics.MeterProviderBuilder +static OpenTelemetry.Metrics.InMemoryExporterMetricsExtensions.AddInMemoryExporter(this OpenTelemetry.Metrics.MeterProviderBuilder builder, System.Collections.Generic.ICollection exportedItems) -> OpenTelemetry.Metrics.MeterProviderBuilder static OpenTelemetry.Metrics.InMemoryExporterMetricsExtensions.AddInMemoryExporter(this OpenTelemetry.Metrics.MeterProviderBuilder builder, System.Collections.Generic.ICollection exportedItems, System.Action configureMetricReader) -> OpenTelemetry.Metrics.MeterProviderBuilder +static OpenTelemetry.Metrics.InMemoryExporterMetricsExtensions.AddInMemoryExporter(this OpenTelemetry.Metrics.MeterProviderBuilder builder, System.Collections.Generic.ICollection exportedItems) -> OpenTelemetry.Metrics.MeterProviderBuilder static OpenTelemetry.Trace.InMemoryExporterHelperExtensions.AddInMemoryExporter(this OpenTelemetry.Trace.TracerProviderBuilder builder, System.Collections.Generic.ICollection exportedItems) -> OpenTelemetry.Trace.TracerProviderBuilder diff --git a/src/OpenTelemetry.Exporter.InMemory/.publicApi/Stable/PublicAPI.Unshipped.txt b/src/OpenTelemetry.Exporter.InMemory/.publicApi/Stable/PublicAPI.Unshipped.txt index f7378ee36cc..e69de29bb2d 100644 --- a/src/OpenTelemetry.Exporter.InMemory/.publicApi/Stable/PublicAPI.Unshipped.txt +++ b/src/OpenTelemetry.Exporter.InMemory/.publicApi/Stable/PublicAPI.Unshipped.txt @@ -1 +0,0 @@ -static OpenTelemetry.Logs.InMemoryExporterLoggingExtensions.AddInMemoryExporter(this OpenTelemetry.Logs.LoggerProviderBuilder loggerProviderBuilder, System.Collections.Generic.ICollection exportedItems) -> OpenTelemetry.Logs.LoggerProviderBuilder diff --git a/src/OpenTelemetry.Exporter.InMemory/CHANGELOG.md b/src/OpenTelemetry.Exporter.InMemory/CHANGELOG.md index 8b932042281..fc2a00afb3c 100644 --- a/src/OpenTelemetry.Exporter.InMemory/CHANGELOG.md +++ b/src/OpenTelemetry.Exporter.InMemory/CHANGELOG.md @@ -2,6 +2,14 @@ ## Unreleased +## 1.9.0 + +Released 2024-Jun-14 + +## 1.9.0-rc.1 + +Released 2024-Jun-07 + * The experimental APIs previously covered by `OTEL1000` (`LoggerProviderBuilder.AddInMemoryExporter` extension) will now be part of the public API and supported in stable builds. diff --git a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/.publicApi/Stable/PublicAPI.Shipped.txt b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/.publicApi/Stable/PublicAPI.Shipped.txt index 2fd5a429424..94c328771df 100644 --- a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/.publicApi/Stable/PublicAPI.Shipped.txt +++ b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/.publicApi/Stable/PublicAPI.Shipped.txt @@ -33,18 +33,23 @@ OpenTelemetry.Trace.OtlpTraceExporterHelperExtensions override OpenTelemetry.Exporter.OtlpLogExporter.Export(in OpenTelemetry.Batch logRecordBatch) -> OpenTelemetry.ExportResult override OpenTelemetry.Exporter.OtlpMetricExporter.OnShutdown(int timeoutMilliseconds) -> bool override OpenTelemetry.Exporter.OtlpTraceExporter.OnShutdown(int timeoutMilliseconds) -> bool -static OpenTelemetry.Logs.OtlpLogExporterHelperExtensions.AddOtlpExporter(this OpenTelemetry.Logs.OpenTelemetryLoggerOptions! loggerOptions) -> OpenTelemetry.Logs.OpenTelemetryLoggerOptions! +static OpenTelemetry.Logs.OtlpLogExporterHelperExtensions.AddOtlpExporter(this OpenTelemetry.Logs.LoggerProviderBuilder! builder, string? name, System.Action? configureExporterAndProcessor) -> OpenTelemetry.Logs.LoggerProviderBuilder! +static OpenTelemetry.Logs.OtlpLogExporterHelperExtensions.AddOtlpExporter(this OpenTelemetry.Logs.LoggerProviderBuilder! builder, string? name, System.Action? configureExporter) -> OpenTelemetry.Logs.LoggerProviderBuilder! +static OpenTelemetry.Logs.OtlpLogExporterHelperExtensions.AddOtlpExporter(this OpenTelemetry.Logs.LoggerProviderBuilder! builder, System.Action! configureExporterAndProcessor) -> OpenTelemetry.Logs.LoggerProviderBuilder! +static OpenTelemetry.Logs.OtlpLogExporterHelperExtensions.AddOtlpExporter(this OpenTelemetry.Logs.LoggerProviderBuilder! builder, System.Action! configureExporter) -> OpenTelemetry.Logs.LoggerProviderBuilder! +static OpenTelemetry.Logs.OtlpLogExporterHelperExtensions.AddOtlpExporter(this OpenTelemetry.Logs.LoggerProviderBuilder! builder) -> OpenTelemetry.Logs.LoggerProviderBuilder! static OpenTelemetry.Logs.OtlpLogExporterHelperExtensions.AddOtlpExporter(this OpenTelemetry.Logs.OpenTelemetryLoggerOptions! loggerOptions, string? name, System.Action? configureExporterAndProcessor) -> OpenTelemetry.Logs.OpenTelemetryLoggerOptions! static OpenTelemetry.Logs.OtlpLogExporterHelperExtensions.AddOtlpExporter(this OpenTelemetry.Logs.OpenTelemetryLoggerOptions! loggerOptions, string? name, System.Action? configure) -> OpenTelemetry.Logs.OpenTelemetryLoggerOptions! static OpenTelemetry.Logs.OtlpLogExporterHelperExtensions.AddOtlpExporter(this OpenTelemetry.Logs.OpenTelemetryLoggerOptions! loggerOptions, System.Action! configureExporterAndProcessor) -> OpenTelemetry.Logs.OpenTelemetryLoggerOptions! static OpenTelemetry.Logs.OtlpLogExporterHelperExtensions.AddOtlpExporter(this OpenTelemetry.Logs.OpenTelemetryLoggerOptions! loggerOptions, System.Action! configure) -> OpenTelemetry.Logs.OpenTelemetryLoggerOptions! -static OpenTelemetry.Metrics.OtlpMetricExporterExtensions.AddOtlpExporter(this OpenTelemetry.Metrics.MeterProviderBuilder! builder) -> OpenTelemetry.Metrics.MeterProviderBuilder! +static OpenTelemetry.Logs.OtlpLogExporterHelperExtensions.AddOtlpExporter(this OpenTelemetry.Logs.OpenTelemetryLoggerOptions! loggerOptions) -> OpenTelemetry.Logs.OpenTelemetryLoggerOptions! static OpenTelemetry.Metrics.OtlpMetricExporterExtensions.AddOtlpExporter(this OpenTelemetry.Metrics.MeterProviderBuilder! builder, string? name, System.Action? configureExporterAndMetricReader) -> OpenTelemetry.Metrics.MeterProviderBuilder! static OpenTelemetry.Metrics.OtlpMetricExporterExtensions.AddOtlpExporter(this OpenTelemetry.Metrics.MeterProviderBuilder! builder, string? name, System.Action? configure) -> OpenTelemetry.Metrics.MeterProviderBuilder! static OpenTelemetry.Metrics.OtlpMetricExporterExtensions.AddOtlpExporter(this OpenTelemetry.Metrics.MeterProviderBuilder! builder, System.Action! configureExporterAndMetricReader) -> OpenTelemetry.Metrics.MeterProviderBuilder! static OpenTelemetry.Metrics.OtlpMetricExporterExtensions.AddOtlpExporter(this OpenTelemetry.Metrics.MeterProviderBuilder! builder, System.Action! configure) -> OpenTelemetry.Metrics.MeterProviderBuilder! -static OpenTelemetry.OpenTelemetryBuilderOtlpExporterExtensions.UseOtlpExporter(this OpenTelemetry.IOpenTelemetryBuilder! builder) -> OpenTelemetry.IOpenTelemetryBuilder! +static OpenTelemetry.Metrics.OtlpMetricExporterExtensions.AddOtlpExporter(this OpenTelemetry.Metrics.MeterProviderBuilder! builder) -> OpenTelemetry.Metrics.MeterProviderBuilder! static OpenTelemetry.OpenTelemetryBuilderOtlpExporterExtensions.UseOtlpExporter(this OpenTelemetry.IOpenTelemetryBuilder! builder, OpenTelemetry.Exporter.OtlpExportProtocol protocol, System.Uri! baseUrl) -> OpenTelemetry.IOpenTelemetryBuilder! -static OpenTelemetry.Trace.OtlpTraceExporterHelperExtensions.AddOtlpExporter(this OpenTelemetry.Trace.TracerProviderBuilder! builder) -> OpenTelemetry.Trace.TracerProviderBuilder! +static OpenTelemetry.OpenTelemetryBuilderOtlpExporterExtensions.UseOtlpExporter(this OpenTelemetry.IOpenTelemetryBuilder! builder) -> OpenTelemetry.IOpenTelemetryBuilder! static OpenTelemetry.Trace.OtlpTraceExporterHelperExtensions.AddOtlpExporter(this OpenTelemetry.Trace.TracerProviderBuilder! builder, string? name, System.Action? configure) -> OpenTelemetry.Trace.TracerProviderBuilder! static OpenTelemetry.Trace.OtlpTraceExporterHelperExtensions.AddOtlpExporter(this OpenTelemetry.Trace.TracerProviderBuilder! builder, System.Action! configure) -> OpenTelemetry.Trace.TracerProviderBuilder! +static OpenTelemetry.Trace.OtlpTraceExporterHelperExtensions.AddOtlpExporter(this OpenTelemetry.Trace.TracerProviderBuilder! builder) -> OpenTelemetry.Trace.TracerProviderBuilder! diff --git a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/.publicApi/Stable/PublicAPI.Unshipped.txt b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/.publicApi/Stable/PublicAPI.Unshipped.txt index e6bd747c9de..e69de29bb2d 100644 --- a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/.publicApi/Stable/PublicAPI.Unshipped.txt +++ b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/.publicApi/Stable/PublicAPI.Unshipped.txt @@ -1,5 +0,0 @@ -static OpenTelemetry.Logs.OtlpLogExporterHelperExtensions.AddOtlpExporter(this OpenTelemetry.Logs.LoggerProviderBuilder! builder) -> OpenTelemetry.Logs.LoggerProviderBuilder! -static OpenTelemetry.Logs.OtlpLogExporterHelperExtensions.AddOtlpExporter(this OpenTelemetry.Logs.LoggerProviderBuilder! builder, string? name, System.Action? configureExporterAndProcessor) -> OpenTelemetry.Logs.LoggerProviderBuilder! -static OpenTelemetry.Logs.OtlpLogExporterHelperExtensions.AddOtlpExporter(this OpenTelemetry.Logs.LoggerProviderBuilder! builder, string? name, System.Action? configureExporter) -> OpenTelemetry.Logs.LoggerProviderBuilder! -static OpenTelemetry.Logs.OtlpLogExporterHelperExtensions.AddOtlpExporter(this OpenTelemetry.Logs.LoggerProviderBuilder! builder, System.Action! configureExporterAndProcessor) -> OpenTelemetry.Logs.LoggerProviderBuilder! -static OpenTelemetry.Logs.OtlpLogExporterHelperExtensions.AddOtlpExporter(this OpenTelemetry.Logs.LoggerProviderBuilder! builder, System.Action! configureExporter) -> OpenTelemetry.Logs.LoggerProviderBuilder! diff --git a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/CHANGELOG.md b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/CHANGELOG.md index 4c2d56a7243..6c5f736426a 100644 --- a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/CHANGELOG.md +++ b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/CHANGELOG.md @@ -2,6 +2,19 @@ ## Unreleased +* **Breaking change**: Non-primitive attribute (logs) and tag (traces) values + converted using `Convert.ToString` will now format using + `CultureInfo.InvariantCulture`. + ([#5700](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5700)) + +## 1.9.0 + +Released 2024-Jun-14 + +## 1.9.0-rc.1 + +Released 2024-Jun-07 + * The experimental APIs previously covered by `OTEL1000` (`LoggerProviderBuilder.AddOtlpExporter` extension) will now be part of the public API and supported in stable builds. diff --git a/src/OpenTelemetry.Exporter.Prometheus.AspNetCore/CHANGELOG.md b/src/OpenTelemetry.Exporter.Prometheus.AspNetCore/CHANGELOG.md index fa76f44a318..9364cb454c1 100644 --- a/src/OpenTelemetry.Exporter.Prometheus.AspNetCore/CHANGELOG.md +++ b/src/OpenTelemetry.Exporter.Prometheus.AspNetCore/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +## 1.9.0-beta.1 + +Released 2024-Jun-14 + ## 1.9.0-alpha.2 Released 2024-May-29 diff --git a/src/OpenTelemetry.Exporter.Prometheus.HttpListener/CHANGELOG.md b/src/OpenTelemetry.Exporter.Prometheus.HttpListener/CHANGELOG.md index f444457e880..dd437e3e48b 100644 --- a/src/OpenTelemetry.Exporter.Prometheus.HttpListener/CHANGELOG.md +++ b/src/OpenTelemetry.Exporter.Prometheus.HttpListener/CHANGELOG.md @@ -5,6 +5,10 @@ * Fix collection output buffer management when its resized ([#5661](https://github.com/open-telemetry/opentelemetry-dotnet/issues/5661)) +## 1.9.0-beta.1 + +Released 2024-Jun-14 + ## 1.9.0-alpha.2 Released 2024-May-29 diff --git a/src/OpenTelemetry.Exporter.Zipkin/.publicApi/PublicAPI.Shipped.txt b/src/OpenTelemetry.Exporter.Zipkin/.publicApi/PublicAPI.Shipped.txt index 9e2e613e196..5d94b912d2d 100644 --- a/src/OpenTelemetry.Exporter.Zipkin/.publicApi/PublicAPI.Shipped.txt +++ b/src/OpenTelemetry.Exporter.Zipkin/.publicApi/PublicAPI.Shipped.txt @@ -16,6 +16,6 @@ OpenTelemetry.Exporter.ZipkinExporterOptions.UseShortTraceIds.set -> void OpenTelemetry.Exporter.ZipkinExporterOptions.ZipkinExporterOptions() -> void OpenTelemetry.Trace.ZipkinExporterHelperExtensions override OpenTelemetry.Exporter.ZipkinExporter.Export(in OpenTelemetry.Batch batch) -> OpenTelemetry.ExportResult -static OpenTelemetry.Trace.ZipkinExporterHelperExtensions.AddZipkinExporter(this OpenTelemetry.Trace.TracerProviderBuilder builder) -> OpenTelemetry.Trace.TracerProviderBuilder static OpenTelemetry.Trace.ZipkinExporterHelperExtensions.AddZipkinExporter(this OpenTelemetry.Trace.TracerProviderBuilder builder, string name, System.Action configure) -> OpenTelemetry.Trace.TracerProviderBuilder static OpenTelemetry.Trace.ZipkinExporterHelperExtensions.AddZipkinExporter(this OpenTelemetry.Trace.TracerProviderBuilder builder, System.Action configure) -> OpenTelemetry.Trace.TracerProviderBuilder +static OpenTelemetry.Trace.ZipkinExporterHelperExtensions.AddZipkinExporter(this OpenTelemetry.Trace.TracerProviderBuilder builder) -> OpenTelemetry.Trace.TracerProviderBuilder diff --git a/src/OpenTelemetry.Exporter.Zipkin/CHANGELOG.md b/src/OpenTelemetry.Exporter.Zipkin/CHANGELOG.md index 15dcc2f3396..dedce653992 100644 --- a/src/OpenTelemetry.Exporter.Zipkin/CHANGELOG.md +++ b/src/OpenTelemetry.Exporter.Zipkin/CHANGELOG.md @@ -2,6 +2,18 @@ ## Unreleased +* **Breaking change**: Non-primitive tag values converted using + `Convert.ToString` will now format using `CultureInfo.InvariantCulture`. + ([#5700](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5700)) + +## 1.9.0 + +Released 2024-Jun-14 + +## 1.9.0-rc.1 + +Released 2024-Jun-07 + ## 1.9.0-alpha.1 Released 2024-May-20 diff --git a/src/OpenTelemetry.Extensions.Hosting/.publicApi/Stable/PublicAPI.Shipped.txt b/src/OpenTelemetry.Extensions.Hosting/.publicApi/Stable/PublicAPI.Shipped.txt index b0f847bf1ea..57bce9162b8 100644 --- a/src/OpenTelemetry.Extensions.Hosting/.publicApi/Stable/PublicAPI.Shipped.txt +++ b/src/OpenTelemetry.Extensions.Hosting/.publicApi/Stable/PublicAPI.Shipped.txt @@ -3,6 +3,9 @@ Microsoft.Extensions.DependencyInjection.OpenTelemetryServicesExtensions OpenTelemetry.OpenTelemetryBuilder OpenTelemetry.OpenTelemetryBuilder.ConfigureResource(System.Action! configure) -> OpenTelemetry.OpenTelemetryBuilder! OpenTelemetry.OpenTelemetryBuilder.Services.get -> Microsoft.Extensions.DependencyInjection.IServiceCollection! +OpenTelemetry.OpenTelemetryBuilder.WithLogging() -> OpenTelemetry.OpenTelemetryBuilder! +OpenTelemetry.OpenTelemetryBuilder.WithLogging(System.Action! configure) -> OpenTelemetry.OpenTelemetryBuilder! +OpenTelemetry.OpenTelemetryBuilder.WithLogging(System.Action? configureBuilder, System.Action? configureOptions) -> OpenTelemetry.OpenTelemetryBuilder! OpenTelemetry.OpenTelemetryBuilder.WithMetrics() -> OpenTelemetry.OpenTelemetryBuilder! OpenTelemetry.OpenTelemetryBuilder.WithMetrics(System.Action! configure) -> OpenTelemetry.OpenTelemetryBuilder! OpenTelemetry.OpenTelemetryBuilder.WithTracing() -> OpenTelemetry.OpenTelemetryBuilder! diff --git a/src/OpenTelemetry.Extensions.Hosting/.publicApi/Stable/PublicAPI.Unshipped.txt b/src/OpenTelemetry.Extensions.Hosting/.publicApi/Stable/PublicAPI.Unshipped.txt index f83d7ca4a0f..e69de29bb2d 100644 --- a/src/OpenTelemetry.Extensions.Hosting/.publicApi/Stable/PublicAPI.Unshipped.txt +++ b/src/OpenTelemetry.Extensions.Hosting/.publicApi/Stable/PublicAPI.Unshipped.txt @@ -1,3 +0,0 @@ -OpenTelemetry.OpenTelemetryBuilder.WithLogging() -> OpenTelemetry.OpenTelemetryBuilder! -OpenTelemetry.OpenTelemetryBuilder.WithLogging(System.Action! configure) -> OpenTelemetry.OpenTelemetryBuilder! -OpenTelemetry.OpenTelemetryBuilder.WithLogging(System.Action? configureBuilder, System.Action? configureOptions) -> OpenTelemetry.OpenTelemetryBuilder! diff --git a/src/OpenTelemetry.Extensions.Hosting/CHANGELOG.md b/src/OpenTelemetry.Extensions.Hosting/CHANGELOG.md index 3bcc96de580..0b9b1a1c9fe 100644 --- a/src/OpenTelemetry.Extensions.Hosting/CHANGELOG.md +++ b/src/OpenTelemetry.Extensions.Hosting/CHANGELOG.md @@ -2,6 +2,14 @@ ## Unreleased +## 1.9.0 + +Released 2024-Jun-14 + +## 1.9.0-rc.1 + +Released 2024-Jun-07 + * The experimental APIs previously covered by `OTEL1000` (`OpenTelemetryBuilder.WithLogging` method) will now be part of the public API and supported in stable builds. diff --git a/src/OpenTelemetry.Extensions.Propagators/CHANGELOG.md b/src/OpenTelemetry.Extensions.Propagators/CHANGELOG.md index 68d9cd7747f..10b287b0dc3 100644 --- a/src/OpenTelemetry.Extensions.Propagators/CHANGELOG.md +++ b/src/OpenTelemetry.Extensions.Propagators/CHANGELOG.md @@ -2,6 +2,14 @@ ## Unreleased +## 1.9.0 + +Released 2024-Jun-14 + +## 1.9.0-rc.1 + +Released 2024-Jun-07 + ## 1.9.0-alpha.1 Released 2024-May-20 diff --git a/src/OpenTelemetry.Shims.OpenTracing/CHANGELOG.md b/src/OpenTelemetry.Shims.OpenTracing/CHANGELOG.md index 1dbb969e79c..31ebdc599ec 100644 --- a/src/OpenTelemetry.Shims.OpenTracing/CHANGELOG.md +++ b/src/OpenTelemetry.Shims.OpenTracing/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +## 1.9.0-beta.1 + +Released 2024-Jun-14 + ## 1.9.0-alpha.2 Released 2024-May-29 diff --git a/src/OpenTelemetry/.publicApi/Stable/PublicAPI.Shipped.txt b/src/OpenTelemetry/.publicApi/Stable/PublicAPI.Shipped.txt index 6a4426d4ce6..43e084ad586 100644 --- a/src/OpenTelemetry/.publicApi/Stable/PublicAPI.Shipped.txt +++ b/src/OpenTelemetry/.publicApi/Stable/PublicAPI.Shipped.txt @@ -56,6 +56,8 @@ OpenTelemetry.ExportResult.Failure = 1 -> OpenTelemetry.ExportResult OpenTelemetry.ExportResult.Success = 0 -> OpenTelemetry.ExportResult OpenTelemetry.Logs.BatchExportLogRecordProcessorOptions OpenTelemetry.Logs.BatchExportLogRecordProcessorOptions.BatchExportLogRecordProcessorOptions() -> void +OpenTelemetry.Logs.LoggerProviderBuilderExtensions +OpenTelemetry.Logs.LoggerProviderExtensions OpenTelemetry.Logs.LogRecord OpenTelemetry.Logs.LogRecord.Attributes.get -> System.Collections.Generic.IReadOnlyList>? OpenTelemetry.Logs.LogRecord.Attributes.set -> void @@ -129,6 +131,18 @@ OpenTelemetry.Metrics.Base2ExponentialBucketHistogramConfiguration.MaxSize.set - OpenTelemetry.Metrics.BaseExportingMetricReader OpenTelemetry.Metrics.BaseExportingMetricReader.BaseExportingMetricReader(OpenTelemetry.BaseExporter! exporter) -> void OpenTelemetry.Metrics.BaseExportingMetricReader.SupportedExportModes.get -> OpenTelemetry.Metrics.ExportModes +OpenTelemetry.Metrics.Exemplar +OpenTelemetry.Metrics.Exemplar.DoubleValue.get -> double +OpenTelemetry.Metrics.Exemplar.Exemplar() -> void +OpenTelemetry.Metrics.Exemplar.FilteredTags.get -> OpenTelemetry.ReadOnlyFilteredTagCollection +OpenTelemetry.Metrics.Exemplar.LongValue.get -> long +OpenTelemetry.Metrics.Exemplar.SpanId.get -> System.Diagnostics.ActivitySpanId +OpenTelemetry.Metrics.Exemplar.Timestamp.get -> System.DateTimeOffset +OpenTelemetry.Metrics.Exemplar.TraceId.get -> System.Diagnostics.ActivityTraceId +OpenTelemetry.Metrics.ExemplarFilterType +OpenTelemetry.Metrics.ExemplarFilterType.AlwaysOff = 0 -> OpenTelemetry.Metrics.ExemplarFilterType +OpenTelemetry.Metrics.ExemplarFilterType.AlwaysOn = 1 -> OpenTelemetry.Metrics.ExemplarFilterType +OpenTelemetry.Metrics.ExemplarFilterType.TraceBased = 2 -> OpenTelemetry.Metrics.ExemplarFilterType OpenTelemetry.Metrics.ExplicitBucketHistogramConfiguration OpenTelemetry.Metrics.ExplicitBucketHistogramConfiguration.Boundaries.get -> double[]? OpenTelemetry.Metrics.ExplicitBucketHistogramConfiguration.Boundaries.set -> void @@ -195,6 +209,7 @@ OpenTelemetry.Metrics.MetricPoint.GetSumLong() -> long OpenTelemetry.Metrics.MetricPoint.MetricPoint() -> void OpenTelemetry.Metrics.MetricPoint.StartTime.get -> System.DateTimeOffset OpenTelemetry.Metrics.MetricPoint.Tags.get -> OpenTelemetry.ReadOnlyTagCollection +OpenTelemetry.Metrics.MetricPoint.TryGetExemplars(out OpenTelemetry.Metrics.ReadOnlyExemplarCollection exemplars) -> bool OpenTelemetry.Metrics.MetricPoint.TryGetHistogramMinMaxValues(out double min, out double max) -> bool OpenTelemetry.Metrics.MetricPointsAccessor OpenTelemetry.Metrics.MetricPointsAccessor.Enumerator @@ -245,8 +260,22 @@ OpenTelemetry.Metrics.PeriodicExportingMetricReaderOptions.ExportIntervalMillise OpenTelemetry.Metrics.PeriodicExportingMetricReaderOptions.ExportTimeoutMilliseconds.get -> int? OpenTelemetry.Metrics.PeriodicExportingMetricReaderOptions.ExportTimeoutMilliseconds.set -> void OpenTelemetry.Metrics.PeriodicExportingMetricReaderOptions.PeriodicExportingMetricReaderOptions() -> void +OpenTelemetry.Metrics.ReadOnlyExemplarCollection +OpenTelemetry.Metrics.ReadOnlyExemplarCollection.Enumerator +OpenTelemetry.Metrics.ReadOnlyExemplarCollection.Enumerator.Current.get -> OpenTelemetry.Metrics.Exemplar +OpenTelemetry.Metrics.ReadOnlyExemplarCollection.Enumerator.Enumerator() -> void +OpenTelemetry.Metrics.ReadOnlyExemplarCollection.Enumerator.MoveNext() -> bool +OpenTelemetry.Metrics.ReadOnlyExemplarCollection.GetEnumerator() -> OpenTelemetry.Metrics.ReadOnlyExemplarCollection.Enumerator +OpenTelemetry.Metrics.ReadOnlyExemplarCollection.ReadOnlyExemplarCollection() -> void OpenTelemetry.OpenTelemetryBuilderSdkExtensions OpenTelemetry.ProviderExtensions +OpenTelemetry.ReadOnlyFilteredTagCollection +OpenTelemetry.ReadOnlyFilteredTagCollection.Enumerator +OpenTelemetry.ReadOnlyFilteredTagCollection.Enumerator.Current.get -> System.Collections.Generic.KeyValuePair +OpenTelemetry.ReadOnlyFilteredTagCollection.Enumerator.Enumerator() -> void +OpenTelemetry.ReadOnlyFilteredTagCollection.Enumerator.MoveNext() -> bool +OpenTelemetry.ReadOnlyFilteredTagCollection.GetEnumerator() -> OpenTelemetry.ReadOnlyFilteredTagCollection.Enumerator +OpenTelemetry.ReadOnlyFilteredTagCollection.ReadOnlyFilteredTagCollection() -> void OpenTelemetry.ReadOnlyTagCollection OpenTelemetry.ReadOnlyTagCollection.Count.get -> int OpenTelemetry.ReadOnlyTagCollection.Enumerator @@ -289,8 +318,8 @@ OpenTelemetry.Trace.AlwaysOnSampler.AlwaysOnSampler() -> void OpenTelemetry.Trace.BatchExportActivityProcessorOptions OpenTelemetry.Trace.BatchExportActivityProcessorOptions.BatchExportActivityProcessorOptions() -> void OpenTelemetry.Trace.ParentBasedSampler -OpenTelemetry.Trace.ParentBasedSampler.ParentBasedSampler(OpenTelemetry.Trace.Sampler! rootSampler) -> void OpenTelemetry.Trace.ParentBasedSampler.ParentBasedSampler(OpenTelemetry.Trace.Sampler! rootSampler, OpenTelemetry.Trace.Sampler? remoteParentSampled = null, OpenTelemetry.Trace.Sampler? remoteParentNotSampled = null, OpenTelemetry.Trace.Sampler? localParentSampled = null, OpenTelemetry.Trace.Sampler? localParentNotSampled = null) -> void +OpenTelemetry.Trace.ParentBasedSampler.ParentBasedSampler(OpenTelemetry.Trace.Sampler! rootSampler) -> void OpenTelemetry.Trace.Sampler OpenTelemetry.Trace.Sampler.Description.get -> string! OpenTelemetry.Trace.Sampler.Description.set -> void @@ -314,10 +343,10 @@ OpenTelemetry.Trace.SamplingResult.Decision.get -> OpenTelemetry.Trace.SamplingD OpenTelemetry.Trace.SamplingResult.Equals(OpenTelemetry.Trace.SamplingResult other) -> bool OpenTelemetry.Trace.SamplingResult.SamplingResult() -> void OpenTelemetry.Trace.SamplingResult.SamplingResult(bool isSampled) -> void -OpenTelemetry.Trace.SamplingResult.SamplingResult(OpenTelemetry.Trace.SamplingDecision decision) -> void OpenTelemetry.Trace.SamplingResult.SamplingResult(OpenTelemetry.Trace.SamplingDecision decision, string? traceStateString) -> void -OpenTelemetry.Trace.SamplingResult.SamplingResult(OpenTelemetry.Trace.SamplingDecision decision, System.Collections.Generic.IEnumerable>? attributes) -> void OpenTelemetry.Trace.SamplingResult.SamplingResult(OpenTelemetry.Trace.SamplingDecision decision, System.Collections.Generic.IEnumerable>? attributes, string? traceStateString) -> void +OpenTelemetry.Trace.SamplingResult.SamplingResult(OpenTelemetry.Trace.SamplingDecision decision, System.Collections.Generic.IEnumerable>? attributes) -> void +OpenTelemetry.Trace.SamplingResult.SamplingResult(OpenTelemetry.Trace.SamplingDecision decision) -> void OpenTelemetry.Trace.SamplingResult.TraceStateString.get -> string? OpenTelemetry.Trace.TraceIdRatioBasedSampler OpenTelemetry.Trace.TraceIdRatioBasedSampler.TraceIdRatioBasedSampler(double probability) -> void @@ -366,8 +395,17 @@ override OpenTelemetry.Trace.TracerProviderBuilderBase.AddSource(params string![ override sealed OpenTelemetry.BaseExportProcessor.OnStart(T! data) -> void readonly OpenTelemetry.BaseExportProcessor.exporter -> OpenTelemetry.BaseExporter! readonly OpenTelemetry.Metrics.BaseExportingMetricReader.exporter -> OpenTelemetry.BaseExporter! -static Microsoft.Extensions.Logging.OpenTelemetryLoggingExtensions.AddOpenTelemetry(this Microsoft.Extensions.Logging.ILoggingBuilder! builder) -> Microsoft.Extensions.Logging.ILoggingBuilder! static Microsoft.Extensions.Logging.OpenTelemetryLoggingExtensions.AddOpenTelemetry(this Microsoft.Extensions.Logging.ILoggingBuilder! builder, System.Action? configure) -> Microsoft.Extensions.Logging.ILoggingBuilder! +static Microsoft.Extensions.Logging.OpenTelemetryLoggingExtensions.AddOpenTelemetry(this Microsoft.Extensions.Logging.ILoggingBuilder! builder) -> Microsoft.Extensions.Logging.ILoggingBuilder! +static OpenTelemetry.Logs.LoggerProviderBuilderExtensions.AddProcessor(this OpenTelemetry.Logs.LoggerProviderBuilder! loggerProviderBuilder, OpenTelemetry.BaseProcessor! processor) -> OpenTelemetry.Logs.LoggerProviderBuilder! +static OpenTelemetry.Logs.LoggerProviderBuilderExtensions.AddProcessor(this OpenTelemetry.Logs.LoggerProviderBuilder! loggerProviderBuilder, System.Func!>! implementationFactory) -> OpenTelemetry.Logs.LoggerProviderBuilder! +static OpenTelemetry.Logs.LoggerProviderBuilderExtensions.AddProcessor(this OpenTelemetry.Logs.LoggerProviderBuilder! loggerProviderBuilder) -> OpenTelemetry.Logs.LoggerProviderBuilder! +static OpenTelemetry.Logs.LoggerProviderBuilderExtensions.Build(this OpenTelemetry.Logs.LoggerProviderBuilder! loggerProviderBuilder) -> OpenTelemetry.Logs.LoggerProvider! +static OpenTelemetry.Logs.LoggerProviderBuilderExtensions.ConfigureResource(this OpenTelemetry.Logs.LoggerProviderBuilder! loggerProviderBuilder, System.Action! configure) -> OpenTelemetry.Logs.LoggerProviderBuilder! +static OpenTelemetry.Logs.LoggerProviderBuilderExtensions.SetResourceBuilder(this OpenTelemetry.Logs.LoggerProviderBuilder! loggerProviderBuilder, OpenTelemetry.Resources.ResourceBuilder! resourceBuilder) -> OpenTelemetry.Logs.LoggerProviderBuilder! +static OpenTelemetry.Logs.LoggerProviderExtensions.AddProcessor(this OpenTelemetry.Logs.LoggerProvider! provider, OpenTelemetry.BaseProcessor! processor) -> OpenTelemetry.Logs.LoggerProvider! +static OpenTelemetry.Logs.LoggerProviderExtensions.ForceFlush(this OpenTelemetry.Logs.LoggerProvider! provider, int timeoutMilliseconds = -1) -> bool +static OpenTelemetry.Logs.LoggerProviderExtensions.Shutdown(this OpenTelemetry.Logs.LoggerProvider! provider, int timeoutMilliseconds = -1) -> bool static OpenTelemetry.Metrics.MeterProviderBuilderExtensions.AddReader(this OpenTelemetry.Metrics.MeterProviderBuilder! meterProviderBuilder, OpenTelemetry.Metrics.MetricReader! reader) -> OpenTelemetry.Metrics.MeterProviderBuilder! static OpenTelemetry.Metrics.MeterProviderBuilderExtensions.AddReader(this OpenTelemetry.Metrics.MeterProviderBuilder! meterProviderBuilder, System.Func! implementationFactory) -> OpenTelemetry.Metrics.MeterProviderBuilder! static OpenTelemetry.Metrics.MeterProviderBuilderExtensions.AddReader(this OpenTelemetry.Metrics.MeterProviderBuilder! meterProviderBuilder) -> OpenTelemetry.Metrics.MeterProviderBuilder! @@ -376,6 +414,7 @@ static OpenTelemetry.Metrics.MeterProviderBuilderExtensions.AddView(this OpenTel static OpenTelemetry.Metrics.MeterProviderBuilderExtensions.AddView(this OpenTelemetry.Metrics.MeterProviderBuilder! meterProviderBuilder, System.Func! viewConfig) -> OpenTelemetry.Metrics.MeterProviderBuilder! static OpenTelemetry.Metrics.MeterProviderBuilderExtensions.Build(this OpenTelemetry.Metrics.MeterProviderBuilder! meterProviderBuilder) -> OpenTelemetry.Metrics.MeterProvider! static OpenTelemetry.Metrics.MeterProviderBuilderExtensions.ConfigureResource(this OpenTelemetry.Metrics.MeterProviderBuilder! meterProviderBuilder, System.Action! configure) -> OpenTelemetry.Metrics.MeterProviderBuilder! +static OpenTelemetry.Metrics.MeterProviderBuilderExtensions.SetExemplarFilter(this OpenTelemetry.Metrics.MeterProviderBuilder! meterProviderBuilder, OpenTelemetry.Metrics.ExemplarFilterType exemplarFilter) -> OpenTelemetry.Metrics.MeterProviderBuilder! static OpenTelemetry.Metrics.MeterProviderBuilderExtensions.SetMaxMetricPointsPerMetricStream(this OpenTelemetry.Metrics.MeterProviderBuilder! meterProviderBuilder, int maxMetricPointsPerMetricStream) -> OpenTelemetry.Metrics.MeterProviderBuilder! static OpenTelemetry.Metrics.MeterProviderBuilderExtensions.SetMaxMetricStreams(this OpenTelemetry.Metrics.MeterProviderBuilder! meterProviderBuilder, int maxMetricStreams) -> OpenTelemetry.Metrics.MeterProviderBuilder! static OpenTelemetry.Metrics.MeterProviderBuilderExtensions.SetResourceBuilder(this OpenTelemetry.Metrics.MeterProviderBuilder! meterProviderBuilder, OpenTelemetry.Resources.ResourceBuilder! resourceBuilder) -> OpenTelemetry.Metrics.MeterProviderBuilder! @@ -388,10 +427,13 @@ static OpenTelemetry.Metrics.MetricTypeExtensions.IsHistogram(this OpenTelemetry static OpenTelemetry.Metrics.MetricTypeExtensions.IsLong(this OpenTelemetry.Metrics.MetricType self) -> bool static OpenTelemetry.Metrics.MetricTypeExtensions.IsSum(this OpenTelemetry.Metrics.MetricType self) -> bool static OpenTelemetry.OpenTelemetryBuilderSdkExtensions.ConfigureResource(this OpenTelemetry.IOpenTelemetryBuilder! builder, System.Action! configure) -> OpenTelemetry.IOpenTelemetryBuilder! -static OpenTelemetry.OpenTelemetryBuilderSdkExtensions.WithMetrics(this OpenTelemetry.IOpenTelemetryBuilder! builder) -> OpenTelemetry.IOpenTelemetryBuilder! +static OpenTelemetry.OpenTelemetryBuilderSdkExtensions.WithLogging(this OpenTelemetry.IOpenTelemetryBuilder! builder, System.Action! configure) -> OpenTelemetry.IOpenTelemetryBuilder! +static OpenTelemetry.OpenTelemetryBuilderSdkExtensions.WithLogging(this OpenTelemetry.IOpenTelemetryBuilder! builder, System.Action? configureBuilder, System.Action? configureOptions) -> OpenTelemetry.IOpenTelemetryBuilder! +static OpenTelemetry.OpenTelemetryBuilderSdkExtensions.WithLogging(this OpenTelemetry.IOpenTelemetryBuilder! builder) -> OpenTelemetry.IOpenTelemetryBuilder! static OpenTelemetry.OpenTelemetryBuilderSdkExtensions.WithMetrics(this OpenTelemetry.IOpenTelemetryBuilder! builder, System.Action! configure) -> OpenTelemetry.IOpenTelemetryBuilder! -static OpenTelemetry.OpenTelemetryBuilderSdkExtensions.WithTracing(this OpenTelemetry.IOpenTelemetryBuilder! builder) -> OpenTelemetry.IOpenTelemetryBuilder! +static OpenTelemetry.OpenTelemetryBuilderSdkExtensions.WithMetrics(this OpenTelemetry.IOpenTelemetryBuilder! builder) -> OpenTelemetry.IOpenTelemetryBuilder! static OpenTelemetry.OpenTelemetryBuilderSdkExtensions.WithTracing(this OpenTelemetry.IOpenTelemetryBuilder! builder, System.Action! configure) -> OpenTelemetry.IOpenTelemetryBuilder! +static OpenTelemetry.OpenTelemetryBuilderSdkExtensions.WithTracing(this OpenTelemetry.IOpenTelemetryBuilder! builder) -> OpenTelemetry.IOpenTelemetryBuilder! static OpenTelemetry.ProviderExtensions.GetDefaultResource(this OpenTelemetry.BaseProvider! baseProvider) -> OpenTelemetry.Resources.Resource! static OpenTelemetry.ProviderExtensions.GetResource(this OpenTelemetry.BaseProvider! baseProvider) -> OpenTelemetry.Resources.Resource! static OpenTelemetry.Resources.Resource.Empty.get -> OpenTelemetry.Resources.Resource! diff --git a/src/OpenTelemetry/.publicApi/Stable/PublicAPI.Unshipped.txt b/src/OpenTelemetry/.publicApi/Stable/PublicAPI.Unshipped.txt index 4ebd84b69d9..e69de29bb2d 100644 --- a/src/OpenTelemetry/.publicApi/Stable/PublicAPI.Unshipped.txt +++ b/src/OpenTelemetry/.publicApi/Stable/PublicAPI.Unshipped.txt @@ -1,42 +0,0 @@ -OpenTelemetry.Logs.LoggerProviderBuilderExtensions -OpenTelemetry.Logs.LoggerProviderExtensions -OpenTelemetry.Metrics.Exemplar -OpenTelemetry.Metrics.Exemplar.DoubleValue.get -> double -OpenTelemetry.Metrics.Exemplar.Exemplar() -> void -OpenTelemetry.Metrics.Exemplar.FilteredTags.get -> OpenTelemetry.ReadOnlyFilteredTagCollection -OpenTelemetry.Metrics.Exemplar.LongValue.get -> long -OpenTelemetry.Metrics.Exemplar.SpanId.get -> System.Diagnostics.ActivitySpanId -OpenTelemetry.Metrics.Exemplar.Timestamp.get -> System.DateTimeOffset -OpenTelemetry.Metrics.Exemplar.TraceId.get -> System.Diagnostics.ActivityTraceId -OpenTelemetry.Metrics.ExemplarFilterType -OpenTelemetry.Metrics.ExemplarFilterType.AlwaysOff = 0 -> OpenTelemetry.Metrics.ExemplarFilterType -OpenTelemetry.Metrics.ExemplarFilterType.AlwaysOn = 1 -> OpenTelemetry.Metrics.ExemplarFilterType -OpenTelemetry.Metrics.ExemplarFilterType.TraceBased = 2 -> OpenTelemetry.Metrics.ExemplarFilterType -OpenTelemetry.Metrics.MetricPoint.TryGetExemplars(out OpenTelemetry.Metrics.ReadOnlyExemplarCollection exemplars) -> bool -OpenTelemetry.Metrics.ReadOnlyExemplarCollection -OpenTelemetry.Metrics.ReadOnlyExemplarCollection.Enumerator -OpenTelemetry.Metrics.ReadOnlyExemplarCollection.Enumerator.Current.get -> OpenTelemetry.Metrics.Exemplar -OpenTelemetry.Metrics.ReadOnlyExemplarCollection.Enumerator.Enumerator() -> void -OpenTelemetry.Metrics.ReadOnlyExemplarCollection.Enumerator.MoveNext() -> bool -OpenTelemetry.Metrics.ReadOnlyExemplarCollection.GetEnumerator() -> OpenTelemetry.Metrics.ReadOnlyExemplarCollection.Enumerator -OpenTelemetry.Metrics.ReadOnlyExemplarCollection.ReadOnlyExemplarCollection() -> void -OpenTelemetry.ReadOnlyFilteredTagCollection -OpenTelemetry.ReadOnlyFilteredTagCollection.Enumerator -OpenTelemetry.ReadOnlyFilteredTagCollection.Enumerator.Current.get -> System.Collections.Generic.KeyValuePair -OpenTelemetry.ReadOnlyFilteredTagCollection.Enumerator.Enumerator() -> void -OpenTelemetry.ReadOnlyFilteredTagCollection.Enumerator.MoveNext() -> bool -OpenTelemetry.ReadOnlyFilteredTagCollection.GetEnumerator() -> OpenTelemetry.ReadOnlyFilteredTagCollection.Enumerator -OpenTelemetry.ReadOnlyFilteredTagCollection.ReadOnlyFilteredTagCollection() -> void -static OpenTelemetry.OpenTelemetryBuilderSdkExtensions.WithLogging(this OpenTelemetry.IOpenTelemetryBuilder! builder) -> OpenTelemetry.IOpenTelemetryBuilder! -static OpenTelemetry.OpenTelemetryBuilderSdkExtensions.WithLogging(this OpenTelemetry.IOpenTelemetryBuilder! builder, System.Action! configure) -> OpenTelemetry.IOpenTelemetryBuilder! -static OpenTelemetry.OpenTelemetryBuilderSdkExtensions.WithLogging(this OpenTelemetry.IOpenTelemetryBuilder! builder, System.Action? configureBuilder, System.Action? configureOptions) -> OpenTelemetry.IOpenTelemetryBuilder! -static OpenTelemetry.Logs.LoggerProviderBuilderExtensions.AddProcessor(this OpenTelemetry.Logs.LoggerProviderBuilder! loggerProviderBuilder, OpenTelemetry.BaseProcessor! processor) -> OpenTelemetry.Logs.LoggerProviderBuilder! -static OpenTelemetry.Logs.LoggerProviderBuilderExtensions.AddProcessor(this OpenTelemetry.Logs.LoggerProviderBuilder! loggerProviderBuilder, System.Func!>! implementationFactory) -> OpenTelemetry.Logs.LoggerProviderBuilder! -static OpenTelemetry.Logs.LoggerProviderBuilderExtensions.AddProcessor(this OpenTelemetry.Logs.LoggerProviderBuilder! loggerProviderBuilder) -> OpenTelemetry.Logs.LoggerProviderBuilder! -static OpenTelemetry.Logs.LoggerProviderBuilderExtensions.Build(this OpenTelemetry.Logs.LoggerProviderBuilder! loggerProviderBuilder) -> OpenTelemetry.Logs.LoggerProvider! -static OpenTelemetry.Logs.LoggerProviderBuilderExtensions.ConfigureResource(this OpenTelemetry.Logs.LoggerProviderBuilder! loggerProviderBuilder, System.Action! configure) -> OpenTelemetry.Logs.LoggerProviderBuilder! -static OpenTelemetry.Logs.LoggerProviderBuilderExtensions.SetResourceBuilder(this OpenTelemetry.Logs.LoggerProviderBuilder! loggerProviderBuilder, OpenTelemetry.Resources.ResourceBuilder! resourceBuilder) -> OpenTelemetry.Logs.LoggerProviderBuilder! -static OpenTelemetry.Logs.LoggerProviderExtensions.AddProcessor(this OpenTelemetry.Logs.LoggerProvider! provider, OpenTelemetry.BaseProcessor! processor) -> OpenTelemetry.Logs.LoggerProvider! -static OpenTelemetry.Logs.LoggerProviderExtensions.ForceFlush(this OpenTelemetry.Logs.LoggerProvider! provider, int timeoutMilliseconds = -1) -> bool -static OpenTelemetry.Logs.LoggerProviderExtensions.Shutdown(this OpenTelemetry.Logs.LoggerProvider! provider, int timeoutMilliseconds = -1) -> bool -static OpenTelemetry.Metrics.MeterProviderBuilderExtensions.SetExemplarFilter(this OpenTelemetry.Metrics.MeterProviderBuilder! meterProviderBuilder, OpenTelemetry.Metrics.ExemplarFilterType exemplarFilter) -> OpenTelemetry.Metrics.MeterProviderBuilder! diff --git a/src/OpenTelemetry/CHANGELOG.md b/src/OpenTelemetry/CHANGELOG.md index 5f11580af07..ca4d195698d 100644 --- a/src/OpenTelemetry/CHANGELOG.md +++ b/src/OpenTelemetry/CHANGELOG.md @@ -2,6 +2,14 @@ ## Unreleased +## 1.9.0 + +Released 2024-Jun-14 + +## 1.9.0-rc.1 + +Released 2024-Jun-07 + * The experimental APIs previously covered by `OTEL1000` (`LoggerProviderBuilder` `AddProcessor` & `ConfigureResource` extensions, and `LoggerProvider` `ForceFlush` & `Shutdown` extensions) will now be part of the diff --git a/src/Shared/TagWriter/TagWriter.cs b/src/Shared/TagWriter/TagWriter.cs index fb56903363a..9594382df6f 100644 --- a/src/Shared/TagWriter/TagWriter.cs +++ b/src/Shared/TagWriter/TagWriter.cs @@ -4,6 +4,7 @@ #nullable enable using System.Diagnostics; +using System.Globalization; namespace OpenTelemetry.Internal; @@ -82,7 +83,7 @@ public bool TryWriteTag( default: try { - var stringValue = Convert.ToString(tag.Value/*TODO: , CultureInfo.InvariantCulture*/); + var stringValue = Convert.ToString(tag.Value, CultureInfo.InvariantCulture); if (stringValue == null) { return this.LogUnsupportedTagTypeAndReturnFalse(tag.Key, tag.Value); @@ -247,7 +248,7 @@ private void WriteToArrayTypeChecked(ref TArrayState arrayState, Array array, in // case ulong: May throw an exception on overflow. // case decimal: Converting to double produces rounding errors. default: - var stringValue = Convert.ToString(item/*TODO: , CultureInfo.InvariantCulture*/); + var stringValue = Convert.ToString(item, CultureInfo.InvariantCulture); if (stringValue == null) { this.arrayWriter.WriteNullValue(ref arrayState); diff --git a/test/OpenTelemetry.Api.Tests/Trace/Propagation/BaggagePropagatorTest.cs b/test/OpenTelemetry.Api.Tests/Trace/Propagation/BaggagePropagatorTest.cs index 9d8a8972586..097f63e039d 100644 --- a/test/OpenTelemetry.Api.Tests/Trace/Propagation/BaggagePropagatorTest.cs +++ b/test/OpenTelemetry.Api.Tests/Trace/Propagation/BaggagePropagatorTest.cs @@ -131,9 +131,7 @@ public void ValidateSpecialCharsBaggageExtraction() Assert.Equal("key%28%293", escapedKey); Assert.Equal("value%28%29%21%26%3B%3A", escapedValue); - var initialBaggage = - $"key%201=value%201,{encodedKey}={encodedValue},{escapedKey}={escapedValue},key4=%20%21%22%23%24%25%26%27%28%29%2A%2B%2C-.%2F0123456789%3A%3B%3C%3D%3E%3F%40ABCDEFGHIJKLMNOPQRSTUVWXYZ%5B%5C%5D%5E_%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D~"; - + var initialBaggage = $"key+1=value+1,{encodedKey}={encodedValue},{escapedKey}={escapedValue}"; var carrier = new List> { new KeyValuePair(BaggagePropagator.BaggageHeaderName, initialBaggage), @@ -144,11 +142,11 @@ public void ValidateSpecialCharsBaggageExtraction() Assert.False(propagationContext == default); Assert.True(propagationContext.ActivityContext == default); - Assert.Equal(4, propagationContext.Baggage.Count); + Assert.Equal(3, propagationContext.Baggage.Count); var actualBaggage = propagationContext.Baggage.GetBaggage(); - Assert.Equal(4, actualBaggage.Count); + Assert.Equal(3, actualBaggage.Count); Assert.True(actualBaggage.ContainsKey("key 1")); Assert.Equal("value 1", actualBaggage["key 1"]); @@ -158,10 +156,6 @@ public void ValidateSpecialCharsBaggageExtraction() Assert.True(actualBaggage.ContainsKey("key()3")); Assert.Equal("value()!&;:", actualBaggage["key()3"]); - - // x20-x7E range - Assert.True(actualBaggage.ContainsKey("key4")); - Assert.Equal(" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~", actualBaggage["key4"]); } [Fact] @@ -201,14 +195,11 @@ public void ValidateSpecialCharsBaggageInjection() { { "key 1", "value 1" }, { "key2", "!x_x,x-x&x(x\");:" }, - - // x20-x7E range - { "key3", " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" }, })); this.baggage.Inject(propagationContext, carrier, Setter); Assert.Single(carrier); - Assert.Equal("key%201=value%201,key2=%21x_x%2Cx-x%26x%28x%22%29%3B%3A,key3=%20%21%22%23%24%25%26%27%28%29%2A%2B%2C-.%2F0123456789%3A%3B%3C%3D%3E%3F%40ABCDEFGHIJKLMNOPQRSTUVWXYZ%5B%5C%5D%5E_%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D~", carrier[BaggagePropagator.BaggageHeaderName]); + Assert.Equal("key+1=value+1,key2=!x_x%2Cx-x%26x(x%22)%3B%3A", carrier[BaggagePropagator.BaggageHeaderName]); } } diff --git a/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/IntegrationTest/otel-collector-config.yaml b/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/IntegrationTest/otel-collector-config.yaml index 477de40fe74..f479ebe4ad8 100644 --- a/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/IntegrationTest/otel-collector-config.yaml +++ b/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/IntegrationTest/otel-collector-config.yaml @@ -25,17 +25,17 @@ receivers: key_file: /cfg/otel-collector.key exporters: - logging: + debug: verbosity: detailed service: pipelines: traces: receivers: [otlp, otlp/tls] - exporters: [logging] + exporters: [debug] metrics: receivers: [otlp, otlp/tls] - exporters: [logging] + exporters: [debug] logs: receivers: [otlp, otlp/tls] - exporters: [logging] + exporters: [debug] diff --git a/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/OtlpTestHelpers.cs b/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/OtlpTestHelpers.cs index f6011fed01c..ec9dbbe4312 100644 --- a/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/OtlpTestHelpers.cs +++ b/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/OtlpTestHelpers.cs @@ -1,6 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +using System.Globalization; using Google.Protobuf.Collections; using Xunit; using OtlpCommon = OpenTelemetry.Proto.Common.V1; @@ -110,7 +111,7 @@ private static void AssertOtlpAttributeValue(object expected, OtlpCommon.AnyValu Assert.Equal(i, actual.IntValue); break; default: - Assert.Equal(expected.ToString(), actual.StringValue); + Assert.Equal(Convert.ToString(expected, CultureInfo.InvariantCulture), actual.StringValue); break; } } diff --git a/test/OpenTelemetry.Exporter.Prometheus.AspNetCore.Tests/OpenTelemetry.Exporter.Prometheus.AspNetCore.Tests.csproj b/test/OpenTelemetry.Exporter.Prometheus.AspNetCore.Tests/OpenTelemetry.Exporter.Prometheus.AspNetCore.Tests.csproj index e3603d4bc50..97e6f15e108 100644 --- a/test/OpenTelemetry.Exporter.Prometheus.AspNetCore.Tests/OpenTelemetry.Exporter.Prometheus.AspNetCore.Tests.csproj +++ b/test/OpenTelemetry.Exporter.Prometheus.AspNetCore.Tests/OpenTelemetry.Exporter.Prometheus.AspNetCore.Tests.csproj @@ -18,9 +18,17 @@ + + + + - + + + + + diff --git a/test/OpenTelemetry.Exporter.Prometheus.HttpListener.Tests/OpenTelemetry.Exporter.Prometheus.HttpListener.Tests.csproj b/test/OpenTelemetry.Exporter.Prometheus.HttpListener.Tests/OpenTelemetry.Exporter.Prometheus.HttpListener.Tests.csproj index 7ab05160d72..f4901706361 100644 --- a/test/OpenTelemetry.Exporter.Prometheus.HttpListener.Tests/OpenTelemetry.Exporter.Prometheus.HttpListener.Tests.csproj +++ b/test/OpenTelemetry.Exporter.Prometheus.HttpListener.Tests/OpenTelemetry.Exporter.Prometheus.HttpListener.Tests.csproj @@ -18,9 +18,16 @@ + + + + + + + diff --git a/test/OpenTelemetry.Exporter.Zipkin.Tests/ZipkinExporterTests.cs b/test/OpenTelemetry.Exporter.Zipkin.Tests/ZipkinExporterTests.cs index 308f2e6715a..01e40b66b16 100644 --- a/test/OpenTelemetry.Exporter.Zipkin.Tests/ZipkinExporterTests.cs +++ b/test/OpenTelemetry.Exporter.Zipkin.Tests/ZipkinExporterTests.cs @@ -3,6 +3,7 @@ using System.Collections.Concurrent; using System.Diagnostics; +using System.Globalization; using System.Net; #if NETFRAMEWORK using System.Net.Http; @@ -358,7 +359,8 @@ public void IntegrationTest( var serviceName = (string)exporter.ParentProvider.GetDefaultResource().Attributes .Where(pair => pair.Key == ResourceSemanticConventions.AttributeServiceName).FirstOrDefault().Value; var resourceTags = string.Empty; - var activity = CreateTestActivity(isRootSpan: isRootSpan, status: status); + var dateTime = DateTime.UtcNow; + var activity = CreateTestActivity(isRootSpan: isRootSpan, status: status, dateTime: dateTime); if (useTestResource) { serviceName = "MyService"; @@ -422,7 +424,35 @@ public void IntegrationTest( } Assert.Equal( - $@"[{{""traceId"":""{traceId}"",""name"":""Name"",{parentId}""id"":""{ZipkinActivityConversionExtensions.EncodeSpanId(context.SpanId)}"",""kind"":""CLIENT"",""timestamp"":{timestamp},""duration"":60000000,""localEndpoint"":{{""serviceName"":""{serviceName}""{ipInformation}}},""remoteEndpoint"":{{""serviceName"":""http://localhost:44312/""}},""annotations"":[{{""timestamp"":{eventTimestamp},""value"":""Event1""}},{{""timestamp"":{eventTimestamp},""value"":""Event2""}}],""tags"":{{{resourceTags}""stringKey"":""value"",""longKey"":""1"",""longKey2"":""1"",""doubleKey"":""1"",""doubleKey2"":""1"",""longArrayKey"":""[1,2]"",""boolKey"":""true"",""boolArrayKey"":""[true,false]"",""http.host"":""http://localhost:44312/"",{statusTag}{errorTag}""otel.scope.name"":""CreateTestActivity"",""otel.library.name"":""CreateTestActivity"",""peer.service"":""http://localhost:44312/""}}}}]", + $@"[{{""traceId"":""{traceId}""," + + @"""name"":""Name""," + + parentId + + $@"""id"":""{ZipkinActivityConversionExtensions.EncodeSpanId(context.SpanId)}""," + + @"""kind"":""CLIENT""," + + $@"""timestamp"":{timestamp}," + + @"""duration"":60000000," + + $@"""localEndpoint"":{{""serviceName"":""{serviceName}""{ipInformation}}}," + + @"""remoteEndpoint"":{""serviceName"":""http://localhost:44312/""}," + + $@"""annotations"":[{{""timestamp"":{eventTimestamp},""value"":""Event1""}},{{""timestamp"":{eventTimestamp},""value"":""Event2""}}]," + + @"""tags"":{" + + resourceTags + + $@"""stringKey"":""value""," + + @"""longKey"":""1""," + + @"""longKey2"":""1""," + + @"""doubleKey"":""1""," + + @"""doubleKey2"":""1""," + + @"""longArrayKey"":""[1,2]""," + + @"""boolKey"":""true""," + + @"""boolArrayKey"":""[true,false]""," + + @"""http.host"":""http://localhost:44312/""," + + $@"""dateTimeKey"":""{Convert.ToString(dateTime, CultureInfo.InvariantCulture)}""," + + $@"""dateTimeArrayKey"":""[\u0022{Convert.ToString(dateTime, CultureInfo.InvariantCulture)}\u0022]""," + + statusTag + + errorTag + + @"""otel.scope.name"":""CreateTestActivity""," + + @"""otel.library.name"":""CreateTestActivity""," + + @"""peer.service"":""http://localhost:44312/""" + + "}}]", Responses[requestId]); } @@ -434,13 +464,16 @@ internal static Activity CreateTestActivity( bool addLinks = true, Resource resource = null, ActivityKind kind = ActivityKind.Client, - Status? status = null) + Status? status = null, + DateTime? dateTime = null) { var startTimestamp = DateTime.UtcNow; var endTimestamp = startTimestamp.AddSeconds(60); var eventTimestamp = DateTime.UtcNow; var traceId = ActivityTraceId.CreateFromString("e8ea7e9ac72de94e91fabc613f9686b2".AsSpan()); + dateTime ??= DateTime.UtcNow; + var parentSpanId = isRootSpan ? default : ActivitySpanId.CreateFromBytes(new byte[] { 12, 23, 34, 45, 56, 67, 78, 89 }); var attributes = new Dictionary @@ -454,6 +487,8 @@ internal static Activity CreateTestActivity( { "boolKey", true }, { "boolArrayKey", new bool[] { true, false } }, { "http.host", "http://localhost:44312/" }, // simulating instrumentation tag adding http.host + { "dateTimeKey", dateTime.Value }, + { "dateTimeArrayKey", new DateTime[] { dateTime.Value } }, }; if (additionalAttributes != null) { diff --git a/test/OpenTelemetry.Shims.OpenTracing.Tests/OpenTelemetry.Shims.OpenTracing.Tests.csproj b/test/OpenTelemetry.Shims.OpenTracing.Tests/OpenTelemetry.Shims.OpenTracing.Tests.csproj index 7e08df554f3..07fe011a082 100644 --- a/test/OpenTelemetry.Shims.OpenTracing.Tests/OpenTelemetry.Shims.OpenTracing.Tests.csproj +++ b/test/OpenTelemetry.Shims.OpenTracing.Tests/OpenTelemetry.Shims.OpenTracing.Tests.csproj @@ -15,8 +15,14 @@ - - + + + + + + + + diff --git a/test/OpenTelemetry.Tests/SuppressInstrumentationTest.cs b/test/OpenTelemetry.Tests/SuppressInstrumentationTest.cs index d562699fec8..d6ccb414ddf 100644 --- a/test/OpenTelemetry.Tests/SuppressInstrumentationTest.cs +++ b/test/OpenTelemetry.Tests/SuppressInstrumentationTest.cs @@ -51,7 +51,7 @@ public void SuppressInstrumentationBeginTest(bool? shouldBegin) } [Fact] - public async void SuppressInstrumentationScopeEnterIsLocalToAsyncFlow() + public async Task SuppressInstrumentationScopeEnterIsLocalToAsyncFlow() { Assert.False(Sdk.SuppressInstrumentation);