-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTelemetry.cs
38 lines (30 loc) · 1.42 KB
/
Telemetry.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using System.Diagnostics;
using System.Diagnostics.Metrics;
namespace DataCore.Adapter.Diagnostics {
/// <summary>
/// Defines telemetry-related properties.
/// </summary>
public static class Telemetry {
/// <summary>
/// The name of the library's <see cref="ActivitySource"/>, <see cref="Meter"/> and
/// <see cref="EventSource"/>.
/// </summary>
public const string DiagnosticSourceName = "IntelligentPlant.AppStoreConnect.Adapter";
/// <summary>
/// Version number to use for <see cref="ActivitySource"/> and <see cref="Meter"/>.
/// </summary>
private static readonly string s_telemetryVersion = typeof(Telemetry).Assembly.GetName().Version.ToString(3);
/// <summary>
/// The <see cref="System.Diagnostics.ActivitySource"/> for the library.
/// </summary>
public static ActivitySource ActivitySource { get; } = new ActivitySource(DiagnosticSourceName, s_telemetryVersion);
/// <summary>
/// The <see cref="System.Diagnostics.Metrics.Meter"/> for the library.
/// </summary>
public static Meter Meter { get; } = new Meter(DiagnosticSourceName, s_telemetryVersion);
/// <summary>
/// The <see cref="System.Diagnostics.Tracing.EventSource"/> for the library.
/// </summary>
public static AdapterEventSource EventSource { get; } = AdapterEventSource.Log;
}
}