Skip to content

Commit

Permalink
[Resources.ProcessRuntime] Rename processruntime detector namespace (#…
Browse files Browse the repository at this point in the history
…1767)

Co-authored-by: Mikel Blanchard <[email protected]>
  • Loading branch information
matt-hensley and CodeBlanch authored May 16, 2024
1 parent 1c51ad7 commit e2c1e71
Show file tree
Hide file tree
Showing 21 changed files with 84 additions and 53 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ body:
- OpenTelemetry.ResourceDetectors.Azure
- OpenTelemetry.ResourceDetectors.Container
- OpenTelemetry.ResourceDetectors.Host
- OpenTelemetry.ResourceDetectors.ProcessRuntime
- OpenTelemetry.Resources.Gcp
- OpenTelemetry.Resources.Process
- OpenTelemetry.Resources.ProcessRuntime
- OpenTelemetry.Sampler.AWS
- OpenTelemetry.SemanticConventions
validations:
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ body:
- OpenTelemetry.ResourceDetectors.Azure
- OpenTelemetry.ResourceDetectors.Container
- OpenTelemetry.ResourceDetectors.Host
- OpenTelemetry.ResourceDetectors.ProcessRuntime
- OpenTelemetry.Resources.Gcp
- OpenTelemetry.Resources.Process
- OpenTelemetry.Resources.ProcessRuntime
- OpenTelemetry.Sampler.AWS
- OpenTelemetry.SemanticConventions

Expand Down
8 changes: 4 additions & 4 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,15 @@ flags:
paths:
- src/OpenTelemetry.ResourceDetectors.Host

unittests-ResourceDetectors.ProcessRuntime:
unittests-Resources.Process:
carryforward: true
paths:
- src/OpenTelemetry.ResourceDetectors.ProcessRuntime
- src/OpenTelemetry.Resources.Process

unittests-Resources.Process:
unittests-Resources.ProcessRuntime:
carryforward: true
paths:
- src/OpenTelemetry.Resources.Process
- src/OpenTelemetry.Resources.ProcessRuntime

unittests-SemanticConventions:
carryforward: true
Expand Down
8 changes: 4 additions & 4 deletions .github/component_owners.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ components:
src/OpenTelemetry.ResourceDetectors.Host/:
- Kielek
- lachmatt
src/OpenTelemetry.ResourceDetectors.ProcessRuntime/:
src/OpenTelemetry.Resources.Process/:
- Kielek
- lachmatt
src/OpenTelemetry.Resources.Process/:
src/OpenTelemetry.Resources.ProcessRuntime/:
- Kielek
- lachmatt
src/OpenTelemetry.Resources.Gcp/:
Expand Down Expand Up @@ -166,10 +166,10 @@ components:
test/OpenTelemetry.ResourceDetectors.Host.Tests/:
- Kielek
- lachmatt
test/OpenTelemetry.ResourceDetectors.ProcessRuntime.Tests/:
test/OpenTelemetry.Resources.Process.Tests/:
- Kielek
- lachmatt
test/OpenTelemetry.Resources.Process.Tests/:
test/OpenTelemetry.Resources.ProcessRuntime.Tests/:
- Kielek
- lachmatt
test/OpenTelemetry.Resources.Gcp.Tests/:
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
persistentstorage: ['*/OpenTelemetry.PersistentStorage*/**', '!**/*.md']
process: ['*/OpenTelemetry.Instrumentation.Process*/**', 'examples/process-instrumentation/**', '!**/*.md']
processdetector: ['*/OpenTelemetry.Resources.Process/**', '*/OpenTelemetry.Resources.Process.Tests/**', '!**/*.md']
processruntime: ['*/OpenTelemetry.ResourceDetectors.ProcessRuntime/**', '*/OpenTelemetry.ResourceDetectors.ProcessRuntime.Tests/**', '!**/*.md']
processruntime: ['*/OpenTelemetry.Resources.ProcessRuntime/**', '*/OpenTelemetry.Resources.ProcessRuntime.Tests/**', '!**/*.md']
redis: ['*/OpenTelemetry.Instrumentation.StackExchangeRedis*/**', 'examples/redis/**', '!**/*.md']
resourcedetectors: ['*/OpenTelemetry.ResourceDetectors.*/**', '!**/*.md']
runtime: ['*/OpenTelemetry.Instrumentation.Runtime*/**', 'examples/runtime-instrumentation/**', '!**/*.md']
Expand All @@ -57,11 +57,11 @@ jobs:
'!examples/AspNet/**',
'!*/OpenTelemetry.ResourceDetectors.Azure*/**',
'!*/OpenTelemetry.ResourceDetectors.Host*/**',
'!*/OpenTelemetry.ResourceDetectors.ProcessRuntime/**',
'!*/OpenTelemetry.ResourceDetectors.ProcessRuntime.Tests/**',
'!*/OpenTelemetry.Resources.Gcp*/**',
'!*/OpenTelemetry.Resources.Process/**',
'!*/OpenTelemetry.Resources.Process.Tests/**',
'!*/OpenTelemetry.Resources.ProcessRuntime/**',
'!*/OpenTelemetry.Resources.ProcessRuntime.Tests/**',
'!*/OpenTelemetry.Instrumentation.EventCounters*/**',
'!examples/event-counters/**',
'!*/OpenTelemetry.Extensions/**',
Expand Down Expand Up @@ -280,8 +280,8 @@ jobs:
|| contains(needs.detect-changes.outputs.changes, 'shared')
uses: ./.github/workflows/Component.BuildTest.yml
with:
project-name: OpenTelemetry.ResourceDetectors.ProcessRuntime
code-cov-name: ResourceDetectors.ProcessRuntime
project-name: OpenTelemetry.Resources.ProcessRuntime
code-cov-name: Resources.ProcessRuntime

