Bump OpenTelemetry.Resources.OperatingSystem to 0.1.0-alpha.3/OpenTelemetry.Resources.Host to 0.1.0-beta.3 (#3597)

This commit is contained in:
Yevhenii Solomchenko 2024-09-05 07:11:38 +02:00 committed by GitHub
parent 53c39f31a7
commit 8b1bf12b72
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 40 additions and 8 deletions

View File

@ -49,7 +49,8 @@ This component adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.h
- Following packages updated
- `MongoDB.Driver.Core.Extensions.DiagnosticSources` from `1.4.0` to `1.5.0`,
- `OpenTelemetry.Exporter.Prometheus.HttpListener` from `1.9.0-beta.1` to `1.9.0-beta.2`,
- `OpenTelemetry.Shims.OpenTracing` from `1.9.0-beta.1` to `1.9.0-beta.2`.
- `OpenTelemetry.Shims.OpenTracing` from `1.9.0-beta.1` to `1.9.0-beta.2`,
- `OpenTelemetry.Resources.Host` from `0.1.0-beta.2` to `0.1.0-beta.3`.
- .NET only, following packages updated
- `OpenTelemetry.Instrumentation.StackExchangeRedis` from `1.0.0-rc9.15` to `1.9.0-beta.1`.
- .NET Framework only, following packages updated

View File

@ -93,8 +93,8 @@ The following resource detectors are included and enabled by default:
|-------------------|----------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|
| `AZUREAPPSERVICE` | Azure App Service detector | [Azure resource detector documentation](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/blob/Resources.Azure-1.0.0-beta.8/src/OpenTelemetry.Resources.Azure/README.md) | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) |
| `CONTAINER` | Container detector | [Container resource detector documentation](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/blob/Resources.Container-1.0.0-beta.9/src/OpenTelemetry.Resources.Container/README.md) **Not supported on .NET Framework** | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) |
| `HOST` | Host detector | [Host resource detector documentation](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/blob/Resources.Host-0.1.0-beta.2/src/OpenTelemetry.Resources.Host/README.md) | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) |
| `OPERATINGSYSTEM` | Operating System detector | [Operating System resource detector documentation](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/blob/Resources.OperatingSystem-0.1.0-alpha.2/src/OpenTelemetry.Resources.OperatingSystem/README.md) | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) |
| `HOST` | Host detector | [Host resource detector documentation](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/blob/Resources.Host-0.1.0-beta.3/src/OpenTelemetry.Resources.Host/README.md) | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) |
| `OPERATINGSYSTEM` | Operating System detector | [Operating System resource detector documentation](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/blob/Resources.OperatingSystem-0.1.0-alpha.3/src/OpenTelemetry.Resources.OperatingSystem/README.md) | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) |
| `PROCESS` | Process detector | [Process resource detector documentation](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/blob/Resources.Process-0.1.0-beta.2/src/OpenTelemetry.Resources.Process/README.md) | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) |
| `PROCESSRUNTIME` | Process Runtime detector | [Process Runtime resource detector documentation](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/blob/Resources.ProcessRuntime-0.1.0-beta.2/src/OpenTelemetry.Resources.ProcessRuntime/README.md) | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) |

View File

@ -28,8 +28,8 @@
<PackageVersion Include="OpenTelemetry.Shims.OpenTracing" Version="1.9.0-beta.2" />
<PackageVersion Include="OpenTelemetry.Resources.Azure" Version="1.0.0-beta.8" />
<PackageVersion Include="OpenTelemetry.Resources.Container" Version="1.0.0-beta.9" />
<PackageVersion Include="OpenTelemetry.Resources.Host" Version="0.1.0-beta.2" />
<PackageVersion Include="OpenTelemetry.Resources.OperatingSystem" Version="0.1.0-alpha.2" />
<PackageVersion Include="OpenTelemetry.Resources.Host" Version="0.1.0-beta.3" />
<PackageVersion Include="OpenTelemetry.Resources.OperatingSystem" Version="0.1.0-alpha.3" />
<PackageVersion Include="OpenTelemetry.Resources.Process" Version="0.1.0-beta.2" />
<PackageVersion Include="OpenTelemetry.Resources.ProcessRuntime" Version="0.1.0-beta.2" />
</ItemGroup>

