Commit Graph

4178 Commits

Author SHA1 Message Date
dougqh 4ad51dd9fa Introducing TempDir helper
Introduces a TempDir helper class

This was done to help handle an oversight in the prior per-process temp dir change.  The fallback mode is to use the shared java.io.tmpdir directly.

When using java.io.tmpdir, we don't want to be creating and destorying, since it may be shared.

The new TempDir object is constructed knowing whether the TempDir is per-process or shared -- and the behavior of its prepare and cleanup method change accordingly.

When using a per-process temp dir, the dir is creating and deleted regularly.  When using a shared temp dir, those methods become nops.

Creating TempDir also made it easy to avoid repeatedly calling deleteOnExit in the event that delete fails, so I made that change as well.
2020-03-03 16:08:37 -05:00
dougqh d2ecce477e Switching to per-process temp dir
Switching to create a per-process temp dir as protection against file name collisions.  This is done by introduced TEMP_DIR which is calculated during class initialization.

The current selection process generates a random directory name and sees if that name is availabe in java.io.tmpdir.  If it is that name is selected; otherwise, another name is generated.

If no unique name is found after 10 rounds of generation, the code falls back to the old behavior of writing directly to java.io.tmpdir.
2020-03-03 16:08:29 -05:00
dougqh c50899f184 Creating helper methods for injection
Create helper methods injectBootstrapClassLoader & injectClassLoader.

The directory creation and retry logic that will be added to the handling of the bootstrap will complicated the code.

To keep the code readable, I broke the bootstrap handling into its own method.  To keep the level abstraction consistent, I did the same with injectClassLoader.
2020-03-03 16:08:19 -05:00
dougqh 3417fd8940 Improving debuggability by requestingName
This change adds a requestingName field to help in diagnosing the source of any injection failures.

Usually, the requestingName is the simple class name of the Instrumenter; however, this change doesn't propagate the Instumeneter named through FieldBackedProvider.
2020-03-03 16:08:09 -05:00
Nikolay Martynov a62db5bcad Ignore more spring 2020-03-03 14:51:25 -05:00
Nikolay Martynov 9f1c821d37 Ignore javax.el 2020-03-03 14:51:25 -05:00
Nikolay Martynov 33c8fc0f3a Ignore snakeyaml 2020-03-03 14:51:23 -05:00
Nikolay Martynov 864e2884eb Ignore lucene 2020-03-03 14:51:22 -05:00
Nikolay Martynov e8c31e9dd6 Ignore lagom: we do not instrument it directly 2020-03-03 14:51:22 -05:00
Nikolay Martynov dea3d72cc6 Ignore jsonpath 2020-03-03 14:51:22 -05:00
Nikolay Martynov d5ea1167a6 Ignore h2 2020-03-03 14:51:19 -05:00
Tyler Benson 042f49d800 fix muzzle and retry tests 2020-03-03 11:03:01 -08:00
Tyler Benson 7702b0585b Add Classloader precheck to expensive matchers.
Benchmark results:
```
Benchmark                                                             Mode  Cnt   Score   Error  Units
ClassRetransformingBenchmark.WithAgent.testTracedRetransform          avgt       21.933          ms/op
ClassRetransformingBenchmark.WithAgent.testUntracedRetransform        avgt        6.171          ms/op
ClassRetransformingBenchmark.WithAgentMaster.testTracedRetransform    avgt       22.129          ms/op
ClassRetransformingBenchmark.WithAgentMaster.testUntracedRetransform  avgt        6.517          ms/op
ClassRetransformingBenchmark.testTracedRetransform                    avgt        0.876          ms/op
ClassRetransformingBenchmark.testUntracedRetransform                  avgt        0.867          ms/op
```