build-test-redis:
needs: detect-changes
Expand Down Expand Up @@ -405,9 +405,9 @@ jobs:
OpenTelemetry.PersistentStorage.FileSystem.Tests.csproj,
OpenTelemetry.ResourceDetectors.Azure.Tests.csproj,
OpenTelemetry.ResourceDetectors.Host.Tests.csproj,
OpenTelemetry.ResourceDetectors.ProcessRuntime.Tests.csproj,
OpenTelemetry.Resources.Gcp.Tests.csproj,
OpenTelemetry.Resources.Process.Tests.csproj
OpenTelemetry.Resources.Process.Tests.csproj,
OpenTelemetry.Resources.ProcessRuntime.Tests.csproj
$failedProjects = @()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

<PropertyGroup>
<RepoRoot>$([System.IO.Directory]::GetParent($(MSBuildThisFileDirectory)).Parent.Parent.FullName)</RepoRoot>
<MinVerTagPrefix>ResourceDetectors.ProcessRuntime-</MinVerTagPrefix>
<MinVerTagPrefix>Resources.ProcessRuntime-</MinVerTagPrefix>
</PropertyGroup>

<ItemGroup>
<SolutionProjects Include="$(RepoRoot)\src\OpenTelemetry.ResourceDetectors.ProcessRuntime\OpenTelemetry.ResourceDetectors.ProcessRuntime.csproj" />
<SolutionProjects Include="$(RepoRoot)\test\OpenTelemetry.ResourceDetectors.ProcessRuntime.Tests\OpenTelemetry.ResourceDetectors.ProcessRuntime.Tests.csproj" />
<SolutionProjects Include="$(RepoRoot)\src\OpenTelemetry.Resources.ProcessRuntime\OpenTelemetry.Resources.ProcessRuntime.csproj" />
<SolutionProjects Include="$(RepoRoot)\test\OpenTelemetry.Resources.ProcessRuntime.Tests\OpenTelemetry.Resources.ProcessRuntime.Tests.csproj" />

<PackProjects Include="$(RepoRoot)\src\OpenTelemetry.ResourceDetectors.ProcessRuntime\OpenTelemetry.ResourceDetectors.ProcessRuntime.csproj" />
<PackProjects Include="$(RepoRoot)\src\OpenTelemetry.Resources.ProcessRuntime\OpenTelemetry.Resources.ProcessRuntime.csproj" />

<TestProjects Include="$(RepoRoot)\test\OpenTelemetry.ResourceDetectors.ProcessRuntime.Tests\OpenTelemetry.ResourceDetectors.ProcessRuntime.Tests.csproj" />
<TestProjects Include="$(RepoRoot)\test\OpenTelemetry.Resources.ProcessRuntime.Tests\OpenTelemetry.Resources.ProcessRuntime.Tests.csproj" />
</ItemGroup>

