-
-
Notifications
You must be signed in to change notification settings - Fork 203
/
NoOpSpan.cs
81 lines (63 loc) · 1.78 KB
/
NoOpSpan.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
using Sentry.Protocol;
namespace Sentry.Internal;
/// <summary>
/// Span class to use when we can't return null but a request to create a span couldn't be completed.
/// </summary>
internal class NoOpSpan : ISpan
{
public static ISpan Instance { get; } = new NoOpSpan();
protected NoOpSpan()
{
}
public SpanId SpanId => SpanId.Empty;
public SpanId? ParentSpanId => SpanId.Empty;
public SentryId TraceId => SentryId.Empty;
public bool? IsSampled => default;
public IReadOnlyDictionary<string, string> Tags => ImmutableDictionary<string, string>.Empty;
public IReadOnlyDictionary<string, object?> Extra => ImmutableDictionary<string, object?>.Empty;
public DateTimeOffset StartTimestamp => default;
public DateTimeOffset? EndTimestamp => default;
public bool IsFinished => default;
public string Operation
{
get => string.Empty;
set { }
}
public string? Description
{
get => default;
set { }
}
public SpanStatus? Status
{
get => default;
set { }
}
public ISpan StartChild(string operation) => this;
public void Finish()
{
}
public void Finish(SpanStatus status)
{
}
public void Finish(Exception exception, SpanStatus status)
{
}
public void Finish(Exception exception)
{
}
public void SetTag(string key, string value)
{
}
public void UnsetTag(string key)
{
}
public void SetExtra(string key, object? value)
{
}
public SentryTraceHeader GetTraceHeader() => SentryTraceHeader.Empty;
public IReadOnlyDictionary<string, Measurement> Measurements => ImmutableDictionary<string, Measurement>.Empty;
public void SetMeasurement(string name, Measurement measurement)
{
}
}