Fix resource attribute telemetry.sdk.version (#1754)
This commit is contained in:
parent
dfd8ca0f79
commit
ac6689c243
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue