Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instrumentation spans and metrcis - set ActivitySource/Meter.Version to NuGet package version #1624

Merged
merged 11 commits into from
Apr 2, 2024
Merged
1 change: 1 addition & 0 deletions opentelemetry-dotnet-contrib.sln
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shared", "Shared", "{1FCC8E
src\Shared\PropertyFetcher.AOT.cs = src\Shared\PropertyFetcher.AOT.cs
src\Shared\ResourceSemanticConventions.cs = src\Shared\ResourceSemanticConventions.cs
src\Shared\SemanticConventions.cs = src\Shared\SemanticConventions.cs
src\Shared\SignalVersionHelper.cs = src\Shared\SignalVersionHelper.cs
src\Shared\SpanAttributeConstants.cs = src\Shared\SpanAttributeConstants.cs
src\Shared\SpanHelper.cs = src\Shared\SpanHelper.cs
EndProjectSection
Expand Down
2 changes: 2 additions & 0 deletions src/OpenTelemetry.Instrumentation.AWS/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

* BREAKING: Switched AWSServiceName tag to use ServiceId instead of ServiceName
([#1572](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1572))
* `ActivitySource.Version` is set to NuGet package version.
([#1624](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1624))

## 1.1.0-beta.3

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ internal sealed class AWSTracingPipelineHandler : PipelineHandler
{
internal const string ActivitySourceName = "Amazon.AWS.AWSClientInstrumentation";

private static readonly ActivitySource AWSSDKActivitySource = new(ActivitySourceName);
private static readonly ActivitySource AWSSDKActivitySource = new(ActivitySourceName, SignalVersionHelper.GetVersion<AWSTracingPipelineHandler>());

private readonly AWSClientInstrumentationOptions options;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
</ItemGroup>

<ItemGroup>
<Compile Include="$(RepoRoot)\src\Shared\SignalVersionHelper.cs" Link="Includes\SignalVersionHelper.cs" />
<Compile Include="$(RepoRoot)\src\Shared\Guard.cs" Link="Includes\Guard.cs" />
<Compile Include="$(RepoRoot)\src\Shared\SemanticConventions.cs" Link="Includes\SemanticConventions.cs"/>
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using Amazon.Lambda.Core;
using OpenTelemetry.Instrumentation.AWSLambda.Implementation;
Expand All @@ -21,8 +20,7 @@ public static class AWSLambdaWrapper
{
internal const string ActivitySourceName = "OpenTelemetry.Instrumentation.AWSLambda";

private static readonly string Version = typeof(AWSLambdaWrapper).Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()!.InformationalVersion.Split('+')[0];
private static readonly ActivitySource AWSLambdaActivitySource = new(ActivitySourceName, Version);
private static readonly ActivitySource AWSLambdaActivitySource = new(ActivitySourceName, SignalVersionHelper.GetVersion<AWSLambdaInstrumentationOptions>());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any particular reason for changing the type from which we query the assembly? It should not make a difference, but the minimal change would have been:

Suggested change
private static readonly ActivitySource AWSLambdaActivitySource = new(ActivitySourceName, SignalVersionHelper.GetVersion<AWSLambdaInstrumentationOptions>());
private static readonly ActivitySource AWSLambdaActivitySource = new(ActivitySourceName, SignalVersionHelper.GetVersion<AWSLambdaWrapper>());

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have started with this :)

`OpenTelemetry.Instrumentation.AWSLambda.AWSLambdaWrapper': static class type cannot be used as type arguments


/// <summary>
/// Gets or sets a value indicating whether AWS X-Ray propagation should be ignored. Default value is false.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
</ItemGroup>

<ItemGroup>
<Compile Include="$(RepoRoot)\src\Shared\SignalVersionHelper.cs" Link="Includes\SignalVersionHelper.cs" />
<Compile Include="$(RepoRoot)\src\Shared\Guard.cs" Link="Includes\Guard.cs" />
<Compile Include="$(RepoRoot)\src\Shared\SemanticConventions.cs" Link="Includes\SemanticConventions.cs"/>
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ internal static class ActivityHelper
private static readonly Func<HttpRequest, string, IEnumerable<string>> HttpRequestHeaderValuesGetter = (request, name) => request.Headers.GetValues(name);
private static readonly ActivitySource AspNetSource = new(
TelemetryHttpModule.AspNetSourceName,
typeof(ActivityHelper).Assembly.GetName().Version.ToString());
SignalVersionHelper.GetVersion<AspNetTelemetryEventSource>());

/// <summary>
/// Try to get the started <see cref="Activity"/> for the running <see
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

* `Meter.Version` is set to NuGet package version.
([#1624](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1624))

## 1.7.0-beta.2

Released 2024-Feb-07
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
</PropertyGroup>

<ItemGroup>
<Compile Include="$(RepoRoot)\src\Shared\SignalVersionHelper.cs" Link="Includes\SignalVersionHelper.cs" />
<Compile Include="$(RepoRoot)\src\Shared\ExceptionExtensions.cs" Link="Includes\ExceptionExtensions.cs" />
<Compile Include="$(RepoRoot)\src\Shared\Guard.cs" Link="Includes\Guard.cs" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ internal sealed class AspNetMetrics : IDisposable
{
internal static readonly AssemblyName AssemblyName = typeof(HttpInMetricsListener).Assembly.GetName();
internal static readonly string InstrumentationName = AssemblyName.Name;
internal static readonly string InstrumentationVersion = AssemblyName.Version.ToString();
internal static readonly string InstrumentationVersion = SignalVersionHelper.GetVersion<AspNetMetrics>();

private readonly Meter meter;

Expand Down
2 changes: 2 additions & 0 deletions src/OpenTelemetry.Instrumentation.AspNet/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
* `url.scheme` added with `http` or `https` value,
* `user_agent.original` replaces `http.user_agent`.
([#1607](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1607))
* `ActivitySource.Version` is set to NuGet package version.
([#1624](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1624))

## 1.7.0-beta.2

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
</ItemGroup>

<ItemGroup>
<Compile Include="$(RepoRoot)\src\Shared\SignalVersionHelper.cs" Link="Includes\SignalVersionHelper.cs" />
<Compile Include="$(RepoRoot)\src\Shared\ExceptionExtensions.cs" Link="Includes\ExceptionExtensions.cs" />
<Compile Include="$(RepoRoot)\src\Shared\Guard.cs" Link="Includes\Guard.cs" />
<Compile Include="$(RepoRoot)\src\Shared\PropertyFetcher.AOT.cs" Link="Includes\PropertyFetcher.AOT.cs" />
Expand Down
2 changes: 2 additions & 0 deletions src/OpenTelemetry.Instrumentation.Cassandra/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

* Update OpenTelemetry SDK version to `1.7.0`.
([#1486](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1486))
* `ActivitySource.Version` is set to NuGet package version.
([#1624](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1624))

## 1.0.0-beta.1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ namespace OpenTelemetry.Instrumentation.Cassandra;

internal static class CassandraMeter
{
public static Meter Instance => new Meter(typeof(CassandraMeter).Assembly.GetName().Name);
public static Meter Instance => new Meter(typeof(CassandraMeter).Assembly.GetName().Name, SignalVersionHelper.GetVersion<DriverTimer>());
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
</ItemGroup>

<ItemGroup>
<Compile Include="$(RepoRoot)\src\Shared\SignalVersionHelper.cs" Link="Includes\SignalVersionHelper.cs" />
<Compile Include="$(RepoRoot)\src\Shared\Guard.cs" Link="Includes\Guard.cs" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
([#1486](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1486))
* Span status is set based on [semantic convention for client spans](https://github.com/open-telemetry/semantic-conventions/blob/v1.24.0/docs/http/http-spans.md#status).
([#1538](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1538))
* `ActivitySource.Version` is set to NuGet package version.
([#1624](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1624))

## 1.0.0-beta.5

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ internal class ElasticsearchRequestPipelineDiagnosticListener : ListenerHandler

internal static readonly AssemblyName AssemblyName = typeof(ElasticsearchRequestPipelineDiagnosticListener).Assembly.GetName();
internal static readonly string ActivitySourceName = AssemblyName.Name;
internal static readonly Version Version = AssemblyName.Version;
internal static readonly ActivitySource ActivitySource = new ActivitySource(ActivitySourceName, Version.ToString());
internal static readonly ActivitySource ActivitySource = new(ActivitySourceName, SignalVersionHelper.GetVersion<ElasticsearchRequestPipelineDiagnosticListener>());

private static readonly Regex ParseRequest = new Regex(@"\n# Request:\r?\n(\{.*)\n# Response", RegexOptions.Compiled | RegexOptions.Singleline);
private static readonly ConcurrentDictionary<object, string> MethodNameCache = new ConcurrentDictionary<object, string>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
</ItemGroup>

<ItemGroup>
<Compile Include="$(RepoRoot)\src\Shared\SignalVersionHelper.cs" Link="Includes\SignalVersionHelper.cs" />
<Compile Include="$(RepoRoot)\src\Shared\DiagnosticSourceListener.cs" Link="Includes\DiagnosticSourceListener.cs" />
<Compile Include="$(RepoRoot)\src\Shared\DiagnosticSourceSubscriber.cs" Link="Includes\DiagnosticSourceSubscriber.cs" />
<Compile Include="$(RepoRoot)\src\Shared\ActivityInstrumentationHelper.cs" Link="Includes\ActivityInstrumentationHelper.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Released 2024-Feb-07
* **Breaking Change**: Stop emitting `db.statement_type` attribute.
This attribute never was part of the [semantic convention](https://github.com/open-telemetry/semantic-conventions/blob/v1.24.0/docs/database/database-spans.md#call-level-attributes).
([#1559](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1559))
* `ActivitySource.Version` is set to NuGet package version.
([#1624](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1624))

## 1.0.0-beta.9

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ internal sealed class EntityFrameworkDiagnosticListener : ListenerHandler
internal static readonly string ActivitySourceName = typeof(EntityFrameworkDiagnosticListener).Assembly.GetName().Name;
internal static readonly string ActivityName = ActivitySourceName + ".Execute";

private static readonly Version Version = typeof(EntityFrameworkDiagnosticListener).Assembly.GetName().Version;
#pragma warning disable SA1202 // Elements should be ordered by access <- In this case, Version MUST come before SqlClientActivitySource otherwise null ref exception is thrown.
internal static readonly ActivitySource SqlClientActivitySource = new(ActivitySourceName, Version.ToString());
internal static readonly ActivitySource SqlClientActivitySource = new(ActivitySourceName, SignalVersionHelper.GetVersion<EntityFrameworkDiagnosticListener>());
#pragma warning restore SA1202 // Elements should be ordered by access

private readonly PropertyFetcher<object> commandFetcher = new("Command");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
</ItemGroup>

<ItemGroup>
<Compile Include="$(RepoRoot)\src\Shared\SignalVersionHelper.cs" Link="Includes\SignalVersionHelper.cs" />
<Compile Include="$(RepoRoot)\src\Shared\DiagnosticSourceListener.cs" Link="Includes\DiagnosticSourceListener.cs" />
<Compile Include="$(RepoRoot)\src\Shared\DiagnosticSourceSubscriber.cs" Link="Includes\DiagnosticSourceSubscriber.cs" />
<Compile Include="$(RepoRoot)\src\Shared\ExceptionExtensions.cs" Link="Includes\ExceptionExtensions.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

* Update `OpenTelemetry.Api` to `1.7.0`.
([#1486](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1486))
* `Meter.Version` is set to NuGet package version.
([#1624](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1624))

## 1.5.1-alpha.1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace OpenTelemetry.Instrumentation.EventCounters;
/// </summary>
internal sealed class EventCountersMetrics : EventListener
{
internal static readonly Meter MeterInstance = new(typeof(EventCountersMetrics).Assembly.GetName().Name, typeof(EventCountersMetrics).Assembly.GetName().Version.ToString());
internal static readonly Meter MeterInstance = new(typeof(EventCountersMetrics).Assembly.GetName().Name, SignalVersionHelper.GetVersion<EventCountersMetrics>());

private const string Prefix = "ec";
private const int MaxInstrumentNameLength = 63;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
</ItemGroup>

<ItemGroup>
<Compile Include="$(RepoRoot)\src\Shared\SignalVersionHelper.cs" Link="Includes\SignalVersionHelper.cs" />
<Compile Include="$(RepoRoot)\src\Shared\Guard.cs" Link="Includes\Guard.cs" />
</ItemGroup>
</Project>
2 changes: 2 additions & 0 deletions src/OpenTelemetry.Instrumentation.GrpcCore/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
([#1456](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1456))
* Update `OpenTelemetry.Api` to `1.7.0`.
([#1486](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1486))
* `ActivitySource.Version` is set to NuGet package version.
([#1624](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1624))

## 1.0.0-beta.5

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

using System;
using System.Diagnostics;
using System.Reflection;

Expand All @@ -22,13 +21,8 @@ internal static class GrpcCoreInstrumentation
/// </summary>
internal static readonly string ActivitySourceName = AssemblyName.Name;

/// <summary>
/// The version.
/// </summary>
internal static readonly Version Version = AssemblyName.Version;

/// <summary>
/// The activity source.
/// </summary>
internal static readonly ActivitySource ActivitySource = new ActivitySource(ActivitySourceName, Version.ToString());
internal static readonly ActivitySource ActivitySource = new(ActivitySourceName, SignalVersionHelper.GetVersion<ServerTracingInterceptorOptions>());
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
</ItemGroup>

<ItemGroup>
<Compile Include="$(RepoRoot)\src\Shared\SignalVersionHelper.cs" Link="Includes\SignalVersionHelper.cs" />
<Compile Include="$(RepoRoot)\src\Shared\Guard.cs" Link="Includes\Guard.cs" />
</ItemGroup>
</Project>
2 changes: 2 additions & 0 deletions src/OpenTelemetry.Instrumentation.Hangfire/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* Update `OpenTelemetry.Api.ProviderBuilderExtensions` to `1.7.0`.
* Update `OpenTelemetry.Api` to `1.7.0`.
([#1508](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1508))
* `ActivitySource.Version` is set to NuGet package version.
([#1624](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1624))

## 1.6.0-beta.1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,10 @@ internal sealed class HangfireInstrumentation
/// </summary>
internal static readonly string ActivitySourceName = AssemblyName.Name;

/// <summary>
/// The version.
/// </summary>
internal static readonly Version Version = AssemblyName.Version;

/// <summary>
/// The activity source.
/// </summary>
internal static readonly ActivitySource ActivitySource = new(ActivitySourceName, Version.ToString());
internal static readonly ActivitySource ActivitySource = new(ActivitySourceName, SignalVersionHelper.GetVersion<HangfireInstrumentationOptions>());

/// <summary>
/// The default display name delegate.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<PackageReference Include="OpenTelemetry.Api.ProviderBuilderExtensions" Version="$(OpenTelemetryCoreLatestVersion)" />
</ItemGroup>
<ItemGroup>
<Compile Include="$(RepoRoot)\src\Shared\SignalVersionHelper.cs" Link="Includes\SignalVersionHelper.cs" />
<Compile Include="$(RepoRoot)\src\Shared\Guard.cs" Link="Includes\Guard.cs" />
</ItemGroup>
</Project>
3 changes: 3 additions & 0 deletions src/OpenTelemetry.Instrumentation.Owin/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

* `ActivitySource.Version` and `Meter.Version` are set to NuGet package version.
([#1624](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1624))

## 1.0.0-rc.4

Released 2024-Mar-20
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

using System;
using System.Diagnostics;
using System.Reflection;

Expand All @@ -13,9 +12,7 @@ internal static class OwinInstrumentationActivitySource
internal static readonly string ActivitySourceName = AssemblyName.Name;
internal static readonly string IncomingRequestActivityName = ActivitySourceName + ".IncomingRequest";

private static readonly Version Version = AssemblyName.Version;

public static ActivitySource ActivitySource { get; } = new(ActivitySourceName, Version.ToString());
public static ActivitySource ActivitySource { get; } = new(ActivitySourceName, SignalVersionHelper.GetVersion<OwinInstrumentationOptions>());

public static OwinInstrumentationOptions? Options { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ internal static class OwinInstrumentationMetrics

public static string MeterName => AssemblyName.Name;

public static Meter Instance => new Meter(MeterName, AssemblyName.Version.ToString());
public static Meter Instance => new(MeterName, SignalVersionHelper.GetVersion<OwinInstrumentationOptions>());

public static Histogram<double> HttpServerDuration => Instance.CreateHistogram<double>("http.server.request.duration", "s", "Duration of HTTP server requests.");
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
</PropertyGroup>

<ItemGroup>
<Compile Include="$(RepoRoot)\src\Shared\SignalVersionHelper.cs" Link="Includes\SignalVersionHelper.cs" />
<Compile Include="$(RepoRoot)\src\Shared\ExceptionExtensions.cs" Link="Includes\ExceptionExtensions.cs" />
<Compile Include="$(RepoRoot)\src\Shared\Guard.cs" Link="Includes\Guard.cs" />
<Compile Include="$(RepoRoot)\src\Shared\SemanticConventions.cs" Link="Includes\SemanticConventions.cs"/>
Expand Down
3 changes: 3 additions & 0 deletions src/OpenTelemetry.Instrumentation.Process/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

* `Meter.Version` is set to NuGet package version.
([#1624](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1624))

## 0.5.0-beta.4

Released 2024-Jan-03
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
</ItemGroup>

<ItemGroup>
<Compile Include="$(RepoRoot)\src\Shared\SignalVersionHelper.cs" Link="Includes\SignalVersionHelper.cs" />
<Compile Include="$(RepoRoot)\src\Shared\Guard.cs" Link="Includes\Guard.cs" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ internal sealed class ProcessMetrics
internal static readonly AssemblyName AssemblyName = typeof(ProcessMetrics).Assembly.GetName();
internal static readonly string MeterName = AssemblyName.Name;

private static readonly Meter MeterInstance = new(MeterName, AssemblyName.Version.ToString());
private static readonly Meter MeterInstance = new(MeterName, SignalVersionHelper.GetVersion<ProcessMetrics>());

static ProcessMetrics()
{
Expand Down
3 changes: 3 additions & 0 deletions src/OpenTelemetry.Instrumentation.Quartz/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

* `ActivitySource.Version` is set to NuGet package version.
([#1624](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1624))

## 1.0.0-beta.1

Released 2024-Jan-03
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ internal sealed class QuartzDiagnosticListener : ListenerHandler
{
internal static readonly AssemblyName AssemblyName = typeof(QuartzDiagnosticListener).Assembly.GetName();
internal static readonly string ActivitySourceName = AssemblyName.Name;
internal static readonly Version Version = AssemblyName.Version;
internal static readonly ActivitySource ActivitySource = new(ActivitySourceName, Version.ToString());
internal static readonly ActivitySource ActivitySource = new(ActivitySourceName, SignalVersionHelper.GetVersion<QuartzDiagnosticListener>());
internal readonly PropertyFetcher<object> JobDetailsPropertyFetcher = new("JobDetail");

private readonly QuartzInstrumentationOptions options;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
</ItemGroup>

<ItemGroup>
<Compile Include="$(RepoRoot)\src\Shared\SignalVersionHelper.cs" Link="Includes\SignalVersionHelper.cs" />
<Compile Include="$(RepoRoot)\src\Shared\ActivityInstrumentationHelper.cs" Link="Includes\ActivityInstrumentationHelper.cs" />
<Compile Include="$(RepoRoot)\src\Shared\DiagnosticSourceListener.cs" Link="Includes\DiagnosticSourceListener.cs" />
<Compile Include="$(RepoRoot)\src\Shared\DiagnosticSourceSubscriber.cs" Link="Includes\DiagnosticSourceSubscriber.cs" />
Expand Down
Loading
Loading