I also saw a small improvement in application startup time.
2020-03-03 10:29:10 -08:00
Pontus Rydin d3246121cc
Made gRPC instrumenter compliant with semantic conventions (#202)
* Added service name and corrected span name

* Support peer address for clients

* Added server peer address resolution

* Added constants for new tag names

* Cosmetic change

* Fixed muzzle issue

* Better handling of addresses

* Addressed PR comments
2020-03-03 10:01:26 -08:00
Nikolay Martynov 89be6b5c06 Ignore majority of google api
And several other google libraries
2020-03-03 11:45:22 -05:00
Nikolay Martynov d029713740 Ignore org json simple 2020-03-03 11:45:22 -05:00
Nikolay Martynov 78268d1f0f Fix logback 2020-03-03 11:45:22 -05:00
Nikolay Martynov 8cdde847f9 Ignore mustachejava 2020-03-03 11:45:22 -05:00
Nikolay Martynov d74d65175b Ignore majority of cassandra classes 2020-03-03 11:45:22 -05:00
Nikolay Martynov 22e7fe8f82 Add exception for instrumented runnable in logback 2020-03-03 11:45:22 -05:00
Nikolay Martynov 52e6f42f03 Codehale metrics provides servlets that we instrument 2020-03-03 11:45:22 -05:00
Nikolay Martynov bcec89895e Ignore couchbase packaged deps 2020-03-03 11:45:22 -05:00
Nikolay Martynov 4960e0630d Ignore carrotsearch.hppc and codahale.metrics 2020-03-03 11:45:22 -05:00
Nikolay Martynov 9d76281ddf Ignore jcommander 2020-03-03 11:45:22 -05:00
Nikolay Martynov 646bf5bb05 Ignore logback 2020-03-03 11:45:22 -05:00
Nikolay Martynov e92ad38cc8 Tighten up aws instrumentation matcher a bit 2020-03-03 11:45:22 -05:00
Nikolay Martynov 31a4c9a427 Ignore kotlin runtime 2020-03-03 11:45:22 -05:00
Nikolay Martynov a59ab43efc Ignore org.objectweb.asm. 2020-03-03 11:45:22 -05:00
Nikolay Martynov dad9e72af7 Ignore more groovy classes 2020-03-03 11:45:22 -05:00
Nikolay Martynov dedfc7dd0b Make ignired classes test assertion more informative 2020-03-03 11:45:22 -05:00
Nikolay Martynov fc5e2cc747 Ignore apache xml tools 2020-03-03 11:45:22 -05:00
Nikolay Martynov fe9cf09249 Ignore jackson and cglib 2020-03-03 11:45:22 -05:00
Nikolay Martynov e3bd74de41
Merge pull request #1277 from DataDog/mar-kolya/test-library-matcher
Add test for ignore matchers for libraries
2020-03-03 11:44:42 -05:00
Nikolay Martynov 73abe16c26 Add a comment 2020-03-03 07:29:22 -05:00
jean-philippe bempel 14dd0f1147 Update JMXFetch to 0.35
Includes many improvements regarding memory footprint and allocations
2020-03-03 08:49:51 +01:00
Trask Stalnaker 81cd6dbb23
Remove unneeded dependencies (#199) 2020-03-02 17:08:38 -08:00
Trask Stalnaker fa72243966
Change link behavior for consumers (#198) 2020-03-02 16:29:25 -08:00
Trask Stalnaker 9b73e85bef
Fix class loading instrumentation (#197) 2020-03-02 16:08:46 -08:00
Tyler Benson 0fb83c59b6
Merge pull request #196 from trask/dd-merge
Merge changes from dd-trace-java 0.44.0
2020-03-02 15:47:19 -08:00
Nikolay Martynov e22ce02762 Add test for ignore matchers for libraries 2020-03-02 16:37:39 -05:00
Nikolay Martynov a1a3957ca8 Rename variable 2020-03-02 16:37:39 -05:00
Nikolay Martynov 5b4c7f8c92
Merge pull request #1273 from DataDog/mar-kolya/profile-force-early
Add an option to force profiling right in the beginning of premain
2020-03-02 22:18:05 +01:00
Nikolay Martynov d46a3be123 Reduce log verbocity 2020-03-02 15:26:04 -05:00
Nikolay Martynov b73bf22f2d
Merge pull request #1279 from DataDog/mar-kolya/make-profiling-test-more-resilient
Make profiling controller test more resilient to delays
2020-03-02 19:43:02 +01:00
Tyler Benson f0e59edb5e
Merge pull request #1274 from DataDog/tyler/matcher-hashcode-equals
Add proper hashcode/equals methods to our matchers
2020-03-02 10:37:51 -08:00
Nikolay Martynov 6ff723e191 CR changes 2020-03-02 12:25:20 -05:00
Nikolay Martynov 2eb7aa7d20 Increase CleanerTest timeout to help IBM JVM to cope 2020-03-02 12:11:11 -05:00
Nikolay Martynov ba55f0ed10 Make profiling controller test more resilient to delays 2020-03-02 11:48:21 -05:00
Nikolay Martynov e42fc4a117
Merge pull request #1278 from DataDog/mar-kolya/upgrade-system-rules-everywhere
Use same version of system-rules everywhere
2020-03-02 17:23:19 +01:00
Tyler Benson abd115cff5
Merge pull request #1275 from trask/fix-class-loading-instrumentation
Fix class loading instrumentation
2020-03-02 08:17:24 -08:00