Commit Graph

261 Commits

Author SHA1 Message Date
Trask Stalnaker 63a2383905
Split NetAttributesExtractor into NetClientAttributesExtractor and NetServerAttributesExtractor (#4287)
* Net Extractors

* Either request or response but not both

* Fix merge conflicts

* Separate by OnStart/OnEnd

* PeerServiceAttributes

* Fix test

* Restructure to client/server

* Fix merge conflict in main

* more

* peer.service

* Feedback

* peer.service is only for clients

* Fix merge conflict

* rename

* Armeria

* peer.service is only for clients

* rename

* WIP

* Sync Dubbo with Armeria

* More Dubbo and Armeria

* gRPC

* Revert some Dubbo changes

* more peer.service

* Fix test

* Fix merge

* Fixes
2021-10-07 15:40:15 -07:00
Nikita Salnikov-Tarnovski a48bd9de3f
Move PeerServiceAttributesExtractor from javaagent api to instrumentation api (#4235)
* Move PeerServiceAttributesExtractor from javaagent api to instrumentation api

* spotless
2021-10-06 12:42:55 -07:00
Lauri Tulmin 95651a4f1b
Intern db info (#4263) 2021-10-03 19:47:40 -07:00
Mateusz Rzeszutek c11b96e4d0
Make it possible to use InstrumentationContext (now VirtualField) fro… (#4218)
* Make it possible to use InstrumentationContext (now VirtualField) from library instrumentation

* fix tests

* fix javadocs

* fix some more tests

* code review comments

* setIfNull, computeIfNull
2021-10-01 11:13:11 +02:00
Trask Stalnaker abfcfb9dc7
Fix JDBC instrumentation deadlock (#4191) 2021-09-23 08:52:01 -07:00
Matthew Ho 6967484a97
Update groovy import order to match default IntelliJ (#1708) (#4047)
* Update groovy import order to match default IntelliJ (#1708)

* organized imports for .groovy files to follow default IntelliJ import settings

* updated intellij-setup.md

* Spotless

* drift

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-09-11 11:53:08 -07:00
Lauri Tulmin b61113fef6
JDBC: use ContextStore when running as agent (#3987)
* JDBC: use ContextStore when running as agent

* address review comments

* use singular
2021-08-27 14:14:40 -07:00
Anuraag Agrawal e0cb216610
Remove remaining usages of basic span asserts (#3616) 2021-07-19 10:09:44 -07:00
Anuraag Agrawal f5ce4c03f8
Inline basic usages of basicSpan (#3583)
* Inline basic usages of basicSpan

* spock
2021-07-18 21:15:51 +03:00
Anuraag Agrawal d3b62de8a5
Replace most uses of TraceUtils with testRunner runWithSpan. (#3582) 2021-07-15 10:30:34 -07:00
Trask Stalnaker dffb12fd44
Add missing test verification (#3578) 2021-07-15 09:15:12 +03:00
Mateusz Rzeszutek 9b56fc9051
Clean up AgentElementMatchers (#3527)
* Clean up AgentElementMatchers

* remove a TODO

* moved method
2021-07-09 10:02:21 +03:00
Trask Stalnaker 9e4da754c2
Use consistent logger field name (#3515) 2021-07-07 10:47:46 -07:00
Trask Stalnaker b304cc2912
Deprecate CallDepth.reset() and get() (#3511)
* Deprecate CallDepth.reset() and get()

* Don't pass CallDepth around
2021-07-07 09:24:50 -07:00
Mateusz Rzeszutek c5ba5c3a71
Use local variable for passing CallDepth between advice enter/exit me… (#3504)
* Use local variable for passing CallDepth between advice enter/exit methods

* fix broken call depth tracking

* checkstyle

* fix javadocs
2021-07-06 12:05:14 -07:00
Alexey Zhokhov 9979bef877
JDBC instrumentation: switch to use api instead of implementation for instrumentation-api. (#3494)
* Switch to use api instead of implementation for instrumentation-api.

* Removed duplicated dependency.
2021-07-06 09:20:41 -07:00
Mateusz Rzeszutek b9fcb6b498
Reduce CallDepth classes' API surface (#3497) 2021-07-06 09:24:19 +02:00
Trask Stalnaker 642f213c12
Remove hardcoded version (#3470)
* Remove hardcoded version

* Codenarc
2021-07-01 23:00:15 -07:00
Alexey Zhokhov ed02aff7b5
OpenTelemetry JDBC instrumentation library (#3367)
* Added jdbc library with ported version of OpenTracing JDBC Instrumentation.

* Gradle 7.1.

* Revert "Gradle 7.1."

This reverts commit e3df35b0

* Code style fixes.

* Code style fixes.

* Moved some JDBC utilities classes to the library module.

* javax.annotation.Nullable -> org.checkerframework.checker.nullness.qual.Nullable

* Build fix.

* Spotless fixes.

* Cache prepared statements.

* Cache connection info.

* Tracing for JDBC statement and prepared statement.

* Added some API dependencies.

* Fixed ending the span.

* Removed proxy usage.

* Cleanup.

* Implemented datasource with tracing support.

* Renamed Tracing prefix with OpenTelemetry.

* Renamed Tracing prefix with OpenTelemetry.

* Moved utilities classes to io.opentelemetry.instrumentation.jdbc.internal subpackage.

* Build fix.

* Build fix.

* Cleanup.

* Moved some shared classes to instrumentation-api module.

* Code review fixes.

* Make OpenTelemetryDriver final.

* Spotless fixes.

* Moved test classes from javaagent-unit-tests module to library module.

* Removed javaagent-unit-tests module.

* Covered OpenTelemetryDriver with tests.

* Cleanup.

* Covered OpenTelemetryDataSource with tests.

* Covered OpenTelemetryConnection with tests.

* Revert TestPreparedStatement.

* Added README.

* Build fix.

* Checkstyle fixes.

* Spotless fixes.

* Rename to build.gradle

* Fix build.gradle format.

* INSTANCE package scope.

* Documented OpenTelemetryDataSource usage.

* Renamed CheckedCallable to ThrowingSupplier.

* Update instrumentation/jdbc/library/README.md

Co-authored-by: Mateusz Rzeszutek <mrzeszutek@splunk.com>

* Update instrumentation/jdbc/library/src/main/java/io/opentelemetry/instrumentation/jdbc/OpenTelemetryDriver.java

Co-authored-by: Mateusz Rzeszutek <mrzeszutek@splunk.com>

* Update instrumentation/jdbc/library/src/main/java/io/opentelemetry/instrumentation/jdbc/OpenTelemetryDriver.java

Co-authored-by: Mateusz Rzeszutek <mrzeszutek@splunk.com>

* Update instrumentation/jdbc/library/src/main/java/io/opentelemetry/instrumentation/jdbc/OpenTelemetryDriver.java

Co-authored-by: Mateusz Rzeszutek <mrzeszutek@splunk.com>

* Update instrumentation/jdbc/library/README.md

Co-authored-by: Mateusz Rzeszutek <mrzeszutek@splunk.com>

* Update instrumentation/jdbc/library/README.md

Co-authored-by: Mateusz Rzeszutek <mrzeszutek@splunk.com>

* Update instrumentation/jdbc/library/README.md

Co-authored-by: Mateusz Rzeszutek <mrzeszutek@splunk.com>

* Removed javaagent-api module usage.

* Removed useless checking.

* Moved javaagent test classes to testing module.

* Move common JDBC test classes to testing module.

* Spotless fixes.

* Code format.

* Moved PeerServiceAttributesExtractor back to javaagent-api module.

* Rename JavaAgentJdbcSingletons to JdbcSingletons.

* Fixed JdbcSingletons import.

* Cleanup.

* Codenarc fixes.

* Update instrumentation/jdbc/library/src/main/java/io/opentelemetry/instrumentation/jdbc/OpenTelemetryDriver.java

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>

* Update instrumentation/jdbc/library/src/main/java/io/opentelemetry/instrumentation/jdbc/OpenTelemetryDriver.java

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>

* Parse InstrumentationVersion.VERSION.

* Store major and minor version in private static fields.

* Make the datasource way a preferred way.

* Removed interceptor mode.

* Rename build.gradle -> build.gradle.kts.

* Switch to Gradle Kotlin DSL.

Co-authored-by: Anuraag Agrawal <aanuraag@amazon.co.jp>
Co-authored-by: Mateusz Rzeszutek <mrzeszutek@splunk.com>
Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>
2021-07-01 10:35:07 -07:00
Mateusz Rzeszutek 15ed01d4fc
Change all instrumentation names to io.opentelemetry.{libName}-{libVersion} (#3411)
* Change all instrumentation names to io.opentelemetry.{libName}-{libVersion}

* minumum supported version
2021-06-30 15:34:36 +02:00
Anuraag Agrawal 761b9c280b
Migrate instrumentation gradle files to kotlin (#3414)
* Migrate instrumentation gradle files to kotlin

* Convert

* Muzzle
2021-06-28 17:27:12 +09:00
Anuraag Agrawal 785dc6adf2
Rename build files to build.gradle (#3409)
* Rename build files to build.gradle

* Rename smoke-tests

* Fix already broken
2021-06-25 16:10:31 +09:00
Anuraag Agrawal deb0e255cf
Use plugins block everywhere for applying plugins (#3386)
* Use plugins block everywhere for applying plugins

* Actually it's library instrumentation
2021-06-24 11:13:35 +09:00
Anuraag Agrawal 80f43b7a6a
Migrate javaagent-instrumentation to plugin (#3328)
* Migrate instrumentation.gradle to plugin

* Migrate usages

* Remove old

* Fix

* Revert example

* afterEvaluate

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-06-17 23:13:14 +09:00
Mateusz Rzeszutek 2f528e4166
Rename *Instrumenters to *Singletons (#3335) 2021-06-16 10:12:37 -07:00
Anuraag Agrawal 224dc51e93
Migrate java.gradle to conventions plugin (#3289)
* Migrate java.gradle to convention plugin.

* Switch to java-conventions

* Remove old file

* Fix

* Fix merge

* Missing paragraph

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-06-15 08:10:39 +09:00
Trask Stalnaker 62f1f49bcd
Intellij cleanup (Java and Groovy) (#3285)
* Intellij cleanup

* Update instrumentation-api/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/code/CodeAttributesExtractorTest.java

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>

* Update instrumentation-api/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/db/DbAttributesExtractorTest.java

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>

* Update instrumentation-api/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/db/SqlAttributesExtractorTest.java

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>

* Update instrumentation-api/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/messaging/MessagingAttributesExtractorTest.java

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>

* Update instrumentation/spring/spring-web-3.1/library/src/test/java/io/opentelemetry/instrumentation/spring/httpclients/RestTemplateInterceptorTest.java

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>

* Use glassfish version that supports lambdas

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>
2021-06-14 10:23:01 -07:00
Trask Stalnaker 4c80c62ce7
Add unused to remaining advice classes (#3280)
* Add unused to remaining advice classes

* Add newlines for visual separation
2021-06-14 11:12:02 +09:00
Trask Stalnaker e9c3df6dac
Static factory method ordering (#3206) 2021-06-07 15:29:30 -07:00
Trask Stalnaker a78ed4c420
Rename some extractor request/response params (#3202) 2021-06-07 11:41:47 -07:00
Anuraag Agrawal 2436499a09
Update to Errorprone 2.7 (#3181)
* Update to errorprone 2.7

* ToString

* Finish
2021-06-04 10:40:55 +09:00
Mateusz Rzeszutek 5e4c5684e6
Moved jdbc-datasource instrumentation to Instrumenter API (#3160) 2021-06-02 23:45:11 -07:00
Anuraag Agrawal c3dedbb64e
Enable all errorprone checks (#3155)
* Enable all errorprone checks

* Fixes

* Finish

* Finish

* Add flag to disable error prone
2021-06-01 17:41:08 +09:00
Anuraag Agrawal ed88cca533
Migrate from spotbugs to errorprone (#3122)
* Migrate from spotbugs to errorprone

* Fix hashtable

* try-with-resources

* Fix from merge

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-05-28 14:23:40 -07:00
Anuraag Agrawal c358a35414
Use dependency management pattern for dependency versions (#3113)
* Use dependency management pattern for dependency versions.

* Add groovy bom too

* Update dependencyManagement/dependencyManagement.gradle.kts

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-05-28 11:32:08 +09:00
Trask Stalnaker c8ecd9a619
Add response type parameter to db attributes extractor (#3093)
* Add response type parameter to DbAttributesExtractor

* AutoValue

* ResultSet
2021-05-26 23:13:33 -07:00
Lauri Tulmin 38830ea06e
Fix JdbcInstrumentationTest (#3089) 2021-05-26 08:25:20 -07:00
Mateusz Rzeszutek d755654c29
[WIP] Add peer.service to Instrumenter API (#3050)
* [WIP] Add peer.service to Instrumenter API

* Move PeerServiceAttributesExtractor to javaagent-api and use reflection to add it

* Finish PeerServiceAttributesExtractor

* Fix tests

* Add peer.service to apache-httpclient-5.0, jedis-1.4, lettuce-4.0
2021-05-25 15:31:41 +02:00
Trask Stalnaker 329233e576
Change a couple of Longs to Integers in Instrumenter API (#3043) 2021-05-20 14:33:22 -07:00
Trask Stalnaker 6efae9ad28
Remove duplicate method (#3032) 2021-05-19 11:56:34 -07:00
Mateusz Rzeszutek bb8f515083
Refactor TypeInstrumentation#transformers() method (#3019)
* Refactor TypeInstrumentation#transformers() method part 1

Add TypeInstrumentation and its implementations

* Refactor TypeInstrumentation#transformers() method part 2

Use the new method in all existing TypeInstrumentation implementations

* Drift

* Spotless

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-05-18 09:50:26 +02:00
Trask Stalnaker 85522cb2ed
Avoid loading advice classes in agent class loader (#3008)
* Lettuce 5.0

* Lettuce 4.0

* Ratpack

* Cassandra 4.0

* Grizzly

* KHttp

* External annotations

* Test

* Jdbc

* Method instrumentation

* OTel annotations
2021-05-16 20:07:20 -07:00
Anuraag Agrawal fe41885ee6
Switch to colon notation for dependencies. (#2994)
* Switch to colon notation for dependencies.

* Even more cleanup

* Revert mistake
2021-05-15 15:31:06 +09:00
Trask Stalnaker 1086bce0b0
Add comment to JDBC DataSource instrumentation (#2940) 2021-05-11 09:52:42 -07:00
Anuraag Agrawal abeca79e24
Some Gradle optimizations (#2949)
* Gradle optimizations

* Finish
2021-05-11 17:45:54 +09:00
Mateusz Rzeszutek 9c7fae3b04
Extract javaagent-extension-api from tooling & spi (#2879) 2021-05-06 23:30:25 -07:00
Mateusz Rzeszutek c9a3793bf8
Instrumenter API improvements (#2860)
* Instrumenter API improvements

* Move HTTP & net classes to separate packages
* Remove `db` prefix from method names in `DbAttributesExtractor`
* Add request-only net attributes extractor (it'll be needed in spring-sleuth-otel once we decide to use Instrumenters there)

* One NetAttributesExtractor class, javadocs

* add missing @Nullable

* Apply suggestions from code review

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>

* spotless

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-05-06 11:35:38 +02:00
Lauri Tulmin 9f8371e77c
Use locale insensitive lower/upper case conversion (#2838) 2021-04-22 11:24:13 +09:00
Trask Stalnaker bd829a6494
Remove duplicate status verification (#2710) 2021-04-19 11:41:37 -07:00
Mateusz Rzeszutek 3faf693631
Fix tests on the main branch (#2795)
* Fix tests on the main branch

* And fix muzzle by the way
2021-04-13 19:30:13 +02:00
Mateusz Rzeszutek 113ef24bef
Use Instrumenter in JDBC instrumentation (#2739)
* Use Instrumenter in JDBC instrumentation

Except jdbc-datasource, that one is going to be in a separate PR

* Use Instrumenter in JDBC instrumentation - code review comments
2021-04-13 16:19:13 +02:00
Trask Stalnaker d741dc48b9
Minor rename of javaagent unit test modules (#2784) 2021-04-13 12:36:30 +03:00
Mateusz Rzeszutek 5c280d4c43
Fix JDBC instrumentation: recursive statements inside Connection#getMetaData (#2756) 2021-04-09 10:46:12 -07:00
Trask Stalnaker 25dd2cf194
Verify span kind in all tests (#2715) 2021-04-05 12:57:48 -07:00
Anuraag Agrawal 79d7e88e53
Use Caffeine for weak maps (#2601)
* Caffeine weakmap

* Use Caffeine for weak maps

* Drift

* Drift

* Remove weak-lock-free

* Update licenses

* Fix bug

* Restore weaklockfree

* Clean

* Fixes

* Inline expunction

* Synchronized

* More comment

* Fix shading

* Executor

* computeIfAbsent and delete unused.

* Fix license report
2021-03-24 17:12:26 +09:00
Mateusz Rzeszutek ae23b97ec4
Move and rename NetPeerUtils (#2548)
* Move and rename NetPeerUtils

* Rename NetPeerUtils to NetPeerAttributes; inject instance instead of using a global var
* Rename SpanAttributeSetter to AttributeSetter (might be used to set on AttributesBuilder in the future, who knows)
* Deprecate default BaseTracer constructor: library instrumentations are supposed to inject all dependencies, the javaagent should explicitly pass globals

* fix compilation failure

* Remove peer.service customization from library instrumentation
2021-03-16 13:50:19 +01:00
Piotr Glazar 92d61b5844
Auto value (#2494)
* SqlStatementInfo as AutoValue

* RequestMeta as AutoValue

* DbInfo as AutoValue

* After merge compilation fix

* CouchbaseQuerySanitizer compilation fix

* JdbcConnectionUrlParserTest compilation fix

* Revert "RequestMeta as AutoValue"

This reverts commit 609b57ee48.
2021-03-09 15:07:03 +02:00
Anuraag Agrawal 94872b1ced
Move DB helpers to instrumentation-api (#2511)
* Move DB helpers to instrumentation-api

* Fix gradle config

* Remove legacy
2021-03-08 12:32:36 +09:00
Mateusz Rzeszutek 5317b7e7f1
Enrich JDBC spans with db.operation and db.sql.table (#2425) 2021-02-27 12:44:20 +02:00
Mateusz Rzeszutek fd55ce226a
Refactor DatabaseClientTracer (in preparation for low-cardinality span names) (#2398)
* Refactor DatabaseClientTracer (in preparation for low-cardinality span names)

* spotless
2021-02-26 15:36:24 +01:00
Mateusz Rzeszutek 0adeb85f43
Refactor InMemoryExporter and move some of its methods … (#2264)
* Refactor InMemoryExporter and move some of its methods to spock base class & junit extension

* codenarc

* spotless

* Apply suggestions from code review

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>

* fix armeria library tests

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-02-15 17:36:14 +01:00
Mateusz Rzeszutek 0fbdcad1dd
Make BaseTracer#startSpan() return Context (#2232)
* Make BaseTracer#startSpan() return Context

* Update instrumentation/apache-camel-2.20/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/apachecamel/CamelEventNotifier.java

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>

* spotless

* Add Javadocs to BaseTracer

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-02-12 12:12:40 +01:00
Anuraag Agrawal fc410706d0
Update to Sdk 0.16.0 (#2221)
* Update to 0.16.0-SNAPSHOT

* Finish

* Finish

* Update to 0.16.0

* Finish
2021-02-09 18:00:54 +09:00
Mateusz Rzeszutek 93b3a3b289
testing-common refactoring: replace direct AgentTestRunner usage with… (#2134)
* testing-common refactoring: replace direct AgentTestRunner usage with spock spec

* Updated instrumentation docs

* Fix reactor-core library tests

ReactorCoreTest was getting a tracer from GlobalOpenTelemetry before LibraryTestTrait had a change to initialize the SDK
2021-02-01 11:32:25 +01:00
Mateusz Rzeszutek c61f3f2949
Use a single configuration property for db.statement sanitization (#2125)
* Use a single configuration property for db.statement sanitization

* spotless
2021-01-29 16:02:15 +09:00
jason plumb 782a646d89
Cache sql sanitized extraction (#2094) 2021-01-27 10:04:58 -08:00
Mateusz Rzeszutek 20dadc1b6d
Replace two JavaCC lexers with a single JFlex one (#2113) 2021-01-26 14:03:11 -08:00
jason plumb 7122c4b2a5
Rename "normalize" to "sanitize" (#2087)
* rename SqlNormalizer to SqlSanitizer (more descriptive).

* rename normalize to sanitize.

* rename in comments and messages

* rename in variable to sanitized

* rename normalized -> sanitized in tests

* fixed broken tests

* rename variable.

Co-authored-by: Anuraag Agrawal <aanuraag@amazon.co.jp>
2021-01-22 15:49:24 +09:00
Anuraag Agrawal afdde0355b
Update to OTel 0.14.1 (#2059)
* Update SDK dependency to 0.14.1

* WIP

* Finish

* Cleanup
2021-01-18 13:02:04 +09:00
Pavol Loffay 077d8b64f6
Move common matchers to tooling/bytebuddy/matcher and ignore matchers to tooling/matcher (#1965) 2021-01-10 12:35:53 -08:00
Anuraag Agrawal 3b88bb75ae
Use SemanticAttributes for DbSystem (#1991) 2021-01-07 18:59:56 -08:00
Anuraag Agrawal 8d74baa2e4
Run tests with javaagent. (#1643)
Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-01-04 13:13:24 -08:00
Trask Stalnaker 4cbfb361e1
Use Context more in DatabaseClientTracer (#1836) 2020-12-07 09:15:15 +02:00
Trask Stalnaker 65f54e450b
Use Context more in HttpClientTracer (#1811)
* Use Context more in HttpClientTracer

* Better http-url-connection response object

* Follow database semantic conv for elasticsearch-rest

* Remove unnecessary CallDepth tracking
2020-12-03 11:47:08 -08:00
Trask Stalnaker ca76c80820
Hardcode expected values in tests (#1803)
* DEFAULT_SPAN_NAME

* TEMP_DESTINATION_NAME

* LoggingContextConstants

* Remove unnecessary dependencies

* Hardcode expected normalized queries in tests

* Spotless
2020-11-30 09:16:59 +02:00
Trask Stalnaker 26f254b10d
Create javaagent dirs for all instrumentations, part 2 (#1794) 2020-11-28 22:26:49 -08:00
Trask Stalnaker 5f263644da
Create javaagent dirs for all instrumentations (#1668)
* Create javaagent dirs for all instrumentation

* Add note about kotlin coroutine library instrumentation

* Feedback
2020-11-28 21:04:16 -08:00
Mateusz Rzeszutek 9a64a628ea
Make instrumentations non final (#1752)
Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2020-11-26 11:22:25 -08:00
Mateusz Rzeszutek 50c8ab499d
Remove no longer needed helperClassNames() methods (#1755) 2020-11-24 20:50:32 -08:00
Mateusz Rzeszutek 45646ff367
Rename TypeInstrumentation#classLoaderMatcher() to classLoaderOptimization() (#1741)
* Rename TypeInstrumentation#classLoaderMatcher() to classLoaderOptimization()

* Removed no longer needed comments & improved JavaDoc

* Improve TypeInstrumentation Javadoc
2020-11-24 14:27:58 +02:00
Trask Stalnaker 308a8f9b0f
Consistent equals implementations (#1736)
* Consistent equals implementations

* Use direct equals where previous behavior
2020-11-23 15:41:31 +02:00
Trask Stalnaker cecdfc2cd0
Update instrumentation names to be consistent (#1671)
* Update instrumentation names to be consistent

* Remove amqp from rabbitmq package name
2020-11-18 19:53:31 -08:00
Trask Stalnaker 6d5ec329d6
Enable checkstyle for google style guide (#1641) 2020-11-16 18:46:59 -08:00
Mateusz Rzeszutek 1765839d01
Simplify JDBC span names (#1533) 2020-11-10 13:34:54 -08:00
Mateusz Rzeszutek 0e83a5b56d
Refactor Instrumenters into InstrumentationModules - J (#1562) 2020-11-09 14:41:37 -08:00
Trask Stalnaker 71f91877ab
Fix muzzle and add missing helper classes (#1585)
* Fix muzzle

* Fix jdbc instrumentation

* Fix jms instrumentation

* Fix couchbase instrumentation

* Fix servlet instrumentation
2020-11-08 13:54:00 -08:00
Anuraag Agrawal d3b60a5e33
Rename TRACER to tracer() (#1540) 2020-11-02 20:49:51 -08:00
Anuraag Agrawal c6eee70660
Update to latest snapshot. (#1524) 2020-10-29 18:54:09 -07:00
Mateusz Rzeszutek e89942d430
Standardize DB query normalizer property names (#1509)
* Standardize DB query normalizer property names

And add normalizer configuration for Redis, Couchbase, Cassandra and Geode

* apply code review comments
2020-10-29 16:20:33 +02:00
Anuraag Agrawal a2dccf2316
Update to latest SDK snapshot. (#1479) 2020-10-26 19:29:46 -07:00
Trask Stalnaker 3565775b00
Format groovy (#1475)
* Apply Intellij format to groovy

* spotless
2020-10-26 11:47:12 +09:00
Anuraag Agrawal f6ad05b8e3
Update to latest SDK snapshot (#1384)
* Update to latest SDK snapshot

* Use published snapshot

* Fixes

* Cleans

* spotless

* Most

* Clean

* Merge

* Temporarily remove context interop

* WIP

* Prepare for intercepting propagated span

* Bump SDK

* IDE updates

* Lots

* compileJava

* Done?

* bar

* Spot

* drugs

* Groovy--

* green for me

* Spot

* Remove grpc import

* Scrub
2020-10-25 15:14:32 +09:00
Mateusz Rzeszutek 50990a7c17
Cassandra instrumentations should store normalised CQL queries as db.statement (#1427)
* Move `DbSystem` to package `...instrumentation.api.db`
* Move `SqlNormalizer` to `javaagent-api`  package ...api.db.normalizer
* Refactor Cassandra tests so that they use testcontainers (and run on Java 11)
* Implement Cassandra statement normalization
2020-10-22 17:56:06 +02:00
Ioannis Mavroukakis df2b6638fe
ipv6 support for modified-URL-like (#1403)
* ipv6 support for modified-URL-like

* add a "pure" v6 address to the tests

* wrap the regex pattern

* individually comment the regex parts
2020-10-19 17:30:50 +03:00
Trask Stalnaker 57301e3fe7
Rename "integration" to "instrumentation" (#1412)
* Rename integration to instrumentation

* Revert doc changes, need to wait for release

* spotless
2020-10-19 14:36:30 +09:00
Nikita Salnikov-Tarnovski 15e0b2ff32
Run build without warnings (#1387) 2020-10-15 16:10:22 -07:00
Trask Stalnaker 1b51d4a6b1
Rename packages (#1367) 2020-10-11 13:54:35 -07:00
Mateusz Rzeszutek 409530629f
Refactor all tests that use Config so that they don't fail locally (#1310)
* Refactor all tests that use Config so that they don't fail locally

* Use ConfigUtils in tests for all config-related things

* Fix spotless and codenarc

* Fix spotless

* PR comments: remove unnecessary config
2020-10-08 20:01:31 +03:00
Ioannis Mavroukakis f2de47a150
SpanAssert method names should reflect underlying Span method names (#1307) 2020-10-05 16:04:08 +09:00
Anuraag Agrawal dadaac9a8c
Use 2-line license header to match SDK repo (#1321)
* Use 2-line license header to match SDK repo

* Apply change
2020-10-05 14:29:56 +09:00
Mateusz Rzeszutek c7fc26188d
Remove instrumentation (and tooling) specific properties from Config (#1286) 2020-09-30 11:27:06 -07:00
Anuraag Agrawal 210c669643
Remove AgentSpecification (#1291) 2020-09-30 17:34:29 +09:00
Mateusz Rzeszutek 9e591bb01a
Refactoring Config into @AutoValue POJO (#1254) 2020-09-28 22:08:45 -07:00
Nikita Salnikov-Tarnovski 2b83c310da
More decorators translated to tracers (#1148) 2020-09-03 07:53:14 +03:00
dengliming 7dd4a6082d
Fix hsqldb jdbc urls parsing (#1087)
* Fix hsqldb jdbc urls parsing

* Fix VertxReactive testcase

* Fix review and remove the useless param declaration.
2020-08-23 18:36:54 +03:00
Anuraag Agrawal bbfdbb39c0
Create abstraction for library dependencies for instrumentation. (#977)
* Create abstraction for library dependencies for instrumentation.

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2020-08-19 08:57:31 +09:00
Trask Stalnaker 7159d04b8d
Change groovy import order (#1013)
* Update docs

* Format all groovy code

* Organize imports
2020-08-15 23:19:27 -07:00
Trask Stalnaker 414213f2d1
Remove final from parameters (#1003) 2020-08-15 22:35:51 -07:00
Trask Stalnaker f893ca540b
Scripted package renaming (#988) 2020-08-15 21:55:01 -07:00
Helen Y bb235a0aa3
Update package name for tracers (#991) 2020-08-14 21:07:18 -07:00
Trask Stalnaker f940b2d2de
Use OpenTelemetry.getTracer() shortcut (#965) 2020-08-14 07:11:06 +03:00
Trask Stalnaker 7818e33178
Package renaming (#970) 2020-08-13 20:14:46 -07:00
Trask Stalnaker b5fbf90977
Extract instrumentation api module (#884) 2020-08-09 22:52:33 -07:00
Trask Stalnaker dce9d6db47
Remove ExceptionLogger refs from instrumentation (#883) 2020-08-03 19:04:27 -07:00
Trask Stalnaker 5dc2ca350a
Update config property prefix from ota to otel (#841)
* Update config property prefix from ota to otel

* more

* format

* more
2020-07-31 08:29:29 +03:00
Helen Y b659ee8223
Apply new database semantic attributes (#823) 2020-07-28 17:31:33 -07:00
Helen Y 44fcf8115b
Update database semantic conventions (#785) 2020-07-28 11:55:55 -07:00
Nikita Salnikov-Tarnovski fcf4319aac
Faster tests (#725)
🎉
2020-07-22 10:10:34 -07:00
Helen Y 86c438b154
Remove final from local variables (#732)
* Remove final from local variables
2020-07-20 13:53:34 +09:00
Nikita Salnikov-Tarnovski 9f1ffbe38c
Remove attribute `span.origin.type` (#712) 2020-07-16 10:00:45 -07:00
Nikita Salnikov-Tarnovski 23ae6980d5
Lettuce and Cassandra migrated from deprecated Decarator to new Tracer (#681)
* Lettuce and Cassandra migrated from deprecated Decarator to new Tracer

* Polish

* Polish

* Split a connection specific handling out of Lettuce database client tracers.

This eliminates the need of awkward method override in the common DatabaseClientTracer.

* Muzzle fix

* Format
2020-07-15 13:37:22 +03:00
Sergei Malafeev b78abac82c
#598 Rename "tags" to "attributes" (#645) 2020-07-07 21:03:41 -07:00
Nikita Salnikov-Tarnovski a62801649f
More fixes for Gradle warnings (#643)
* More gradle deprecation warnings fixed

* More gradle deprecation warnings fixed

* More fixes

* More fixes

Co-authored-by: Anuraag Agrawal <aanuraag@amazon.co.jp>
2020-07-07 15:02:07 +03:00
Tyler Benson 4a943c8411 Use Spotless for formatting (DataDog/dd-trace-java#1619) 2020-06-30 11:15:48 -07:00
Richard Startin b558c50229 Add missing classloader matchers for expensive matchers (DataDog/dd-trace-java#1617) 2020-06-30 11:13:22 -07:00
Anuraag Agrawal 874b157fe5
Newline between license and package. (#581) 2020-06-25 13:31:16 -07:00
Nikita Salnikov-Tarnovski c1c02ac949
Next attempt to extract common logic from instrumentations. (#523)
* Next attempt to extract common logic from instrumentations.

I tried to reduce code repetition in DB client instrumentations, jdbc and mongo ones. This time I experimented with another approach, different from HttpServerTracer. Namely, I have extracted that common `startSpan` method into `DatabaseClientDecorator` itself. The idea is still the same as before, but I wanted to see if we can migrate by smaller steps, reusing much of the existing code and just incrementally reducing public API.

* Extracted separate Tracer after all

* More explicit call depth handling

* Fix format

* More reusable method overloads
2020-06-17 12:08:52 -07:00
Tyler Benson 1b29184e7c Make rootDir usage consistent (DataDog/dd-trace-java#1518) 2020-06-11 10:14:02 -07:00
Simon Leigh 3a4483a0f5
Add support for jTDS driver connection urls for SQL Server (#396)
The jTDS driver is an open source JDBC driver for connecting to SQL Server databases.
Added support for parsing the url connection string so that spans can be generated for the sql statements using this driver.

Fixes #395
2020-05-09 19:07:31 -07:00
Trask Stalnaker 6d1a58d151 Merge tag 'v0.50.0' into correct-history 2020-05-05 12:41:08 -07:00
John Bley ca296b92fd
Normalize sql statements to elide literal numbers and strings. (#366)
* Normalize sql statements to elide literal numbers and strings.

* Missed one SlickTest sql normalization.

* Fix muzzle order for helper classes.

* Change name of feature flag

* Upgrade to latest spotless version in an attempt #1 to make the circleci build work.

* Attempt 2 to make circleci build happy - exclude build/generated/** from spotless.

* Attempt 3 to get circleci build working, adding *.java to the exclude line.

* Change exclude of generated files to include of just the src/ directory.
I confirmed that this properly failed the build if I remove a license header from a src/ directory.
2020-05-04 12:17:55 -07:00
Pontus Rydin 9568ba079b
Use Builder::setAttribute whenever possible (#348) 2020-04-27 13:51:34 -07:00
Trask Stalnaker 1f0cd54fd7
Remove copyright year from license header (#322)
* Update template

* Apply template
2020-04-15 11:24:44 -07:00
Trask Stalnaker e8a451cbce
Remove unused service method (#321) 2020-04-15 10:17:04 -07:00
Trask Stalnaker a333cfe536
Remove unused getComponentName (#314) 2020-04-14 13:29:33 -07:00
Trask Stalnaker 4fe685d916
Remove component attribute (#291) 2020-03-29 20:32:19 -07:00
Trask Stalnaker 570fa012c0
Remove service.name attribute (#290) 2020-03-29 20:29:15 -07:00
Trask Stalnaker 2e210683fd
Update to OpenTelemetry API/SDK 0.3.0 (#286)
* Update gradle dependencies and module name

* Replace Tracer.withSpan() with currentContextWith()

* Update inject to 0.3.0

* Update extract to 0.3.0

* More updates

* Remove distributedcontext package refs

* Update OpenTelemetry API interoperability

* No need to call setNoParent()

setParent(SpanContext.getInvalid()) should give the same result.
2020-03-28 19:38:51 -07:00
Trask Stalnaker c82baecb9d
Populate db.url for jdbc spans (#277) 2020-03-23 10:34:50 -07:00
Trask Stalnaker da05fc7e4c
Change jdbc db.type to sql (#274) 2020-03-23 09:50:55 -07:00
Trask Stalnaker 396baa69d6
Update OpenTelemetry API/SDK (#257)
* Update dependency version

* Change getTracerFactory to getTracerProvider

* Update some imports

* Change put to set

* Fix up bridge

* Update package names

* Update test SpanProcessor

* Remove null conditionals around setAttribute

* Update shading

* Update span context extraction
2020-03-20 14:13:55 -07:00
Trask Stalnaker 8700b2eb33
Remove span.type attribute (#262) 2020-03-20 13:05:00 -07:00
Trask Stalnaker 007029b122
Better span names for jdbc (#238) 2020-03-19 19:50:51 -07:00
Trask Stalnaker 2298885678 Merge tag 'v0.46.0' into dd-merge 2020-03-16 11:25:27 -07:00
John Bley f30f5f0779
Fix 3 minor javadoc issues. (#225) 2020-03-11 13:25:39 -07:00
Trask Stalnaker cba031ddcb
Rename hibernate modules (#205)
* Rename hibernate modules

* Update tracer name

* Change from gradle inheritance to composition

This will make it possible to have empty "grouping" modules, e.g.
instrumentation:hibernate.

* Introduce empty hibernate grouping module
2020-03-09 15:33:21 -07:00
John Bley 00ae1eca3d
Integrate SpotBugs into build (ignoreFailures=true), fix most found issues (#216)
* Integrate SpotBugs (FindBugs) into build.  Set ignoreFailures so spotted bugs do not break the build.

* Fix many SpotBugs-found items, mostly making things final, but also a redundant null check and a reliance on platform character encoding.  2 items remain which will need further work/review, but as ignoreFailures is set, they will not fail the check stage.

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2020-03-09 10:47:49 -07:00
Trask Stalnaker b2db595430 Merge tag 'v0.45.0' into dd-merge 2020-03-05 21:49:39 -08:00
Trask Stalnaker 701b282b17 Merge tag 'v0.44.0' into dd-merge 2020-02-29 14:30:12 -08:00
Trask Stalnaker 40e3932358
Add license headers (#188)
* Add spotless gradle plugin

* Add license headers
2020-02-27 13:24:42 -08:00