Commit Graph

341 Commits

Author SHA1 Message Date
Laplie Anderson 7920a25b7e
Merge pull request #1152 from DataDog/landerson/decorator-flag
Disable decorators via config
2019-12-20 11:09:21 -05:00
Tyler Benson ad22bd9cfc
Merge pull request #1150 from DataDog/tyler/fix-disruptor-shutdown
Allow flush to return if executor already shut down
2019-12-19 16:12:02 -08:00
Laplie Anderson 712a5c1483 Disable decorators via config 2019-12-19 13:02:59 -05:00
Tyler Benson 25d0d98dff Allow flush to return if executor already shut down
Otherwise it could block shutdown if executor is stopped before disruptor.
2019-12-18 14:23:46 -08:00
Tyler Benson 31b77cbd7b Capture error message even if no exception object provided.
This is currently only used by the GoogleHttpClient instrumentation, but may be used by customers too.
2019-12-18 13:49:24 -08:00
Douglas Q Hawkins 7b2c2e8c78
Merge pull request #1125 from DataDog/dougqh/service-decorator-ordering
Ordering inconistency with DDSpanBuilder.withTag
2019-12-12 10:33:07 -05:00
Douglas Q Hawkins e9e3b375b9
Merge pull request #1132 from DataDog/dougqh/bounded-sender-queue
Restricting sender queue size
2019-12-12 10:30:59 -05:00
dougqh ec27930d26 Ordering inconistency with DDSpanBuilder.withTag
Pior to this change, DDSpanBuilder.withTag behaves different than DDSpan.setTag when decorators are triggered.

Specifically builder.withTag(a, val).withTag(b, val) can behave differently than span.setTag(a, val); span.setTag(b, val)

This change makes a small step towards determinism by changing the HashMap inside DDSpanBuilder into a LinkedHashMap.  That guarantees the tags from withTags translated to the same sequence of setTag calls.

NOTE: Even with this change, there are inconsistencies when tags are removed or set to an empty value.
2019-12-11 20:11:58 -05:00
dougqh e604d9164c Adding monitor call back on interrupt
Adding call to monitor.onFailedSend in case senderSemaphore acquisition is interrupted during shutdown
2019-12-11 14:29:09 -05:00
Cecile terpin 073e4bbed5
Empty proc file is not an error
Empty proc file is not an error
2019-12-11 16:35:42 +01:00
Cecile terpin ce0d09f04a
AllowUstoGetContainerInfoOnDocker
Tested on docker. Although "/proc/self/cgroup" file is not empty, "/proc/self/cgroup".toFile().length() returns 0
as does Files.size("/proc/self/cgroup").
2019-12-11 14:27:23 +01:00
dougqh c614df7382 Lowering expectedRejects to account for timing variance in test 2019-12-10 16:11:56 -05:00
dougqh aa54dab853 Switching forEach -> each to fix Java 7 2019-12-10 16:11:56 -05:00
dougqh 53eacfdc79 Improving test reliability
Improving the reliability of the slow sender test.

Still needs work, but to make this truly reliable, I'd need to add to the DDAgentWriter API.  I'll probably do that, but I'm trying to start with sticking to the existing API.
2019-12-10 16:11:56 -05:00
dougqh 7883366b83 Restricting sender queue size
To prevent unbounded memory consumption, restricting the size of the sender queue.  Also, lowering the size of the Disruptor queue.

Unfortunately, our choice of a ScheduledExecutorService makes this a bit difficult, since ScheduledExecutorService doesn't allow us to supply the queue.

A bigger change is in-order but for now, this change restricts the queue size by introducing a Semaphore around the ScheduledExecutorService.

