-
Notifications
You must be signed in to change notification settings - Fork 352
Expand file tree
/
Copy pathSpanProbe.java
More file actions
81 lines (72 loc) · 2.43 KB
/
Copy pathSpanProbe.java
File metadata and controls
81 lines (72 loc) · 2.43 KB
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
package com.datadog.debugger.probe;
import com.datadog.debugger.agent.Generated;
import com.datadog.debugger.instrumentation.DiagnosticMessage;
import com.datadog.debugger.instrumentation.InstrumentationResult;
import com.datadog.debugger.instrumentation.MethodInfo;
import com.datadog.debugger.instrumentation.SpanInstrumentor;
import datadog.trace.bootstrap.debugger.MethodLocation;
import datadog.trace.bootstrap.debugger.ProbeId;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
public class SpanProbe extends ProbeDefinition {
// no-arg constructor is required by Moshi to avoid creating instance with unsafe and by-passing
// constructors, including field initializers.
public SpanProbe() {
this(LANGUAGE, null, null, null);
}
public SpanProbe(String language, ProbeId probeId, String[] tagStrs, Where where) {
super(language, probeId, tagStrs, where, MethodLocation.DEFAULT);
}
@Override
public InstrumentationResult.Status instrument(
MethodInfo methodInfo, List<DiagnosticMessage> diagnostics, List<ProbeId> probeIds) {
return new SpanInstrumentor(this, methodInfo, diagnostics, probeIds).instrument();
}
@Generated
@Override
public int hashCode() {
int result = Objects.hash(language, id, version, tagMap, where, evaluateAt);
result = 31 * result + Arrays.hashCode(tags);
return result;
}
@Generated
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
SpanProbe that = (SpanProbe) o;
return Objects.equals(language, that.language)
&& Objects.equals(id, that.id)
&& version == that.version
&& Arrays.equals(tags, that.tags)
&& Objects.equals(tagMap, that.tagMap)
&& Objects.equals(where, that.where)
&& Objects.equals(evaluateAt, that.evaluateAt);
}
@Generated
@Override
public String toString() {
return "SpanProbe{"
+ "id='"
+ id
+ '\''
+ ", version="
+ version
+ ", tags="
+ Arrays.toString(tags)
+ ", where="
+ where
+ ", evaluateAt="
+ evaluateAt
+ "} ";
}
public static SpanProbe.Builder builder() {
return new SpanProbe.Builder();
}
public static class Builder extends ProbeDefinition.Builder<Builder> {
public SpanProbe build() {
return new SpanProbe(LANGUAGE, probeId, tagStrs, where);
}
}
}