From cf0258da7873e3a6ce559a2b39d7c627a7ab806c Mon Sep 17 00:00:00 2001 From: Matt Hensley <130569+matt-hensley@users.noreply.github.com> Date: Wed, 15 May 2024 03:05:13 -0400 Subject: [PATCH] [Resources.Process] Rename process detector namespace (#1717) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Piotr Kiełkowicz --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- .github/ISSUE_TEMPLATE/feature_request.yml | 2 +- .github/codecov.yml | 8 +++---- .github/component_owners.yml | 8 +++---- .github/workflows/ci.yml | 14 +++++------ ...cess.yml => package-Resources.Process.yml} | 6 ++--- ...j => OpenTelemetry.Resources.Process.proj} | 8 +++---- opentelemetry-dotnet-contrib.sln | 8 +++---- .../.publicApi/PublicAPI.Unshipped.txt | 3 --- .../AssemblyInfo.cs | 10 -------- .../.publicApi/PublicAPI.Shipped.txt | 0 .../.publicApi/PublicAPI.Unshipped.txt | 2 ++ .../AssemblyInfo.cs | 10 ++++++++ .../CHANGELOG.md | 6 +++++ .../OpenTelemetry.Resources.Process.csproj} | 6 ++++- .../ProcessDetector.cs | 5 ++-- .../ProcessResourceBuilderExtensions.cs | 24 +++++++++++++++++++ .../ProcessSemanticConventions.cs | 2 +- .../README.md | 11 ++++----- ...nTelemetry.AotCompatibility.TestApp.csproj | 2 +- ...nTelemetry.Resources.Process.Tests.csproj} | 2 +- .../ProcessDetectorTests.cs | 3 +-- 22 files changed, 86 insertions(+), 56 deletions(-) rename .github/workflows/{package-ResourceDetectors.Process.yml => package-Resources.Process.yml} (58%) rename build/Projects/{OpenTelemetry.ResourceDetectors.Process.proj => OpenTelemetry.Resources.Process.proj} (75%) delete mode 100644 src/OpenTelemetry.ResourceDetectors.Process/.publicApi/PublicAPI.Unshipped.txt delete mode 100644 src/OpenTelemetry.ResourceDetectors.Process/AssemblyInfo.cs rename src/{OpenTelemetry.ResourceDetectors.Process => OpenTelemetry.Resources.Process}/.publicApi/PublicAPI.Shipped.txt (100%) create mode 100644 src/OpenTelemetry.Resources.Process/.publicApi/PublicAPI.Unshipped.txt create mode 100644 src/OpenTelemetry.Resources.Process/AssemblyInfo.cs rename src/{OpenTelemetry.ResourceDetectors.Process => OpenTelemetry.Resources.Process}/CHANGELOG.md (64%) rename src/{OpenTelemetry.ResourceDetectors.Process/OpenTelemetry.ResourceDetectors.Process.csproj => OpenTelemetry.Resources.Process/OpenTelemetry.Resources.Process.csproj} (84%) rename src/{OpenTelemetry.ResourceDetectors.Process => OpenTelemetry.Resources.Process}/ProcessDetector.cs (85%) create mode 100644 src/OpenTelemetry.Resources.Process/ProcessResourceBuilderExtensions.cs rename src/{OpenTelemetry.ResourceDetectors.Process => OpenTelemetry.Resources.Process}/ProcessSemanticConventions.cs (83%) rename src/{OpenTelemetry.ResourceDetectors.Process => OpenTelemetry.Resources.Process}/README.md (70%) rename test/{OpenTelemetry.ResourceDetectors.Process.Tests/OpenTelemetry.ResourceDetectors.Process.Tests.csproj => OpenTelemetry.Resources.Process.Tests/OpenTelemetry.Resources.Process.Tests.csproj} (88%) rename test/{OpenTelemetry.ResourceDetectors.Process.Tests => OpenTelemetry.Resources.Process.Tests}/ProcessDetectorTests.cs (88%) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index d0f4aa71b2..c33c1fe1e1 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -52,9 +52,9 @@ body: - OpenTelemetry.ResourceDetectors.Azure - OpenTelemetry.ResourceDetectors.Container - OpenTelemetry.ResourceDetectors.Host - - OpenTelemetry.ResourceDetectors.Process - OpenTelemetry.ResourceDetectors.ProcessRuntime - OpenTelemetry.Resources.Gcp + - OpenTelemetry.Resources.Process - OpenTelemetry.Sampler.AWS - OpenTelemetry.SemanticConventions validations: diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index 2d8c7483d7..48af8837b3 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -52,9 +52,9 @@ body: - OpenTelemetry.ResourceDetectors.Azure - OpenTelemetry.ResourceDetectors.Container - OpenTelemetry.ResourceDetectors.Host - - OpenTelemetry.ResourceDetectors.Process - OpenTelemetry.ResourceDetectors.ProcessRuntime - OpenTelemetry.Resources.Gcp + - OpenTelemetry.Resources.Process - OpenTelemetry.Sampler.AWS - OpenTelemetry.SemanticConventions diff --git a/.github/codecov.yml b/.github/codecov.yml index 3981524084..0664709197 100644 --- a/.github/codecov.yml +++ b/.github/codecov.yml @@ -129,15 +129,15 @@ flags: paths: - src/OpenTelemetry.ResourceDetectors.Host - unittests-ResourceDetectors.Process: + unittests-ResourceDetectors.ProcessRuntime: carryforward: true paths: - - src/OpenTelemetry.ResourceDetectors.Process + - src/OpenTelemetry.ResourceDetectors.ProcessRuntime - unittests-ResourceDetectors.ProcessRuntime: + unittests-Resources.Process: carryforward: true paths: - - src/OpenTelemetry.ResourceDetectors.ProcessRuntime + - src/OpenTelemetry.Resources.Process unittests-SemanticConventions: carryforward: true diff --git a/.github/component_owners.yml b/.github/component_owners.yml index 7df093a797..505c9fb1d3 100644 --- a/.github/component_owners.yml +++ b/.github/component_owners.yml @@ -73,10 +73,10 @@ components: src/OpenTelemetry.ResourceDetectors.Host/: - Kielek - lachmatt - src/OpenTelemetry.ResourceDetectors.Process/: + src/OpenTelemetry.ResourceDetectors.ProcessRuntime/: - Kielek - lachmatt - src/OpenTelemetry.ResourceDetectors.ProcessRuntime/: + src/OpenTelemetry.Resources.Process/: - Kielek - lachmatt src/OpenTelemetry.Resources.Gcp/: @@ -166,10 +166,10 @@ components: test/OpenTelemetry.ResourceDetectors.Host.Tests/: - Kielek - lachmatt - test/OpenTelemetry.ResourceDetectors.Process.Tests/: + test/OpenTelemetry.ResourceDetectors.ProcessRuntime.Tests/: - Kielek - lachmatt - test/OpenTelemetry.ResourceDetectors.ProcessRuntime.Tests/: + test/OpenTelemetry.Resources.Process.Tests/: - Kielek - lachmatt test/OpenTelemetry.Resources.Gcp.Tests/: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f07c34505b..c232af80e1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,7 +38,7 @@ jobs: owin: ['*/OpenTelemetry.Instrumentation.Owin*/**', 'examples/owin/**', '!**/*.md'] persistentstorage: ['*/OpenTelemetry.PersistentStorage*/**', '!**/*.md'] process: ['*/OpenTelemetry.Instrumentation.Process*/**', 'examples/process-instrumentation/**', '!**/*.md'] - processdetector: ['*/OpenTelemetry.ResourceDetectors.Process/**', '*/OpenTelemetry.ResourceDetectors.Process.Tests/**', '!**/*.md'] + processdetector: ['*/OpenTelemetry.Resources.Process/**', '*/OpenTelemetry.Resources.Process.Tests/**', '!**/*.md'] processruntime: ['*/OpenTelemetry.ResourceDetectors.ProcessRuntime/**', '*/OpenTelemetry.ResourceDetectors.ProcessRuntime.Tests/**', '!**/*.md'] redis: ['*/OpenTelemetry.Instrumentation.StackExchangeRedis*/**', 'examples/redis/**', '!**/*.md'] resourcedetectors: ['*/OpenTelemetry.ResourceDetectors.*/**', '!**/*.md'] @@ -56,11 +56,11 @@ jobs: '!examples/AspNet/**', '!*/OpenTelemetry.ResourceDetectors.Azure*/**', '!*/OpenTelemetry.ResourceDetectors.Host*/**', - '!*/OpenTelemetry.ResourceDetectors.Process/**', - '!*/OpenTelemetry.ResourceDetectors.Process.Tests/**', '!*/OpenTelemetry.ResourceDetectors.ProcessRuntime/**', '!*/OpenTelemetry.ResourceDetectors.ProcessRuntime.Tests/**', '!*/OpenTelemetry.Resources.Gcp*/**', + '!*/OpenTelemetry.Resources.Process/**', + '!*/OpenTelemetry.Resources.Process.Tests/**', '!*/OpenTelemetry.Instrumentation.EventCounters*/**', '!examples/event-counters/**', '!*/OpenTelemetry.Extensions/**', @@ -267,8 +267,8 @@ jobs: || contains(needs.detect-changes.outputs.changes, 'shared') uses: ./.github/workflows/Component.BuildTest.yml with: - project-name: OpenTelemetry.ResourceDetectors.Process - code-cov-name: ResourceDetectors.Process + project-name: OpenTelemetry.Resources.Process + code-cov-name: Resources.Process build-test-processruntime: needs: detect-changes @@ -391,9 +391,9 @@ jobs: OpenTelemetry.PersistentStorage.FileSystem.Tests.csproj, OpenTelemetry.ResourceDetectors.Azure.Tests.csproj, OpenTelemetry.ResourceDetectors.Host.Tests.csproj, - OpenTelemetry.ResourceDetectors.Process.Tests.csproj, OpenTelemetry.ResourceDetectors.ProcessRuntime.Tests.csproj, - OpenTelemetry.Resources.Gcp.Tests.csproj + OpenTelemetry.Resources.Gcp.Tests.csproj, + OpenTelemetry.Resources.Process.Tests.csproj $failedProjects = @() diff --git a/.github/workflows/package-ResourceDetectors.Process.yml b/.github/workflows/package-Resources.Process.yml similarity index 58% rename from .github/workflows/package-ResourceDetectors.Process.yml rename to .github/workflows/package-Resources.Process.yml index 874054383d..ff1dc2cf26 100644 --- a/.github/workflows/package-ResourceDetectors.Process.yml +++ b/.github/workflows/package-Resources.Process.yml @@ -1,4 +1,4 @@ -name: Pack OpenTelemetry.ResourceDetectors.Process +name: Pack OpenTelemetry.Resources.Process on: workflow_dispatch: @@ -9,7 +9,7 @@ on: default: 'warning' push: tags: - - 'ResourceDetectors.Process-*' # trigger when we create a tag with prefix "ResourceDetectors.Process-" + - 'Resources.Process-*' # trigger when we create a tag with prefix "Resources.Process-" jobs: call-build-test-pack: @@ -17,5 +17,5 @@ jobs: contents: write uses: ./.github/workflows/Component.Package.yml with: - project-name: OpenTelemetry.ResourceDetectors.Process + project-name: OpenTelemetry.Resources.Process secrets: inherit diff --git a/build/Projects/OpenTelemetry.ResourceDetectors.Process.proj b/build/Projects/OpenTelemetry.Resources.Process.proj similarity index 75% rename from build/Projects/OpenTelemetry.ResourceDetectors.Process.proj rename to build/Projects/OpenTelemetry.Resources.Process.proj index 032a74930c..364b4c2358 100644 --- a/build/Projects/OpenTelemetry.ResourceDetectors.Process.proj +++ b/build/Projects/OpenTelemetry.Resources.Process.proj @@ -5,12 +5,12 @@ - - + + - + - + diff --git a/opentelemetry-dotnet-contrib.sln b/opentelemetry-dotnet-contrib.sln index aa6bf16d09..45a674d0c3 100644 --- a/opentelemetry-dotnet-contrib.sln +++ b/opentelemetry-dotnet-contrib.sln @@ -70,8 +70,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{ .github\workflows\package-ResourceDetectors.Azure.yml = .github\workflows\package-ResourceDetectors.Azure.yml .github\workflows\package-ResourceDetectors.Container.yml = .github\workflows\package-ResourceDetectors.Container.yml .github\workflows\package-ResourceDetectors.Host.yml = .github\workflows\package-ResourceDetectors.Host.yml - .github\workflows\package-ResourceDetectors.Process.yml = .github\workflows\package-ResourceDetectors.Process.yml .github\workflows\package-ResourceDetectors.ProcessRuntime.yml = .github\workflows\package-ResourceDetectors.ProcessRuntime.yml + .github\workflows\package-Resources.Process.yml = .github\workflows\package-Resources.Process.yml .github\workflows\package-Sampler.AWS.yml = .github\workflows\package-Sampler.AWS.yml .github\workflows\package-SemanticConventions.yml = .github\workflows\package-SemanticConventions.yml .github\workflows\sanitycheck.yml = .github\workflows\sanitycheck.yml @@ -335,9 +335,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Projects", "Projects", "{04 build\Projects\OpenTelemetry.PersistentStorage.proj = build\Projects\OpenTelemetry.PersistentStorage.proj build\Projects\OpenTelemetry.ResourceDetectors.Azure.proj = build\Projects\OpenTelemetry.ResourceDetectors.Azure.proj build\Projects\OpenTelemetry.ResourceDetectors.Host.proj = build\Projects\OpenTelemetry.ResourceDetectors.Host.proj - build\Projects\OpenTelemetry.ResourceDetectors.Process.proj = build\Projects\OpenTelemetry.ResourceDetectors.Process.proj build\Projects\OpenTelemetry.ResourceDetectors.ProcessRuntime.proj = build\Projects\OpenTelemetry.ResourceDetectors.ProcessRuntime.proj build\Projects\OpenTelemetry.Resources.Gcp.proj = build\Projects\OpenTelemetry.Resources.Gcp.proj + build\Projects\OpenTelemetry.Resources.Process.proj = build\Projects\OpenTelemetry.Resources.Process.proj build\Projects\OpenTelemetry.SemanticConventions.proj = build\Projects\OpenTelemetry.SemanticConventions.proj EndProjectSection EndProject @@ -345,9 +345,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.ResourceDetec EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.ResourceDetectors.ProcessRuntime.Tests", "test\OpenTelemetry.ResourceDetectors.ProcessRuntime.Tests\OpenTelemetry.ResourceDetectors.ProcessRuntime.Tests.csproj", "{B6157646-8EBA-464C-99B9-C386D474CB12}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.ResourceDetectors.Process", "src\OpenTelemetry.ResourceDetectors.Process\OpenTelemetry.ResourceDetectors.Process.csproj", "{A5FCDD8F-20FF-4657-804E-707EAD4FE31D}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.Resources.Process", "src\OpenTelemetry.Resources.Process\OpenTelemetry.Resources.Process.csproj", "{A5FCDD8F-20FF-4657-804E-707EAD4FE31D}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.ResourceDetectors.Process.Tests", "test\OpenTelemetry.ResourceDetectors.Process.Tests\OpenTelemetry.ResourceDetectors.Process.Tests.csproj", "{A5EF701C-439E-407F-8BB4-394166000C6D}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.Resources.Process.Tests", "test\OpenTelemetry.Resources.Process.Tests\OpenTelemetry.Resources.Process.Tests.csproj", "{A5EF701C-439E-407F-8BB4-394166000C6D}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.ResourceDetectors.Host", "src\OpenTelemetry.ResourceDetectors.Host\OpenTelemetry.ResourceDetectors.Host.csproj", "{033CA8D4-1529-413A-B244-07958D5F9A48}" EndProject diff --git a/src/OpenTelemetry.ResourceDetectors.Process/.publicApi/PublicAPI.Unshipped.txt b/src/OpenTelemetry.ResourceDetectors.Process/.publicApi/PublicAPI.Unshipped.txt deleted file mode 100644 index 536c6eae3b..0000000000 --- a/src/OpenTelemetry.ResourceDetectors.Process/.publicApi/PublicAPI.Unshipped.txt +++ /dev/null @@ -1,3 +0,0 @@ -OpenTelemetry.ResourceDetectors.Process.ProcessDetector -OpenTelemetry.ResourceDetectors.Process.ProcessDetector.Detect() -> OpenTelemetry.Resources.Resource! -OpenTelemetry.ResourceDetectors.Process.ProcessDetector.ProcessDetector() -> void diff --git a/src/OpenTelemetry.ResourceDetectors.Process/AssemblyInfo.cs b/src/OpenTelemetry.ResourceDetectors.Process/AssemblyInfo.cs deleted file mode 100644 index 221b668c6c..0000000000 --- a/src/OpenTelemetry.ResourceDetectors.Process/AssemblyInfo.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -using System.Runtime.CompilerServices; - -#if SIGNED -[assembly: InternalsVisibleTo("OpenTelemetry.ResourceDetectors.Process.Tests, PublicKey=002400000480000094000000060200000024000052534131000400000100010051c1562a090fb0c9f391012a32198b5e5d9a60e9b80fa2d7b434c9e5ccb7259bd606e66f9660676afc6692b8cdc6793d190904551d2103b7b22fa636dcbb8208839785ba402ea08fc00c8f1500ccef28bbf599aa64ffb1e1d5dc1bf3420a3777badfe697856e9d52070a50c3ea5821c80bef17ca3acffa28f89dd413f096f898")] -#else -[assembly: InternalsVisibleTo("OpenTelemetry.ResourceDetectors.Process.Tests")] -#endif diff --git a/src/OpenTelemetry.ResourceDetectors.Process/.publicApi/PublicAPI.Shipped.txt b/src/OpenTelemetry.Resources.Process/.publicApi/PublicAPI.Shipped.txt similarity index 100% rename from src/OpenTelemetry.ResourceDetectors.Process/.publicApi/PublicAPI.Shipped.txt rename to src/OpenTelemetry.Resources.Process/.publicApi/PublicAPI.Shipped.txt diff --git a/src/OpenTelemetry.Resources.Process/.publicApi/PublicAPI.Unshipped.txt b/src/OpenTelemetry.Resources.Process/.publicApi/PublicAPI.Unshipped.txt new file mode 100644 index 0000000000..4621d779b2 --- /dev/null +++ b/src/OpenTelemetry.Resources.Process/.publicApi/PublicAPI.Unshipped.txt @@ -0,0 +1,2 @@ +OpenTelemetry.Resources.ProcessResourceBuilderExtensions +static OpenTelemetry.Resources.ProcessResourceBuilderExtensions.AddProcessDetector(this OpenTelemetry.Resources.ResourceBuilder! builder) -> OpenTelemetry.Resources.ResourceBuilder! diff --git a/src/OpenTelemetry.Resources.Process/AssemblyInfo.cs b/src/OpenTelemetry.Resources.Process/AssemblyInfo.cs new file mode 100644 index 0000000000..e1263c0c07 --- /dev/null +++ b/src/OpenTelemetry.Resources.Process/AssemblyInfo.cs @@ -0,0 +1,10 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +using System.Runtime.CompilerServices; + +#if SIGNED +[assembly: InternalsVisibleTo("OpenTelemetry.Resources.Process.Tests, PublicKey=002400000480000094000000060200000024000052534131000400000100010051c1562a090fb0c9f391012a32198b5e5d9a60e9b80fa2d7b434c9e5ccb7259bd606e66f9660676afc6692b8cdc6793d190904551d2103b7b22fa636dcbb8208839785ba402ea08fc00c8f1500ccef28bbf599aa64ffb1e1d5dc1bf3420a3777badfe697856e9d52070a50c3ea5821c80bef17ca3acffa28f89dd413f096f898")] +#else +[assembly: InternalsVisibleTo("OpenTelemetry.Resources.Process.Tests")] +#endif diff --git a/src/OpenTelemetry.ResourceDetectors.Process/CHANGELOG.md b/src/OpenTelemetry.Resources.Process/CHANGELOG.md similarity index 64% rename from src/OpenTelemetry.ResourceDetectors.Process/CHANGELOG.md rename to src/OpenTelemetry.Resources.Process/CHANGELOG.md index 88b52267a6..daf5a47089 100644 --- a/src/OpenTelemetry.ResourceDetectors.Process/CHANGELOG.md +++ b/src/OpenTelemetry.Resources.Process/CHANGELOG.md @@ -2,6 +2,12 @@ ## Unreleased +* **Breaking Change**: Renamed package from `OpenTelemetry.ResourceDetectors.Process` + to `OpenTelemetry.Resources.Process`. + ([#1717](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1717)) +* **Breaking Change**: `ProcessDetector` type is now internal, use `ResourceBuilder` + extension method `AddProcessDetector` to enable the detector. + ([#1717](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1717)) * Update OpenTelemetry SDK version to `1.8.1`. ([#1668](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1668)) diff --git a/src/OpenTelemetry.ResourceDetectors.Process/OpenTelemetry.ResourceDetectors.Process.csproj b/src/OpenTelemetry.Resources.Process/OpenTelemetry.Resources.Process.csproj similarity index 84% rename from src/OpenTelemetry.ResourceDetectors.Process/OpenTelemetry.ResourceDetectors.Process.csproj rename to src/OpenTelemetry.Resources.Process/OpenTelemetry.Resources.Process.csproj index 73da91d636..5d90876bb5 100644 --- a/src/OpenTelemetry.ResourceDetectors.Process/OpenTelemetry.ResourceDetectors.Process.csproj +++ b/src/OpenTelemetry.Resources.Process/OpenTelemetry.Resources.Process.csproj @@ -4,7 +4,7 @@ net6.0 $(TargetFrameworks);$(NetFrameworkMinimumSupportedVersion) OpenTelemetry Extensions - Process Resource Detector. - ResourceDetectors.Process- + Resources.Process-