In effort to making testing easier, I introduced Monitor.onFlush.  This is used in the new slow response test which attempts to simulate a situation where the sending queue would back up.
2019-12-10 16:11:56 -05:00
Laplie Anderson 83e78fb8f0 Rename KnuthSampler to DeterministicSampler 2019-11-22 13:53:47 -05:00
Zachary Groves c4cebc30c8
Merge pull request #1097 from DataDog/ZStriker19/remove_duplicate_okhttp_span_and_okhttp_separate_service
Remove duplicate Okhttp span and stop separate service creation of ok…
2019-11-20 17:01:18 -06:00
Laplie Anderson 5ff2fcaa63 Fix tests, increase code coverage, codenarc 2019-11-18 23:39:03 -05:00
Laplie Anderson 9d850b8ef5 Default sampler priority is null 2019-11-18 17:21:17 -05:00
Laplie Anderson 3144d02615 Tests around PrioritySampling 2019-11-18 16:44:48 -05:00
Laplie Anderson bd11d7222e Remove reliance on toString() in tests 2019-11-18 14:59:38 -05:00
Laplie Anderson a0d5238214 Add tests for rules 2019-11-18 14:58:55 -05:00
Laplie Anderson 0c22e27f66 Config and builder 2019-11-18 12:04:22 -05:00
Laplie Anderson d8afd8b2a4 Rule based sampling and delaying sampling until necessary 2019-11-18 12:04:14 -05:00
Laplie Anderson 56e4fdebb2 Change sampling to use knuth algorithm 2019-11-18 12:03:46 -05:00
dougqh c2d969fc0e Closing Reader-s 2019-11-15 09:37:45 -05:00
ZStriker19 8fb32b5730 Remove duplicate Okhttp span and stop separate service creation of okhttp. Instead okhttp will now appear as part of the service that is using okhttp to make the call. 2019-11-14 17:29:28 -05:00
Nikolay Martynov 2c4422aa04 Upgradle to gradle 6.0 2019-11-12 16:26:46 -05:00
Tyler Benson da8aa5c7c1
Merge pull request #1079 from DataDog/tyler/decorator-parse-strings
Allow decorators to parse string values on tags.
2019-11-05 08:43:26 -08:00
Tyler Benson 74fd6b6c9c Allow decorators to parse string values on tags.
Since global tags can only be set as String.
2019-11-04 13:23:31 -08:00
Laplie Anderson bc2978e8d8 Use groovy literals for BigInteger 2019-11-04 16:16:03 -05:00
Laplie Anderson e7ac8e7668 Only generate ids up to 2^63 - 1 2019-11-04 15:16:55 -05:00
Laplie Anderson bf4587c23d Missed a few test helper methods 2019-11-04 12:49:35 -05:00
Laplie Anderson cfc19facf5 Change String ids to BigInteger ids 2019-11-04 11:21:32 -05:00
Tyler Benson 86ed30d5af Fix scopemanager comaptability for OT 0.33.0
Also add simple regression test.
2019-10-31 14:58:31 -07:00
Laplie Anderson 61441e1fbe Remove calls to removed methods 2019-10-29 11:23:09 -04:00
Nikolay Martynov 4df2fe814b
Merge pull request #1068 from DataDog/mar-kolya/update-unixsocket-lib
Update unixsocket dependenxy
2019-10-28 13:09:28 -04:00
Nikolay Martynov 813a9b93b4 Update unixsocket dependenxy
This seems to fix strange build errors
2019-10-28 08:37:18 -04:00
dougqh 96f6c42459 Adding StatsD tests
Adding a happy & comm failure test case for StatsDMonitor.

This checks some but not all of the counters but also makes sure the exceptional path branches are exercised.

To make this test possible, I added an additional constructor to StatsDMonitor that takes a StatsDClient.
2019-10-25 17:26:11 -04:00
dougqh 101e519a3f Adding StatsDMonitor
Adding StatsDMonitor to DDAgentWriter

Modified Writer.createAgentWriter to read the health Monitor configs and construct StatsDMonitor when health metrics are enabled

Updated DDTracerTest to check for use of appropriate Monitor class depending on the Config
2019-10-25 12:11:40 -04:00
dougqh 30a987208a Introducing DDAgentWriter.Monitor
Introducing a Monitor for DDAgentWriter

Monitor can be used to track critical lifecycle events in the publishing of spans.  This change only contains a NoopMonitor, but a StatsD variant will be added in later commit.

The DDAgentWriter has been altered to take a Monitor instance at construction for the purposes of testing the Monitor.

DDAgentWriter now includes tests to count spans published and sent -- including new tests for multi-threaded writing and slow agent response scenarios.
2019-10-25 11:22:54 -04:00
dougqh 71cb23fdb4 Introducing DDApi.Response
Changing the DDApi send methods to return a new Response object instead of a boolean result.

The Response object allows additional information to be propagated to the DDAgentWriter that is needed for helath monitoring.

Beyond success / fail represented by DDApi.Response.success, this includes...
- communication exception to the agent
- status code returned by the agent
- JSON parsing exception caused by bad payload returned by the agent

DDApiTest-s have also been updated to check response.success() but also to check response.status() as appropriate.
2019-10-25 10:14:04 -04:00
Laplie Anderson 8938a0ec31 Remove opentracing-api.md 2019-10-24 17:09:57 -04:00
Laplie Anderson 81707e1d46 Treat empty proc file as not running in container 2019-10-21 12:04:39 -04:00
Tyler Benson 296916a393 Avoid submitting a job if executor is shutdown
There’s still a possiblilty of a race condition and we could catch and handle the exception, but this should reduce the noise a bit.
2019-10-18 11:24:33 -07:00
Tyler Benson 557d45a9fe Changes required for OT 0.32
This seems backwards compatable with 0.31 since all changes are additional, so this should be safe.
2019-10-17 13:54:56 -07:00
Tyler Benson 017b9609eb Add compatibility tests for OpenTracing 0.31.0 2019-10-15 14:28:25 -07:00
Nikolay Martynov 1ce38ba84b Disable flush when writer has been shutdown 2019-10-11 08:30:22 -04:00
Nikolay Martynov 22e8887282 Make sure flush cannot happen after disruptor shutdown
Otherwise flish event gets stuck in disruptor forever.
2019-10-11 08:10:32 -04:00
Tyler Benson a5bce0cf0f Avoid using ConcurrentLinkedDeque.size
It is a linear operation that can take a long time when many spans are involved.

Using an atomic integer to track the size allows it to be a constant operation.
2019-10-10 16:24:41 +02:00