Fix resource attribute telemetry.sdk.version (#1754)

This commit is contained in:
Cijo Thomas 2021-01-29 14:42:47 -08:00 committed by GitHub
parent dfd8ca0f79
commit ac6689c243
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -39,6 +39,7 @@
* Metrics removed as it is not part 1.0.0 release. See issue
[#1501](https://github.com/open-telemetry/opentelemetry-dotnet/pull/1655)
for details on Metric release plans.
* Fix Resource attribute telemetry.sdk.version to have correct file version.
## 1.0.0-rc1.1

View File

@ -16,6 +16,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
namespace OpenTelemetry.Resources
{
@ -24,13 +25,13 @@ namespace OpenTelemetry.Resources
/// </summary>
public static class ResourceBuilderExtensions
{
private static readonly Version Version = typeof(Resource).Assembly.GetName().Version;
private static readonly string FileVersion = FileVersionInfo.GetVersionInfo(typeof(Resource).Assembly.Location).FileVersion;
private static Resource TelemetryResource { get; } = new Resource(new Dictionary<string, object>
{
[ResourceSemanticConventions.AttributeTelemetrySdkName] = "opentelemetry",
[ResourceSemanticConventions.AttributeTelemetrySdkLanguage] = "dotnet",
[ResourceSemanticConventions.AttributeTelemetrySdkVersion] = Version.ToString(),
[ResourceSemanticConventions.AttributeTelemetrySdkVersion] = FileVersion,
});
/// <summary>