Skip to content

Commit e36e1c4

Browse files
committed
Fix naming of ActivitySource and Meter
1 parent eb74496 commit e36e1c4

8 files changed

+23
-14
lines changed

src/OpenTelemetry.Instrumentation.Kusto/Implementation/KustoActivitySourceHelper.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,16 @@ namespace OpenTelemetry.Instrumentation.Kusto.Implementation;
1414
internal static class KustoActivitySourceHelper
1515
{
1616
public const string DbSystem = "azure.kusto";
17-
public const string ActivitySourceName = "Kusto.Client";
18-
public const string MeterName = "Kusto.Client";
19-
public const string ClientRequestIdTagKey = "kusto.client_request_id";
17+
public const string ClientRequestIdTagKey = $"{DbSystem}.client_request_id";
2018

2119
public static readonly Assembly Assembly = typeof(KustoActivitySourceHelper).Assembly;
20+
public static readonly AssemblyName AssemblyName = Assembly.GetName();
2221
public static readonly string PackageVersion = Assembly.GetPackageVersion();
22+
23+
public static readonly string ActivitySourceName = AssemblyName.Name!;
2324
public static readonly ActivitySource ActivitySource = new(ActivitySourceName, PackageVersion);
25+
26+
public static readonly string MeterName = AssemblyName.Name!;
2427
public static readonly Meter Meter = new(MeterName, PackageVersion);
2528

2629
public static readonly Histogram<double> OperationDurationHistogram = Meter.CreateHistogram(

test/OpenTelemetry.Instrumentation.Kusto.Tests/KustoIntegrationTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,8 @@ private static dynamic FilterActivites(IEnumerable<Activity> activities) =>
321321
.Where(activity => activity.Source == KustoActivitySourceHelper.ActivitySource)
322322
.Select(activity => new
323323
{
324+
ActivitySourceName = activity.Source.Name,
324325
activity.DisplayName,
325-
activity.Source.Name,
326326
activity.Status,
327327
activity.StatusDescription,
328328
activity.TagObjects,
@@ -335,6 +335,7 @@ private static dynamic FilterMetrics(IEnumerable<Metric> metrics) =>
335335
.Where(metric => metric.MeterName == KustoActivitySourceHelper.MeterName)
336336
.Select(metric => new
337337
{
338+
metric.MeterName,
338339
metric.Name,
339340
metric.Description,
340341
metric.MeterTags,

test/OpenTelemetry.Instrumentation.Kusto.Tests/Snapshots/KustoIntegrationTests.FailedQueryTest_query=InvalidTable - take 10_processQuery=False.verified.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
Activities: [
33
{
4+
ActivitySourceName: OpenTelemetry.Instrumentation.Kusto,
45
DisplayName: KD.RestClient.ExecuteQuery,
5-
Name: Kusto.Client,
66
Status: Error,
77
StatusDescription: 'take' operator: Failed to resolve table or column expression named 'InvalidTable',
88
TagObjects: [
99
{
10-
kusto.client_request_id: SW52YWxpZFRhYmxlIHwgdGFrZSAxMA==
10+
azure.kusto.client_request_id: SW52YWxpZFRhYmxlIHwgdGFrZSAxMA==
1111
},
1212
{
1313
error.type: Kusto.Data.Exceptions.SemanticException
@@ -34,6 +34,7 @@
3434
],
3535
Metrics: [
3636
{
37+
MeterName: OpenTelemetry.Instrumentation.Kusto,
3738
Name: db.client.operation.duration,
3839
Description: Duration of database client operations,
3940
Unit: s,

test/OpenTelemetry.Instrumentation.Kusto.Tests/Snapshots/KustoIntegrationTests.FailedQueryTest_query=InvalidTable - take 10_processQuery=True.verified.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
Activities: [
33
{
4+
ActivitySourceName: OpenTelemetry.Instrumentation.Kusto,
45
DisplayName: InvalidTable | take,
5-
Name: Kusto.Client,
66
Status: Error,
77
StatusDescription: 'take' operator: Failed to resolve table or column expression named 'InvalidTable',
88
TagObjects: [
99
{
10-
kusto.client_request_id: SW52YWxpZFRhYmxlIHwgdGFrZSAxMA==
10+
azure.kusto.client_request_id: SW52YWxpZFRhYmxlIHwgdGFrZSAxMA==
1111
},
1212
{
1313
error.type: Kusto.Data.Exceptions.SemanticException
@@ -40,6 +40,7 @@
4040
],
4141
Metrics: [
4242
{
43+
MeterName: OpenTelemetry.Instrumentation.Kusto,
4344
Name: db.client.operation.duration,
4445
Description: Duration of database client operations,
4546
Unit: s,

test/OpenTelemetry.Instrumentation.Kusto.Tests/Snapshots/KustoIntegrationTests.MetricsOnlyTest_query=print number=42.verified.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
Metrics: [
33
{
4+
MeterName: OpenTelemetry.Instrumentation.Kusto,
45
Name: db.client.operation.duration,
56
Description: Duration of database client operations,
67
Unit: s,

test/OpenTelemetry.Instrumentation.Kusto.Tests/Snapshots/KustoIntegrationTests.SuccessfulQueryTest_query=print number=42_processQuery=False.verified.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
Activities: [
33
{
4+
ActivitySourceName: OpenTelemetry.Instrumentation.Kusto,
45
DisplayName: KD.RestClient.ExecuteQuery,
5-
Name: Kusto.Client,
66
Status: Ok,
77
TagObjects: [
88
{
9-
kusto.client_request_id: cHJpbnQgbnVtYmVyPTQy
9+
azure.kusto.client_request_id: cHJpbnQgbnVtYmVyPTQy
1010
},
1111
{
1212
db.system.name: azure.kusto
@@ -30,6 +30,7 @@
3030
],
3131
Metrics: [
3232
{
33+
MeterName: OpenTelemetry.Instrumentation.Kusto,
3334
Name: db.client.operation.duration,
3435
Description: Duration of database client operations,
3536
Unit: s,

test/OpenTelemetry.Instrumentation.Kusto.Tests/Snapshots/KustoIntegrationTests.SuccessfulQueryTest_query=print number=42_processQuery=True.verified.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
Activities: [
33
{
4+
ActivitySourceName: OpenTelemetry.Instrumentation.Kusto,
45
DisplayName: print,
5-
Name: Kusto.Client,
66
Status: Ok,
77
TagObjects: [
88
{
9-
kusto.client_request_id: cHJpbnQgbnVtYmVyPTQy
9+
azure.kusto.client_request_id: cHJpbnQgbnVtYmVyPTQy
1010
},
1111
{
1212
db.system.name: azure.kusto
@@ -36,6 +36,7 @@
3636
],
3737
Metrics: [
3838
{
39+
MeterName: OpenTelemetry.Instrumentation.Kusto,
3940
Name: db.client.operation.duration,
4041
Description: Duration of database client operations,
4142
Unit: s,

test/OpenTelemetry.Instrumentation.Kusto.Tests/Snapshots/KustoIntegrationTests.TraceOnlyTest_query=print number=42.verified.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
Activities: [
33
{
4+
ActivitySourceName: OpenTelemetry.Instrumentation.Kusto,
45
DisplayName: KD.RestClient.ExecuteQuery,
5-
Name: Kusto.Client,
66
Status: Ok,
77
TagObjects: [
88
{
9-
kusto.client_request_id: cHJpbnQgbnVtYmVyPTQy
9+
azure.kusto.client_request_id: cHJpbnQgbnVtYmVyPTQy
1010
},
1111
{
1212
db.system.name: azure.kusto

0 commit comments

Comments
 (0)