-
Notifications
You must be signed in to change notification settings - Fork 303
Incorporating TagMap into the tracer #8589
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
5be81ef
6eefbca
81d3da6
ca7b135
a570c4d
a5e62cf
b5cb015
b13d557
371bf18
32d5849
c252e7b
468aee6
e58d8ee
93c8d08
b489ce9
6b01cb3
4d36dba
b9238c8
00adef8
4ae0c52
fae5b14
376d623
55beae5
096a565
b208ce1
616e55d
06c5575
ce2792a
fe44114
ad8228b
97bbb2c
d296a7a
b5ce9a7
ed3b5a8
fd45d8d
456ef66
3d89c07
ad2ede7
713be83
f94ffbc
99cf6c5
6d487ec
50c367f
e7c6c26
e474365
c4f4a00
77eba45
d3cc062
2c8c3ff
cae4880
b0e0a88
db83248
6168fec
12f97b7
6f41151
b1ddc8d
fd610ca
2413e1d
5ff6f8f
d3b4a0e
433650d
1915fd6
6335a47
c502dc3
f7eee67
5e15723
34ed23d
93cb23a
a4aaa71
63b5a2e
6bd0655
04c48d8
e3d1faf
24af078
c5aa244
266b36d
176846f
0c324b1
3487052
f6a5794
a395a5d
8612213
9f610f9
648c15c
ee432c9
96422cf
1c0b641
fe96451
a37b6f8
b258b90
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,7 +44,6 @@ | |
import datadog.trace.civisibility.test.ExecutionResults; | ||
import java.lang.reflect.Method; | ||
import java.util.Collection; | ||
import java.util.Collections; | ||
import java.util.function.Consumer; | ||
import javax.annotation.Nonnull; | ||
import javax.annotation.Nullable; | ||
|
@@ -101,8 +100,7 @@ public TestImpl( | |
|
||
this.context = new TestContextImpl(coverageStore); | ||
|
||
AgentSpanContext traceContext = | ||
new TagContext(CIConstants.CIAPP_TEST_ORIGIN, Collections.emptyMap()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same mutable empty Map issue |
||
AgentSpanContext traceContext = new TagContext(CIConstants.CIAPP_TEST_ORIGIN, null); | ||
AgentTracer.SpanBuilder spanBuilder = | ||
AgentTracer.get() | ||
.buildSpan(CI_VISIBILITY_INSTRUMENTATION_NAME, testDecorator.component() + ".test") | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,7 @@ | |
import com.datadog.debugger.util.ExceptionHelper; | ||
import com.datadog.debugger.util.TestSnapshotListener; | ||
import datadog.trace.api.Config; | ||
import datadog.trace.api.TagMap; | ||
import datadog.trace.bootstrap.debugger.CapturedContext; | ||
import datadog.trace.bootstrap.debugger.CapturedStackFrame; | ||
import datadog.trace.bootstrap.debugger.MethodLocation; | ||
|
@@ -41,7 +42,6 @@ | |
import java.util.ArrayList; | ||
import java.util.Arrays; | ||
import java.util.Deque; | ||
import java.util.HashMap; | ||
import java.util.HashSet; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
@@ -57,7 +57,7 @@ public class DefaultExceptionDebuggerTest { | |
private ConfigurationUpdater configurationUpdater; | ||
private DefaultExceptionDebugger exceptionDebugger; | ||
private TestSnapshotListener listener; | ||
private Map<String, Object> spanTags = new HashMap<>(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the primary type of change that I've made throughout -- replacing HashMaps with TagMap-s. |
||
private TagMap spanTags = TagMap.create(); | ||
|
||
@BeforeEach | ||
public void setUp() { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have mixed feelings about this particular change. In effect, the constructor previously required the user to pass a mutable map. However if the provided Map was empty, the class would lazily construction a mutable Map to take place of the empty Map.
Because TagMap does not have an O(1) isEmpty, I didn't want to stick with this pattern.
What could be done instead is to pass TagMap.EMPTY and then check via a reference equality check. If others prefer that, I can adjust accordingly.