View File

@ -55,8 +55,8 @@ void CorProfiler::InitNetFxAssemblyRedirectsMap()
{ L"OpenTelemetry.Instrumentation.SqlClient", {1, 9, 0, 43} },
{ L"OpenTelemetry.Instrumentation.Wcf", {1, 0, 0, 47} },
{ L"OpenTelemetry.Resources.Azure", {1, 0, 0, 52} },
{ L"OpenTelemetry.Resources.Host", {0, 1, 0, 53} },
{ L"OpenTelemetry.Resources.OperatingSystem", {0, 1, 0, 95} },
{ L"OpenTelemetry.Resources.Host", {0, 1, 0, 139} },
{ L"OpenTelemetry.Resources.OperatingSystem", {0, 1, 0, 140} },
{ L"OpenTelemetry.Resources.Process", {0, 1, 0, 55} },
{ L"OpenTelemetry.Resources.ProcessRuntime", {0, 1, 0, 56} },
{ L"OpenTelemetry.Shims.OpenTracing", {1, 0, 0, 0} },

View File

@ -12,6 +12,7 @@ namespace IntegrationTests.Helpers;
public class OtlpResourceExpector : IDisposable
{
private readonly List<ResourceExpectation> _resourceExpectations = new();
private readonly List<string> _existenceChecks = new();
private readonly ManualResetEvent _resourceAttributesEvent = new(false); // synchronizes access to _resourceAttributes
private RepeatedField<KeyValue>? _resourceAttributes; // protobuf type
@ -31,6 +32,11 @@ public class OtlpResourceExpector : IDisposable
}
}
public void Exist(string key)
{
_existenceChecks.Add(key);
}
public void Expect(string key, string value)
{
_resourceExpectations.Add(new ResourceExpectation(key, value));
@ -43,7 +49,7 @@ public class OtlpResourceExpector : IDisposable
public void AssertExpectations(TimeSpan? timeout = null)
{
if (_resourceExpectations.Count == 0)
if (_resourceExpectations.Count == 0 && _existenceChecks.Count == 0)
{
throw new InvalidOperationException("Expectations were not set");
}
@ -58,6 +64,27 @@ public class OtlpResourceExpector : IDisposable
return;
}
if (_resourceAttributes == null)
{
Assert.Fail("No resource attributes have been collected");
}
var message = new StringBuilder();
foreach (var key in _existenceChecks)
{
var keyExists = _resourceAttributes.Any(attr => attr.Key == key);
if (!keyExists)
{
message.AppendLine($"Resource attribute \"{key}\" was not found");
}
}
if (message.Length > 0)
{
Assert.Fail(message.ToString());
}
AssertResource(_resourceExpectations, _resourceAttributes);
}
catch (ArgumentOutOfRangeException)

View File

@ -602,6 +602,7 @@ public class SmokeTests : TestHelper
resourceExpector.Expect("process.pid", processId);
resourceExpector.Expect("host.name", Environment.MachineName);
#if NETFRAMEWORK
resourceExpector.Expect("process.runtime.name", ".NET Framework");
#else
@ -616,6 +617,9 @@ public class SmokeTests : TestHelper
_ => throw new PlatformNotSupportedException($"Unknown platform")
};
resourceExpector.Expect("os.type", expectedPlatform);
resourceExpector.Exist("os.description");
resourceExpector.Exist("os.name");
resourceExpector.Exist("os.version");
}
private void VerifyTestApplicationInstrumented(TestAppStartupMode startupMode = TestAppStartupMode.Auto)