<Target Name="Build">
Expand Down
6 changes: 3 additions & 3 deletions opentelemetry-dotnet-contrib.sln
Original file line number Diff line number Diff line change
Expand Up @@ -300,15 +300,15 @@ 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.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.Resources.ProcessRuntime.proj = build\Projects\OpenTelemetry.Resources.ProcessRuntime.proj
build\Projects\OpenTelemetry.SemanticConventions.proj = build\Projects\OpenTelemetry.SemanticConventions.proj
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.ResourceDetectors.ProcessRuntime", "src\OpenTelemetry.ResourceDetectors.ProcessRuntime\OpenTelemetry.ResourceDetectors.ProcessRuntime.csproj", "{95372E82-CA5B-4C61-BD6C-74E6AB1970D4}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.Resources.ProcessRuntime", "src\OpenTelemetry.Resources.ProcessRuntime\OpenTelemetry.Resources.ProcessRuntime.csproj", "{95372E82-CA5B-4C61-BD6C-74E6AB1970D4}"
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}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.Resources.ProcessRuntime.Tests", "test\OpenTelemetry.Resources.ProcessRuntime.Tests\OpenTelemetry.Resources.ProcessRuntime.Tests.csproj", "{B6157646-8EBA-464C-99B9-C386D474CB12}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.Resources.Process", "src\OpenTelemetry.Resources.Process\OpenTelemetry.Resources.Process.csproj", "{A5FCDD8F-20FF-4657-804E-707EAD4FE31D}"
EndProject
Expand Down

This file was deleted.

10 changes: 0 additions & 10 deletions src/OpenTelemetry.ResourceDetectors.ProcessRuntime/AssemblyInfo.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
OpenTelemetry.Resources.ProcessRuntimeResourceBuilderExtensions
static OpenTelemetry.Resources.ProcessRuntimeResourceBuilderExtensions.AddProcessRuntimeDetector(this OpenTelemetry.Resources.ResourceBuilder! builder) -> OpenTelemetry.Resources.ResourceBuilder!
10 changes: 10 additions & 0 deletions src/OpenTelemetry.Resources.ProcessRuntime/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

using System.Runtime.CompilerServices;

#if SIGNED
[assembly: InternalsVisibleTo("OpenTelemetry.Resources.ProcessRuntime.Tests, PublicKey=002400000480000094000000060200000024000052534131000400000100010051c1562a090fb0c9f391012a32198b5e5d9a60e9b80fa2d7b434c9e5ccb7259bd606e66f9660676afc6692b8cdc6793d190904551d2103b7b22fa636dcbb8208839785ba402ea08fc00c8f1500ccef28bbf599aa64ffb1e1d5dc1bf3420a3777badfe697856e9d52070a50c3ea5821c80bef17ca3acffa28f89dd413f096f898")]
#else
[assembly: InternalsVisibleTo("OpenTelemetry.Resources.ProcessRuntime.Tests")]
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## Unreleased

