-
Notifications
You must be signed in to change notification settings - Fork 283
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Instrumentation.GrpcCore] Use shared semantic conventions (#1917)
- Loading branch information
1 parent
222818f
commit 02a7ddf
Showing
11 changed files
with
77 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 0 additions & 30 deletions
30
src/OpenTelemetry.Instrumentation.GrpcCore/SemanticConventions.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
test/OpenTelemetry.Instrumentation.GrpcCore.Tests/TestActivityTags.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Copyright The OpenTelemetry Authors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Diagnostics; | ||
using System.Linq; | ||
using OpenTelemetry.Internal; | ||
|
||
namespace OpenTelemetry.Instrumentation.GrpcCore.Tests; | ||
|
||
internal class TestActivityTags | ||
{ | ||
public const string ActivityIdentifierTag = "activityidentifier"; | ||
|
||
public TestActivityTags() | ||
{ | ||
this.Tags = new Dictionary<string, object>() | ||
{ | ||
[ActivityIdentifierTag] = Guid.NewGuid(), | ||
}; | ||
} | ||
|
||
internal IReadOnlyDictionary<string, object> Tags { get; } | ||
|
||
/// <summary> | ||
/// Checks whether the activity has test tags. | ||
/// </summary> | ||
/// <param name="activity">The activity.</param> | ||
/// <returns>Returns true if the activty has test tags, false otherwise.</returns> | ||
internal bool HasTestTags(Activity activity) | ||
{ | ||
Guard.ThrowIfNull(activity); | ||
|
||
return this.Tags | ||
.Select(tag => activity.TagObjects.Any(t => t.Key == tag.Key && t.Value == tag.Value)) | ||
.All(v => v); | ||
} | ||
} |