Commit Graph

313 Commits

Author SHA1 Message Date
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
Will Tran 63c6db0cd5
Ensure baggage can always be added to
Otherwise it could be assigned to a Collections.emptyMap()
Fixes https://github.com/DataDog/dd-trace-java/issues/1036
2019-10-09 13:01:44 -04:00
Tyler Benson 9ef3332140 Extract base test class and move Config class changes there. 2019-10-07 18:51:25 +02:00
Tyler Benson 82d60c27f4 Fix codeNarc 2019-09-27 15:04:41 -07:00
Tyler Benson 05c95100ab Minor optimization to avoid using BigInteger if possible 2019-09-25 18:14:40 -07:00
Tyler Benson 2086664f6d Reduce overhead of URLAsResourceName decorator
Using `new URL()` just to parse the path out was rather expensive.  This should improve the situation.
2019-09-17 18:50:01 -07:00
Tyler Benson 3d1f2b9d01 Ensure default sampler is available
This avoids the possible null pointer reference.
2019-09-10 15:29:13 -07:00
Tyler Benson 310ec93135 Minor test fix. 2019-09-10 15:08:55 -07:00
Tyler Benson a010d4e095 Remove race condition. 2019-09-10 14:56:03 -07:00
Tyler Benson 8cd294dba0 Use ThreadLocalRandom for improved concurrency. 2019-09-10 14:04:37 -07:00
Tyler Benson a88182ab3b fix test 2019-09-10 12:56:42 -07:00
Tyler Benson 42545a0906 Remove synchronization from RateByServiceSampler
This change avoids lock contention in a hot code path.

I also added double check locking in ClassLoaderMatcher to reduce the need of locking there.
2019-09-10 12:44:13 -07:00
Tyler Benson df017e044a
Merge pull request #975 from DataDog/tyler/split-by-tag
Add new setting to allow renaming service by tag
2019-09-05 14:24:20 -07:00
Tyler Benson 8177b95164 Make config modifiable and still allow tag to be set. 2019-09-03 18:51:39 -07:00
Tyler Benson 82f5076716 Add new setting to allow renaming service by tag
This is a more generic form of the previous `split-by-domain` and `split-by-instance`.

(Note: evaluation is done when a tag is set, so If multiple tags are configured, the last tag set will take precidence.)

For example, this setting can be used to rename `aws-sdk` spans to be identified with the corresponding `aws.service` tag:

```
-Ddd.trace.split-by-tags=aws.service
```

There are some slight differences with this setting compared with`dd.trace.http.client.split-by-domain` and `dd.trace.db.client.split-by-instance`.  `split-by-tags` applies to every span, where `split-by-domain` and `split-by-instance` only apply to http and db client spans respectively.
2019-09-03 16:55:47 -07:00
Alex Antonov bf15ea1f5a Added tests for Haystack propagation support 2019-09-03 14:29:15 +02:00
Alex Antonov 93ae2678ff Added support for Haystack trace propagation 2019-09-03 11:04:01 +02:00
Tyler Benson bbfd02befc Update Jackson to 2.9.9.3
As recommended by https://nvd.nist.gov/vuln/detail/CVE-2019-14379

(Remove unused dependency)
2019-08-12 16:41:57 -07:00
Tyler Benson 13b794c504
Merge pull request #917 from DataDog/tyler/null-span-in-scope
Assert span in scope can't be null and add tests to verify
2019-07-18 13:43:19 -07:00
Tyler Benson 17d26a4934 Assert span not null and use NoopSpan instead. 2019-07-18 12:38:49 -07:00
Laplie Anderson 5956f51e07 Change container info to a singleton ContainerInfo
DDTraceOTInfo wasn't the best place for container information.  Changed ContainerInfo.java to have a static instance
2019-07-17 13:01:08 -04:00
Laplie Anderson 719bf0ad76 Remove reference to private repo 2019-07-17 12:00:31 -04:00
Laplie Anderson d03a2a95e2 Change to @Getter/@Setter to be above coverage threshold
Since toString(), equals(), and hashCode() are never called, the code coverage for the classes are too low.

In the future, we should ignore code coverage of lombok generated methods
2019-07-16 19:09:00 -04:00
Laplie Anderson 4853801813 Add container id headers to request builder 2019-07-16 18:29:59 -04:00
Laplie Anderson 9dbe3a0a17 Fix part of path to match 2019-07-16 18:29:59 -04:00
Laplie Anderson d74ffc3db0 Parsing tests from RFC and reference impl 2019-07-16 18:29:59 -04:00
Laplie Anderson 369658c200 Initial cgroups parsing implementation 2019-07-16 18:29:59 -04:00
Tyler Benson e08e3a787c Allow null to be set in Scope for Span
This is useful to temporarily remove a trace from scope for a defined period.
2019-07-15 19:11:51 -07:00
Nikolay Martynov b3c970d6c7 Formatting fix 2019-07-11 13:45:40 -04:00