* **Breaking Change**: Renamed package from `OpenTelemetry.ResourceDetectors.ProcessRuntime`
to `OpenTelemetry.Resources.ProcessRuntime`.
([#1767](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1767))
* **Breaking Change**: `ProcessRuntimeDetector` type is now internal, use `ResourceBuilder`
extension method `AddProcessRuntimeDetector` to enable the detector.
([#1767](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1767))
* Update OpenTelemetry SDK version to `1.8.1`.
([#1668](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1668))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks Condition="$(OS) == 'Windows_NT'">$(TargetFrameworks);$(NetFrameworkMinimumSupportedVersion)</TargetFrameworks>
<Description>OpenTelemetry Extensions - Process Runtime Resource Detector for .NET runtime.</Description>
<MinVerTagPrefix>ResourceDetectors.ProcessRuntime-</MinVerTagPrefix>
<MinVerTagPrefix>Resources.ProcessRuntime-</MinVerTagPrefix>
</PropertyGroup>

<!--Do not run Package Baseline Validation as this package has never released a stable version.
Expand All @@ -17,4 +17,8 @@
<PackageReference Include="OpenTelemetry" Version="$(OpenTelemetryCoreLatestVersion)" />
<PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" Version="4.0.0" Condition="'$(TargetFramework)' == '$(NetFrameworkMinimumSupportedVersion)'" />
</ItemGroup>

<ItemGroup>
<Compile Include="$(RepoRoot)\src\Shared\Guard.cs" Link="Includes\Guard.cs" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@
#if NETFRAMEWORK
using Microsoft.Win32;
#endif
using OpenTelemetry.Resources;

namespace OpenTelemetry.ResourceDetectors.ProcessRuntime;
namespace OpenTelemetry.Resources.ProcessRuntime;

/// <summary>
/// Process runtime detector.
/// </summary>
public sealed class ProcessRuntimeDetector : IResourceDetector
internal sealed class ProcessRuntimeDetector : IResourceDetector
{
/// <summary>
/// Detects the resource attributes from .NET runtime.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

using OpenTelemetry.Internal;
using OpenTelemetry.Resources.ProcessRuntime;

namespace OpenTelemetry.Resources;

/// <summary>
/// Extension methods to simplify registering of process runtime resource detectors.
/// </summary>
public static class ProcessRuntimeResourceBuilderExtensions
{
/// <summary>
/// Enables process runtime resource detector.
/// </summary>
/// <param name="builder"><see cref="ResourceBuilder" /> being configured.</param>
/// <returns>The instance of <see cref="ResourceBuilder" /> being configured.</returns>
public static ResourceBuilder AddProcessRuntimeDetector(this ResourceBuilder builder)
{
Guard.ThrowIfNull(builder);
return builder.AddDetector(new ProcessRuntimeDetector());
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

namespace OpenTelemetry.ResourceDetectors.ProcessRuntime;
namespace OpenTelemetry.Resources.ProcessRuntime;

internal static class ProcessRuntimeSemanticConventions
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Process Runtime Resource Detectors

[![NuGet version badge](https://img.shields.io/nuget/v/OpenTelemetry.ResourceDetectors.ProcessRuntime)](https://www.nuget.org/packages/OpenTelemetry.ResourceDetectors.ProcessRuntime)
[![NuGet download count badge](https://img.shields.io/nuget/dt/OpenTelemetry.ResourceDetectors.ProcessRuntime)](https://www.nuget.org/packages/OpenTelemetry.ResourceDetectors.ProcessRuntime)
[![NuGet version badge](https://img.shields.io/nuget/v/OpenTelemetry.Resources.ProcessRuntime)](https://www.nuget.org/packages/OpenTelemetry.Resources.ProcessRuntime)
[![NuGet download count badge](https://img.shields.io/nuget/dt/OpenTelemetry.Resources.ProcessRuntime)](https://www.nuget.org/packages/OpenTelemetry.Resources.ProcessRuntime)

> [!IMPORTANT]
> Resources detected by this packages are defined by [experimental semantic convention](https://github.com/open-telemetry/semantic-conventions/blob/v1.24.0/docs/resource/process.md#process-runtimes).
Expand All @@ -10,11 +10,11 @@
## Getting Started

You need to install the
`OpenTelemetry.ResourceDetectors.ProcessRuntime` package to be able to use the
`OpenTelemetry.Resources.ProcessRuntime` package to be able to use the
Process Runtime Resource Detectors.

```shell
dotnet add package OpenTelemetry.ResourceDetectors.ProcessRuntime --prerelease
dotnet add package OpenTelemetry.Resources.ProcessRuntime --prerelease
```

## Usage
Expand All @@ -24,12 +24,12 @@ the `TracerProvider` with the following example below.

```csharp
using OpenTelemetry;
using OpenTelemetry.ResourceDetectors.ProcessRuntime;
using OpenTelemetry.Resources;

var tracerProvider = Sdk.CreateTracerProviderBuilder()
// other configurations
.ConfigureResource(resource => resource
.AddDetector(new ProcessRuntimeDetector()))
.AddProcessRuntimeDetector())
.Build();
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
<TrimmerRootAssembly Include="OpenTelemetry.ResourceDetectors.Azure" />
<TrimmerRootAssembly Include="OpenTelemetry.ResourceDetectors.Container" />
<TrimmerRootAssembly Include="OpenTelemetry.ResourceDetectors.Host" />
<TrimmerRootAssembly Include="OpenTelemetry.ResourceDetectors.ProcessRuntime" />
<TrimmerRootAssembly Include="OpenTelemetry.Resources.Process" />
<TrimmerRootAssembly Include="OpenTelemetry.Resources.ProcessRuntime" />
<TrimmerRootAssembly Include="OpenTelemetry.Sampler.AWS" />

<TrimmerRootAssembly Update="@(TrimmerRootAssembly)" Path="$(RepoRoot)\src\%(Identity)\%(Identity).csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry.ResourceDetectors.ProcessRuntime\OpenTelemetry.ResourceDetectors.ProcessRuntime.csproj" />
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry.Resources.ProcessRuntime\OpenTelemetry.Resources.ProcessRuntime.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
// SPDX-License-Identifier: Apache-2.0

using System.Linq;
using OpenTelemetry.Resources;
using Xunit;

namespace OpenTelemetry.ResourceDetectors.ProcessRuntime.Tests;
namespace OpenTelemetry.Resources.ProcessRuntime.Tests;

public class ProcessRuntimeDetectorTests
{
Expand Down

0 comments on commit e2c1e71

Please sign in to comment.