Commit Graph

179 Commits

Author SHA1 Message Date
Trask Stalnaker ce4cef76f9
Clean up groovy assertions (#4805) 2021-12-05 23:23:58 -08:00
Lauri Tulmin 73a28dadb4
Fail tests on muzzle failre (#4545) 2021-11-02 16:06:34 +02:00
Martin d314d76fce
rename `newBuilder()` to `builder()` (#4475)
* rename `newBuilder()` to `builder()`

* rename `newBuilder()` to `builder()`
2021-10-22 20:50:43 -07:00
Lauri Tulmin 9b8ab5eeec
Migrate to spock 2 (#4458)
* Migrate to spock 2

* Fix smoke test suites

* address review comments

* review comment

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-10-22 08:40:58 -07:00
Trask Stalnaker 1b37df7afd
Move common testing modules to match convention a bit better(?) (#4451)
* Rename jsf modules to match convention

* Couchbase too

* Mongo too

* Play WS too

* Log4j too

* Elasticsearch too

* JAX-RS too

* JAX-WS sort of

* Spotless

* empty commit
2021-10-21 12:41:28 -07:00
Martin 62c90512cd
switch annotation `org.checkerframework.checker.nullness.qual.Nullable` to `javax.annotation.Nullable` (#4418) 2021-10-19 10:59:18 +03:00
Nikita Salnikov-Tarnovski c119fa1bf6
Remove more usages of checker's Nullable (#4410) 2021-10-18 17:32:25 +03:00
Nikita Salnikov-Tarnovski ae7d48cb07
Convert Mongo to Instrumenter (#4387)
* Convert Mongo to Instrumenter

* Apply suggestions from code review

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

* Update instrumentation/mongo/mongo-3.1/library/src/main/java/io/opentelemetry/instrumentation/mongo/v3_1/TracingCommandListener.java

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

* Simplify

Co-authored-by: Mateusz Rzeszutek <mrzeszutek@splunk.com>
2021-10-18 10:22:00 +03:00
Martin ac91dc090a
Type annotation placement (#4406)
* switch annotation `org.checkerframework.checker.nullness.qual.Nullable` to `javax.annotation.Nullable`

* code format
2021-10-17 17:38:43 -07:00
Lauri Tulmin 25491d7d61
Mongo4 strict context check (#4364)
* Mongo4 strict context check

* Update instrumentation/mongo/mongo-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/mongo/v4_0/AsyncWorkManagerInstrumentation.java

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

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-10-13 13:03:59 -07:00
Lauri Tulmin 344c74a02d
Disable strict context check for mongo4 tests (#4336)
* Disable strict context check for mongo4 tests

* spotless
2021-10-09 09:54:24 -07:00
Lauri Tulmin 478f936d54
Retry strict context check failures (#4282) 2021-10-08 10:47:52 -07:00
Trask Stalnaker dafc97f96e
Simplify gradle files (#4292) 2021-10-04 21:53:35 -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
Trask Stalnaker 20c72f3e98
Format kotlin gradle files (#3942)
* Add ktlint for kotlinGradle

* ktlint fails on wildcard imports

* Auto-format kotlin gradle files
2021-08-25 13:43:57 +09:00
Trask Stalnaker c9619c0626
Disable strict context check for elasticsearch 6 tests (#3917)
* Disable strict context check for elasticsearch 6 tests

* Mongo too
2021-08-23 22:46:04 -07:00
Lauri Tulmin ff5472a822
Limit number of concurrently running docker tests (#3664)
* Limit number of concurrently running docker tests

* rename heavy to testcontainers

* use shorter expression
2021-07-27 15:41:39 -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
Anuraag Agrawal 3cfa086ffd
Migrate nullaway config to plugin (#3462) 2021-07-01 18:13:16 +09: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
Lauri Tulmin b3ab474d65
Fix mongo latest dep tests (#3333) 2021-06-16 14:06:52 +03:00
Anuraag Agrawal b7bfbf0cc6
Migrate instrumentation-library / common to plugins (#3320) 2021-06-15 11:54:48 -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 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 cefaecab3f
Use more efficient namedOneOf where possible (#3200)
* Use more efficient namedOneOf where possible

* Fix - hasClassesNamed does and not or
2021-06-07 11:41:34 +09: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
Trask Stalnaker fb0d047fce
Last type instrumentations to top-level classes (#3123) 2021-05-30 16:05:31 -07: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
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
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
Mateusz Rzeszutek 9c7fae3b04
Extract javaagent-extension-api from tooling & spi (#2879) 2021-05-06 23:30:25 -07:00
Anuraag Agrawal b416ece9c3
Extract Mongo library instrumentation (#2789)
* Extract mongo library instrumentation

* Finish

* Drift

* Cleanup

* build twice

* Spot
2021-04-14 13:51:21 +09:00
Lauri Tulmin c49dfd57de
Fix mongo latest test (#2790) 2021-04-13 11:49:27 +03:00
Lauri Tulmin 718a5a17a3
Mongo reactive context propagation (#2758) 2021-04-12 15:58:25 -07:00
Anuraag Agrawal 826d8ac781
Cleanup mongodb tests (#2732)
* Cleanup mongodb tests

* Drift

* Cleanup

* Timeout

* Cleanup
2021-04-07 14:02:56 +09:00
Trask Stalnaker 6ea316e22e
Remove timeout annotations (#2725) 2021-04-06 16:36:18 +09:00
Lauri Tulmin 4ad9ed5c32
Reimplement finding open ports (#2629) 2021-03-25 10:41:20 -07:00
Trask Stalnaker 1a18841fdf
Apply new muzzle feature to mongo instrumentation (#2608) 2021-03-20 12:48:34 +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
Mateusz Rzeszutek f3ba2302eb
Remove unnecessary libs from the javaagent shadowJar (#2566)
* Remove unnecessary libs from the javaagent shadowJar

And make it a bit lighter: 36 MB -> 21 MB

* Apply code review comments

* Remove unnecessary kotlin exclusion
2021-03-16 10:47:05 +01:00
Trask Stalnaker 62f2611486
Update instrumentation names (#2433) 2021-03-01 19:34:25 -08: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
Jamal Fanaian bdcb2d09e8
Implement spanName for MongoClientTracer (#2307)
* Implement spanName for MongoClientTracer

Adds a basic implementation for spanName in MongoClientTracer that uses the recommended  name from the specification.

* Fix mongo4 tests

* Fix typo in test

* Handle missing dbName

* Update test with a command that has no collection as value

* Fix style issues

* Fix formatting

* remove uneeded line
2021-02-18 11:44:21 +09: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
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
Trask Stalnaker 23945d97e9
Publish lettuce and mongo common (#2148) 2021-02-01 13:26:08 +09:00
Sergei Malafeev bbcbeb51e3
MongoDB 4 driver instrumentation (#2046)
* MongoDB 4 driver instrumentation

Signed-off-by: Sergei Malafeev <sergei@malafeev.org>

* fix getting constructor

Signed-off-by: Sergei Malafeev <sergei@malafeev.org>

* fix formatting

Signed-off-by: Sergei Malafeev <sergei@malafeev.org>

* Update instrumentation/mongo/mongo-4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/mongo/v4/MongoClientInstrumentationModule.java

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

* Update settings.gradle

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

* Update instrumentation/mongo/mongo-4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/mongo/v4/MongoClientInstrumentationModule.java

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

* use mongo-4.0

Signed-off-by: Sergei Malafeev <sergei@malafeev.org>

* use public api

Signed-off-by: Sergei Malafeev <sergei@malafeev.org>

* use testImplementation

Signed-off-by: Sergei Malafeev <sergei@malafeev.org>

* use declaresField(named("commandListeners")) in typeMatcher

Signed-off-by: Sergei Malafeev <sergei@malafeev.org>

* migrate to mongo-4.0-testing

Signed-off-by: Sergei Malafeev <sergei@malafeev.org>

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-01-25 15:55:03 +02: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
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 a04a0586a5
Fix mongo-common testLatestDeps (#1818) 2020-12-01 20:18:17 -08:00
Trask Stalnaker 01b4345742
Move MongoClientTracerTest to same module as MongoClientTracer (#1804)
* Move MongoClientTracerTest to mongo-common

* Remove multi-version support

* Use library dependency
2020-12-01 14:45:45 -08:00
Trask Stalnaker 26f254b10d
Create javaagent dirs for all instrumentations, part 2 (#1794) 2020-11-28 22:26:49 -08:00
Trask Stalnaker 41bd489a77
Format groovy files (#1793) 2020-11-28 21:22:14 -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
Trask Stalnaker c3e1a321d2
Fix MongoDB testLatestDeps (#1703)
* Fix MongoDB testLatestDeps

* Codenarc
2020-11-20 09:34:25 +02:00
Jeff Yemin d093a561b9
Report only known collection names in MongoClientTracer (#1625) (#1662)
* Report only known collection names in MongoClientTracer (#1625)

* Use allow-list of commands that are known to use collection name as the value of the command
* Special-case getMore command, which uses a different field for the collection name

* Add create, drop, and createIndexes to list of commands with collection name as their values
2020-11-19 16:26:27 -08:00
Jeff Yemin 65a6293714
Improve command scrubber in MongoClientTracer (#1587) (#1663)
* Improve command scrubber in MongoClientTracer (#1587)

* Don't scrub the command field value at all if it's a string
* Use JsonWriter to improve efficiency of the scrubber
* If available, user JsonWriter.Builder.maxLength to limit size of the query string
2020-11-19 13:21:29 -08: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
Mateusz Rzeszutek 1a23ac3027
Standardize instrumentation names in InstrumentationModules (#1648)
* Standardize instrumentation names in InstrumentationModules

* rename gradle modules:
  * vertx-3.0 to vertx-web-3.0
  * spark-web-framework-2.3 to spark-2.3
* add JavaDoc describing the naming rules to InstrumentationModule
2020-11-17 13:30:28 -08:00
Mateusz Rzeszutek ef58ec1770
Refactor Instrumenters into InstrumentationModules - K, L, M (#1563) 2020-11-09 14:41:55 -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
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
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
Vadim Shaigorodskiy 9e8d663ba4
Remove apache httpclient version (#1446)
* Remove version from `apache-httpclient` instrumentation

Fixes: #1260

* Remove version from all instrumentation names and add instrumentation name to `spring-web`

Fixes: #1260
2020-10-22 14:22:44 +09:00
Ioannis Mavroukakis 191370657a
capture mongodb database name as mongo-db.name attribute instead of client description (#1419) 2020-10-19 10:52:50 -07:00
Jamal Fanaian 69ea2f7491
Add operation and collection attributes for MongoDB spans (#1398)
* Add mongodb attributes for operation and collection

* Switch to using SemanticAttributes.MONGODB_COLLECTION

* Remove unused imports

* Fix import order

* Fix formatting

* Update tests to keep more readable closure syntax

* Run spotlessApply
2020-10-19 09:20:46 +03:00
Trask Stalnaker 1b51d4a6b1
Rename packages (#1367) 2020-10-11 13:54:35 -07: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
Nikita Salnikov-Tarnovski 88707c3bb0
Review DB semantic conventions (#1284) 2020-10-01 11:17:09 -07:00
Nikita Salnikov-Tarnovski e74ffe2e52
Remove support for java7 from buildscripts (#1229)
* Remove support for java7 from buildscripts

* Remove support for java7 from buildscripts
2020-09-23 15:40:21 +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
Anuraag Agrawal 1b9b8b49b6
Separate out testing module for mongo. (#1041)
* Separate out testing module for mongo.

* Newline
2020-08-18 14:55:56 +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 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
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
Helen Y 86c438b154
Remove final from local variables (#732)
* Remove final from local variables
2020-07-20 13:53:34 +09:00
Alexey Zhokhov f3421e91a0
Remove Lombok (#672)
* Gradle 6.5.1.

* Skip download javadoc and sources automatically in IntelliJ IDEA.

* Added mavenLocal to repositories.

* Removed Lombok usage.

* Removed duplicated idea config.

* Code format.

* Removed useless usage of Objects.requireNonNull.

* Use instanceof to comparing objects.

* Code format.

* Code format.

* Fixes after merge.

* Fixed sneakyThrow exception.

* Code format.
2020-07-18 15:52:55 +03:00
Nikita Salnikov-Tarnovski 9f1ffbe38c
Remove attribute `span.origin.type` (#712) 2020-07-16 10:00:45 -07: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