-
-
Notifications
You must be signed in to change notification settings - Fork 469
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Complete the implementation of the EventTracingConnectionLifetime cla…
…ss and supporting classes.
- Loading branch information
1 parent
7fdc788
commit 9abe946
Showing
4 changed files
with
251 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using System.Collections.Generic; | ||
using System.Diagnostics; | ||
|
||
namespace Marten.Internal.OpenTelemetry; | ||
|
||
internal static class MartenTracing | ||
{ | ||
// See https://opentelemetry.io/docs/reference/specification/trace/semantic_conventions/messaging/ for more information | ||
public static string MartenTenantId = "MartenTentantId"; | ||
public static string MartenCorelationId = "MartenCorelationId"; | ||
|
||
internal static ActivitySource ActivitySource { get; } = new( | ||
"Marten", | ||
typeof(MartenTracing).Assembly.GetName().Version!.ToString()); | ||
|
||
public static Activity? StartConnectionActivity(Activity? parentActivity =null, IEnumerable<KeyValuePair<string, object?>>? tags =null) | ||
Check warning on line 16 in src/Marten/Internal/OpenTelemetry/MartenTracing.cs
|
||
{ | ||
return StartActivity("connection", parentActivity, tags); | ||
} | ||
|
||
public static Activity StartActivity(string spanName, Activity? parentActivity =null, IEnumerable<KeyValuePair<string, object?>>? tags =null, ActivityKind activityKind =ActivityKind.Internal) | ||
{ | ||
return ActivitySource.CreateActivity(spanName, activityKind, parentActivity?.ParentId, tags); | ||
} | ||
} |
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