Commit Graph

452 Commits

Author SHA1 Message Date
Trask Stalnaker 23b33adb0a
Auto-format groovy files in Intellij (#5260)
* Auto-format groovy files in Intellij

* A bit of clean up
2022-01-28 09:29:46 -08:00
Mateusz Rzeszutek 16335a0c47
Use HttpRouteHolder in spring-webflux instrumentation (#5239) 2022-01-28 10:07:19 +01:00
Mateusz Rzeszutek 7b04b9c707
Remove a couple of TODOs from instrumentation-api metrics tests (#5255) 2022-01-28 13:56:04 +09:00
Mateusz Rzeszutek edc185b133
Rename ServerSpanNaming to HttpRouteHolder (#5211)
* Rename ServerSpanNaming to HttpRouteHolder

* HttpRouteBiGetter
2022-01-25 09:44:15 -08:00
jason plumb fe8a132ee9
Factor out NetServerAttributesGetter (#5194)
* factor out NetServerAttributesGetter and favor composition over inheritance.

* Update instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/net/NetServerAttributesGetter.java

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

* errorprone and spotless

* spotless

Co-authored-by: Mateusz Rzeszutek <mrzeszutek@splunk.com>
2022-01-21 17:01:30 -08:00
jason plumb c5c0a2bcdf
NetClientAttributesAdapter - favor composition over inheritance (#5030)
* first pass at separating NetAttributesAdapter interface and make NetClientAttributesExtractor concrete

* rename the implementations extractor -> adapter

* hide constructor and make factory method

* rename to client and add javadoc

* spotless

* finish javadoc thought

* rebase

* renamed NetClientAttributesAdapter to NetClientAttributesGetter

* fix lettuce

* code review comments

* code review comments -- renaming for consistency

* adapter -> getter

* fix ratpack

* adapter -> getter
2022-01-20 10:51:13 -08:00
Anuraag Agrawal e6e2190f68
Fix most lint warnings. (#5180)
* Fix most lint warnings.

* Fix test
2022-01-20 18:28:45 +09:00
Anuraag Agrawal ec375116be
Fix more lint warnings (#5174)
* Fix more lint warnings

* Redisable lint

* Drift

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2022-01-20 12:48:46 +09:00
Anuraag Agrawal 52394a2ff9
Remove deprecated tracer API (#5175)
* Remove deprecated tracer API

* Groovy too
2022-01-19 09:52:51 -08:00
Mateusz Rzeszutek 1ecf493332
Fix flaky micrometer retries in javaagent test (#5168)
* Fix flaky micrometer retries in javaagent test

* remove comment

* add clarifying comment
2022-01-19 18:43:50 +09:00
Anuraag Agrawal bdd82a899e
Parameterize VirtualField field type (#5165)
Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2022-01-18 13:42:44 -08:00
Anuraag Agrawal b7a95857c7
Fix some java lint warnings (#5120)
* Convert InstrumentationTestRunner from interface to abstract class

* Foo

* Commit

* Revert unintended
2022-01-17 10:26:03 -08:00
Mateusz Rzeszutek 872c6c7d80
Add `http.route` to the server span when `ServerSpanNaming` is updated (#5086)
* Add `http.route` to the server span when `ServerSpanNaming` is updated

* fix camel tests

* fix test compilation failure

* assert route in camel instrumentation
2022-01-14 13:52:06 -08:00
Trask Stalnaker b8ea362112
Don't capture http.target as metrics attribute (#5081) 2022-01-12 17:24:47 +02:00
Trask Stalnaker 642f2c1614
Peer service optimization (#5056) 2022-01-10 10:01:28 +02:00
Nikita Salnikov-Tarnovski 1a9c633b4b
Rename some packages, move some classes (#5043)
* Rename some packages, move some classes
2022-01-09 13:26:51 +02:00
Anuraag Agrawal c75c01f871
Update to OTel 1.10 (#5035)
* Update to OTel 1.10

* Fix metric smoke test

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2022-01-07 15:45:20 -08:00
Anuraag Agrawal f6bcd76219
Update errorprone (#5016)
* Update errorprone

* gwt

* Remove unnecessary final

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2022-01-06 14:21:56 -08:00
Mateusz Rzeszutek 0fd7b8baa0
Fix time units in HTTP & RPC metrics (#4963) 2021-12-21 11:51:57 -08:00
Anuraag Agrawal 5e1e0c2642
Update to OTel 1.10 (#4866)
Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-12-16 18:46:17 +09:00
Mateusz Rzeszutek 09beb58a8c
Move SpanKey to internal package (#4869)
Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-12-14 11:27:37 -08:00
Mateusz Rzeszutek a65e9633ba
Refactor `ServerSpanNaming` (in preparation for `http.route`) (#4852)
* Refactor ServerSpanNaming (in preparation for http.route)

* fix tests

* Add ServerSpanNaming to all HTTP server instrumentations

* fix tests
2021-12-14 10:11:20 +01:00
Mateusz Rzeszutek 331ce287d2
Don't use HttpStatusConverter outside of instrumentation-api (#4870)
* Don't use HttpStatusConverter outside of instrumentation-api

* add comment
2021-12-14 10:07:18 +01:00
Mateusz Rzeszutek 93a3282490
Remove ConfigPropertiesAdatpter as it's no longer needed (#4888) 2021-12-13 12:20:11 -08:00
Mateusz Rzeszutek ca2bce9608
Deprecate the Tracer API (#4868) 2021-12-12 12:14:36 -08:00
yangtaoran c59bebf6e2
add metrics rpc conventions implement (#4838)
* add metrics rpc conventions

* handle format violations

* handle format violations

* resolve the comments suggestion

* update RpcClientMetrics format

* update RpcServerMetrics format

* resolve time precision and cardinality issue

* invoke buildServerFallbackView method

* add RpcServerMetricsTest and RpcClientMetricsTest

* server metrics attibutes remove net.perr* and add net.host

* Update instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/rpc/RpcServerMetrics.java

* Update instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/rpc/RpcClientMetrics.java

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-12-10 16:29:57 -08:00
Mateusz Rzeszutek 0bab0c2aa3
Move `ServletContextPath` to `servlet-common:bootstrap` (#4824)
* Move ServletContextPath to servlet-common:bootstrap

* fix tests

* Simplify ServletContextPath calls in restlet instrumentation
2021-12-08 15:59:31 +01:00
Trask Stalnaker 80790a409d
Add javadoc note about metrics timestamps (#4820)
* Add javadoc note about metrics timestamps

* Move to class level
2021-12-07 15:35:47 -08:00
Mateusz Rzeszutek 075434c5bc
Move `AppServerBridge` and `MappingResolver` to `servlet-common:bootstrap` (#4817)
* Move AppServerBridge and MappingResolver to servlet-common:bootstrap

* Introduce additional gradle configuration for bootstrap libs
2021-12-07 10:20:33 +01:00
Lauri Tulmin 61b0dd3698
Capture servlet request parameters (#4703)
* Capture servlet request parameters

* use concurrenthashmap for cache
2021-12-05 21:25:31 -08:00
Nikita Salnikov-Tarnovski a70682c390
Remove unhelpful benchmarks (#4766)
* Remove unhelpful benchmarks

* Restore one more benchmark

* spotless
2021-12-02 17:17:39 +02:00
Nikita Salnikov-Tarnovski 9f4686cc3d
Move cache implementations to internal package (#4746)
* Move cache implementations to internal package

* Fix import

* Fix import order
2021-11-30 21:43:03 -08:00
Trask Stalnaker f7efe07b06
Merge start and end time extractors (#4692) 2021-11-29 22:07:49 -08:00
Mateusz Rzeszutek 9a4a68d836
Add Android API-friendliness checks (#4505)
* Add Android API-friendliness checks

* Improve comments

* Remove ignores

* Handle CompletionException

* Spotless

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-11-24 12:59:11 -08:00
Nikita Salnikov-Tarnovski 821a4b870b
Drop instrumentation-api-caching module and move weak cache implementation to instrumentation-api (#4667)
* Drop instrumentation-api-caching module and move weak cache implementation to instrumentation-api

* Some test fixes

* Some cleanup

* Temporary workaround for using weak values in FutureListenerWrappers

* Spotless

* Update ClassNames and SpanNames

* Compilation and comment

* Add bounded cache and clean interface

* Polish

* Add comment

* Vendor ConcurrentLinkedHashMap in

* Let errorprone ignore vendored CLHM for now

* Keep license in java files too

* Convert Netty wrapper cache to VirtualField

* Work around lambda instrumentation failure

Ideally we would ignore instrumenting helper classes...

* Revert "Work around lambda instrumentation failure"

This reverts commit 6d63815b44.

* Revert "Convert Netty wrapper cache to VirtualField"

This reverts commit dac1522a3f.

* Handle cleared weak values

* Fix comment

* Delete instrumentation-api-caching

* Copy in weak-lock-free

* Remove caffeine remnants

* Fix checkstyle

* Rename BoundedCache to MapBackedCached

* Remove duplicate LICENSE

* Remove outdated comment

* Sync with SDK copy of weaklockfree

* Enable checkstyle:off comment

* Re-generate license report

* Move NOTICE file to package-info.java

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-11-24 09:05:12 -08:00
Trask Stalnaker 260c603784
Fix exemplars (#4678) 2021-11-20 10:42:06 -08:00
Mateusz Rzeszutek ee32c41d35
Remove LongAdder and ClassValue usages from instrumentation-api (#4671) 2021-11-18 21:29:45 -08:00
Lauri Tulmin 628df63dad
Remove a few unused methods (#4661) 2021-11-17 09:40:43 -08:00
Lauri Tulmin 625febaeb4
Sql sanitizer: sanitize double quoted strings only in couchbase queries (#4615)
* Sql sanitizer: sanitize double quotes strings only in couchbase queries

* remove unused method

* use AutoValue
2021-11-10 13:43:03 -08:00
Lauri Tulmin 16728e2445
Add a ClassAndMethod class to Instrumentation API (#4619)
* Add a ClassAndMethod class to Instrumentation API

* remove sentence

* Update docs/contributing/writing-instrumentation.md

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

* address review comment

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-11-10 13:33:11 -08:00
Roberto Cortez 21d6648c95
Add version to the InstrumenterBuilder and Instrumenter (#4611) 2021-11-09 10:21:05 -08:00
Josh Suereth d3f8ab6c82
Update HTTP metrics 'view' code to match the specification (#4556)
* Update HTTP metrics 'view' code to match the specification, including optional attribute rules.

* Update server metrics test for new logic.

* Fix client metrics test.

* Spotless fix.

* Updates from Java SiG discussion.

* Fixes from review.

* Apply suggestions from code review

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

* Update spotless from code reivew merge.

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-11-06 09:09:01 -07:00
Mateusz Rzeszutek f3ec9a215b
Document Instrumenter API (#4544)
* Document Instrumenter API

* Apply suggestions from code review

Co-authored-by: Fabrizio Ferri-Benedetti <fferribenedetti@splunk.com>
Co-authored-by: Nikita Salnikov-Tarnovski <gnikem@gmail.com>
Co-authored-by: Lauri Tulmin <tulmin@gmail.com>

* reformat and code review comments

* code review comments

* Apply suggestions from code review

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

* formatting

Co-authored-by: Fabrizio Ferri-Benedetti <fferribenedetti@splunk.com>
Co-authored-by: Nikita Salnikov-Tarnovski <gnikem@gmail.com>
Co-authored-by: Lauri Tulmin <tulmin@gmail.com>
Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-11-05 15:15:48 +01:00
Lauri Tulmin e31439ee0d
Fix context propagation in tomcat thread pool (#4521) 2021-10-27 16:52:55 -07:00
Nikita Salnikov-Tarnovski 3d92cd2337
Add javadoc to ServletContextPath method (#4484)
* Add javadoc to ServletContextPath method

* Normalise span name and add test

* Update instrumentation-api/src/test/java/io/opentelemetry/instrumentation/api/servlet/ServletContextPathTest.java

Co-authored-by: Lauri Tulmin <tulmin@gmail.com>

Co-authored-by: Lauri Tulmin <tulmin@gmail.com>
2021-10-25 13:44:02 -07:00
Martin d314d76fce
rename `newBuilder()` to `builder()` (#4475)
* rename `newBuilder()` to `builder()`

* rename `newBuilder()` to `builder()`
2021-10-22 20:50:43 -07:00
Mateusz Rzeszutek 05a391459b
Stabilize HTTP headers capturing configuration property names (#4459)
* Stabilize HTTP headers capturing configuration property names

* code review comments
2021-10-21 21:56:20 -07:00
Trask Stalnaker e9022da102
Remove unshaded javax.annotation classes from bootstrap class loader (#4454)
* Fix shading

* Revert "Fix shading"

This reverts commit 2aad3cfe21.

* Make javax.annotations compileOnly

* Replace checker GuardedBy with otel api internal GuardedBy

* Fix build

* Fix errorprone failures

* Remove extra newline

* Move internal GuardedBy to instrumentation-api

* empty commit

* empty commit
2021-10-21 14:47:50 -07:00
jason plumb a50c13382f
Don't report 400 level as error for SERVER spans (#4403)
* don't report 400 level as error for server spans

* fix HttpServerTest base class

* fix JspInstrumentationForward test

* split HttpStatusConverter into client and server implementations, and create two HttpSpanStatusExtractor.create methods, one for server and one for client.

* rebase

* fix test

* spotless

* fix test

* remove unused

* use strongly typed attributes converters and rename to overloaded create()

* fix tests

* remove redundant assert

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-10-20 13:39:35 -07:00
Trask Stalnaker 35dd350625
Capture metric dimensions from end attributes also (#4430)
* Capture metric dimensions from end attributes also

* Fix test

* Update tests
2021-10-20 09:29:03 -07:00
Mateusz Rzeszutek b6728de75f
Migrate Grizzly to Instrumenter API (#4409)
* Migrate Grizzly to Instrumenter API

* javax.annotation.Nullable

* Preserve the caught exception in the Context until end() is called

* rename to GrizzlyErrorHolder
2021-10-18 22:55:17 -07:00
Martin 6d9e3618d3
rename `newBuilder()` to `builder()` (#4407)
* rename `newBuilder()` to `builder()`

* code format
2021-10-18 10:00:49 -07:00
Nikita Salnikov-Tarnovski c119fa1bf6
Remove more usages of checker's Nullable (#4410) 2021-10-18 17:32:25 +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
Nikita Salnikov-Tarnovski efddb72cef
Convert AttributesExtractor to interface (#4363) 2021-10-14 08:36:47 +03:00
Mateusz Rzeszutek ff8696586d
Remove VirtualField#computeIfNull() method (#4354) 2021-10-12 11:37:35 -07:00
Nikita Salnikov-Tarnovski 55f987613a
Remove deprecated ServerSpanNaming.updateSource method (#4327)
* Remove deprecated ServerSpanNaming.updateSource method
2021-10-12 13:45:18 +03:00
Mateusz Rzeszutek 51cf64bb3f
Add @UnstableApi annotation to the ExperimentalConfig class (#4346) 2021-10-11 12:50:11 -07:00
Anuraag Agrawal f208ba72b7
Update to OTel 1.7 (#4340)
* Update to OTel 1.7

* Fix metrics tests
2021-10-11 19:52:50 +09:00
Nikita Salnikov-Tarnovski 99f6bcde92
Convert AwsSdk1 to Instrumenter API (#4315)
* Convert AwsSdk1 to Instrumenter API

* Apply suggestions from code review

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

* Polish

* Polish and tests

* Polish

Co-authored-by: Mateusz Rzeszutek <mrzeszutek@splunk.com>
2021-10-08 10:48:41 -07:00
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 9476f86920
Remove deprecated ServerSpanNaming.updateServerSpanName method (#4318) 2021-10-07 10:16:50 -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
Mateusz Rzeszutek d3dbe415a1
Move HttpHeadersConfig methods back to instrumentation-api (#4298)
* Move HttpHeadersConfig methods back to instrumentation-api

* remove unnecessary method
2021-10-06 10:51:45 +02:00
Nikita Salnikov-Tarnovski c28374615b
Add functionality to generate API changes (#4285)
* Add functionality to generate API changes

* Update conventions/src/main/kotlin/otel.japicmp-conventions.gradle.kts

Co-authored-by: John Watson <jkwatson@gmail.com>

* Do not commit any API changes until we have stable release

Co-authored-by: John Watson <jkwatson@gmail.com>
2021-10-06 09:59:01 +03:00
Mateusz Rzeszutek 66d58aa0a6
Move clientIp extraction to HttpServerAttributesExtractor (#4301)
Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-10-05 16:08:17 -07:00
Mateusz Rzeszutek 7791be24e0
Remove implementations of host() and userAgent() in HTTP extractors (#4299)
* Remove implementations of host() and userAgent() in HTTP extractors

* fix broken headers copying
2021-10-05 10:25:45 -07:00
Mateusz Rzeszutek 7473eff1e6
Extract HTTP request/response headers as span attributes (#4237)
* Extract HTTP request/response headers as span attributes

* fix muzzle

* code review comments

* fix compilation failure after merge conflict

* avoid using streams API when transforming the headers list

* fix liberty extractor

* fix spring webmvc extractor
2021-10-05 10:20:59 +02:00
Trask Stalnaker dafc97f96e
Simplify gradle files (#4292) 2021-10-04 21:53:35 -07:00
Mateusz Rzeszutek 9d6fb65b41
Remove ContextStore/InstrumentationContext mentions from internal age… (#4267)
* Remove ContextStore/InstrumentationContext mentions from internal agent classes

* Fix internal-reflection module
2021-10-04 09:24:25 -07:00
Trask Stalnaker 506ae2b894
Flavor extractor (#4274) 2021-10-04 09:23:58 -07:00
Trask Stalnaker 92394ad9ae
Remove url from HttpServerAttributesExtractor (#4209)
* Remove url from HttpServerAttributesExtractor

* Remove UriBuilder

* Tracers too

* apache-camel

* Finatra

* jsp

* Ratpack

* Ratpack library

* Ratpack

* Spark

* Feedback

* Fix Undertow

* Vertx

* vertx-web

* play-2.4

* webflux

* jaxrs

* Spotless

* Update semantic-conventions.md

* Update smoke tests

* More realistic target

* Remove outdated doc

* Wording
2021-10-03 09:17:23 -07:00
Mateusz Rzeszutek c421b66d56
Remove unnecessary VirtualField#setIfNull() method (#4262) 2021-10-02 13:17:48 -07:00
Lauri Tulmin 033c20a3d9
Fix flaky StatementSanitizationConfigTest (#4264) 2021-10-02 10:52:03 -07:00
Nikita Salnikov-Tarnovski bfeb482465
Convert Elasticsearch Transport to Instrumenter API (#4252)
* Convert Elasticsearch Transport to Instrumenter API

* Don't set duplicate attributes

* Code review comments
2021-10-01 13:45:29 +03: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
Martin 95099144ab
add test for StatementSanitizationConfig (#4211)
* add test for StatementSanitizationConfig

* adjust code style
2021-09-30 09:59:16 -07:00
Nikita Salnikov-Tarnovski 5e6bc60dae
Resolve some Gradle warnings (#4234)
* Resolve some Gradle warnings

* spotless
2021-09-29 10:01:48 -07:00
Trask Stalnaker 9ea33edf08
Remove attrs from http client attributes extractor (#4210)
* Remove scheme/host/target from HttpClientAttributesExtractor

* And jaxrs-client

* Remove unused methods
2021-09-28 12:58:42 -07:00
Lauri Tulmin ba3370e054
Build servlet mapping resolver only when needed (#4197)
* Build servlet mapping resolver only when needed

* move factory interface to boot loader to ensure that everybody has the same class for it

* spotless

* Helper classes should not look up ContextStore on each access
2021-09-27 18:04:22 +03:00
Mateusz Rzeszutek a277a8b636
Separate HTTP client/server AttributesExtractors (#4195) 2021-09-24 10:06:23 -07:00
Trask Stalnaker 3ce940548c
Experimental option to suppress messaging receive spans (#4187)
* Experimental option to suppress messaging receive spans

* Kafka streams too

* Better conditionals

* Remove oops

* Extract base class for kafka streams tests

* Spotless
2021-09-22 21:50:05 -07:00
Trask Stalnaker 8066f2787c
Add context customizer hook to Instrumenter API (#4167)
* Add context customizer hook to Instrumenter API

* Use in tomcat instrumentation

* Some of servlet

* Use in rest of servlet

* Feedback
2021-09-22 14:54:04 -07:00
Mateusz Rzeszutek a8b6faf27d
Add start/end time to RequestListener (#4155) 2021-09-21 13:52:05 -07:00
Lauri Tulmin 59439cb464
Make servlet context path key private (#4125)
* Make servlet context path key private

* remove accidentally added files

* fix servlet2.2

* use non capturing lambda

* Update instrumentation/servlet/servlet-common/library/src/main/java/io/opentelemetry/instrumentation/servlet/ServletHttpServerTracer.java

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

* use method reference

Co-authored-by: Mateusz Rzeszutek <mrzeszutek@splunk.com>
2021-09-16 10:23:29 -07:00
Anuraag Agrawal 971ca8b19c
Update to OTel 1.6 (#4120)
* Update to OTel 1.6

* Example build

* More example

* More example
2021-09-14 20:12:18 +09:00
Mateusz Rzeszutek 2621ca123e
Make InstrumenterBuilder javadoc about span suppression a bit clearer (#4113)
* Make InstrumenterBuilder javadoc about span suppression a bit clearer

* Update instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/InstrumenterBuilder.java

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

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-09-13 11:40:31 -07:00
Lauri Tulmin 15277cf8f5
Convert servlet instrumentation to instrumenter api (#4078)
* Convert servlet to instrumenter api

* make classes final

* Remove some tracer files

* remove xxx

* fix liberty and wildfly exception smoke test

* fix async smoke test on liberty

* Apply suggestions from code review

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

* generic TextMapGetter for servlets

* not going to use http.route for servlets

* simplify

* add servlet timeout in attribute extractor

* move classes from library to javaagent

* remove unneeded dependency

* make method private

* move helper class initialization to singleton, remove helpers that don't have any methods, add shouldStart checks

* Update instrumentation/servlet/servlet-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/servlet/ServletRequestContext.java

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

* add import

* rename methods that start and end spans

Co-authored-by: Mateusz Rzeszutek <mrzeszutek@splunk.com>
2021-09-13 10:12:34 -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
Mateusz Rzeszutek 05d1a4a54f
Separate suppression strategies for CONSUMER receive/process spans (#4076)
* Separate suppression strategies for CONSUMER receive/process spans

* Update instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/SpanKeyExtractor.java

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

* spotless

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-09-10 10:55:50 -07:00
Mateusz Rzeszutek 4820ec4855
Add error parameter to EndTimeExtractor and AttributesExtractor#onEnd() (#3988) 2021-09-08 07:58:13 -07:00
Trask Stalnaker 400d99467a
Follow http.client_ip spec clarification (#4063) 2021-09-08 07:54:59 -07:00
Trask Stalnaker ec99db5e5b
Support empty values in config maps (#4037)
* Support empty values in config maps

* Rename method
2021-09-02 16:00:29 +09:00
Mateusz Rzeszutek 62eae30a60
Make Config behave exactly as SDK DefaultConfigProperties (#4035)
* Make Config behave exactly as SDK DefaultConfigProperties

* errorprone

* errorprone part 2

* errorprone part 3

* fix failing tests
2021-08-31 10:00:04 -07:00
Anuraag Agrawal 96f5708655
Fix parsing of unclean map values in Config. (#4032) 2021-08-31 14:57:55 +09:00
Trask Stalnaker 65335962de
Remove capturing lambda (optimization) (#4014)
* Remove capturing lambda

* Update instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/servlet/ServerSpanNameSupplier.java

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

* Update instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/servlet/ServerSpanNameTwoArgSupplier.java

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

* Update instrumentation/jsf/jsf-common/library/src/main/java/io/opentelemetry/instrumentation/jsf/JsfServerSpanNaming.java

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

* checkstyle

Co-authored-by: Mateusz Rzeszutek <mrzeszutek@splunk.com>
2021-08-30 20:26:00 -07:00
Trask Stalnaker 0f9308b4fb
Optimize tomcat uri construction (#4008)
* Optimize tomcat uri construction

* Add TODO
2021-08-30 13:34:23 -07:00
Trask Stalnaker dc4e239722
Add span names cache (#4004)
* Add span names cache

* Simplify
2021-08-30 09:02:27 -07:00
Mateusz Rzeszutek 4567bc0c2f
Instrument spring-kafka batch message listeners (#3922)
* Instrument spring-kafka batch message listeners

* Update instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/InstrumenterBuilder.java

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

* fix compilation failure

* Suppress nested CONSUMER spans

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-08-27 08:02:37 -07:00
Mateusz Rzeszutek 585cc55921
Add request param to EndTimeExtractor (#3947) 2021-08-27 14:34:47 +02:00
Trask Stalnaker fec5ed2290
Fix metrics cardinality (#3972)
* Fix metrics cardinality

* Add test
2021-08-27 10:45:19 +09:00
Lauri Tulmin b5aec6a2e0
Bridge span keys defined in instrumentation api (#3911) 2021-08-25 20:25:37 -07:00
Trask Stalnaker 6f22d90aa6
Option to suppress controller and view spans (#3865)
* Add option to suppress controller and view spans

* Apply to all existing Instrumenters

* Introduce ExperimentalConfig

* Singleton?

* No need for lazy
2021-08-25 13:43:38 -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
Mateusz Rzeszutek 5c71d28ed7
Remove deprecated Config methods (#3908) 2021-08-23 16:44:54 -07:00
jason plumb 0255e8e95f
Add NamingConventionTest (#3814)
* verify some behaviors of the NamingConvention class.

* document that system property hyphens and underscores don't actually normalize the same

* spotless
2021-08-20 13:50:53 -07:00
Mateusz Rzeszutek 8200319d2a
Rename Config get*Property() methods to get*() (#3881) 2021-08-20 09:32:41 -07:00
Mateusz Rzeszutek ca8a119e01
Don't pass configuration to SDK autoconfigure through system props (#3866)
* Don't pass configuration to SDK autoconfigure through system props

* suppress CanonicalDuration

* checkstyle
2021-08-19 16:56:12 -07:00
Anuraag Agrawal d8eae4997d
Update to SDK 1.5.0 (#3847) 2021-08-17 08:43:11 -07:00
Liudmila Molkova 080c85df85
Client span keys: suppressing same instrumentation (#3691) 2021-08-14 13:44:46 -07:00
Mateusz Rzeszutek 92a69c3309
Simplify shouldStart() check for SERVER & CONSUMER spans (#3771) 2021-08-10 21:00:34 -07:00
Mateusz Rzeszutek beab394960
Add a few missing @Nullables in instrumentation-api (#3806) 2021-08-10 16:46:35 +02:00
Anuraag Agrawal 8cbec715ff
Fill HTTP_CLIENT_IP in ServerInstrumenter (#3756) 2021-08-05 13:11:30 +09:00
Trask Stalnaker 91b302a7d2
Reduce overhead of unsampled requests (#3681)
* Optimize sampled out requests

* Comment
2021-07-27 17:00:00 -07:00
Trask Stalnaker 83b5121f75
Handle port and IPv6 in forwarded headers (#3651)
* Handle port and IPv6 in forwarded headers

* More IPv6...

* Test proper quoted host:port for Forwarded case
2021-07-23 10:59:55 +03:00
Anuraag Agrawal 04c070ccc1
Add HTTPClientMetrics (#3598)
* Add HTTPClientMetrics

* Update instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpClientMetrics.java

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

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-07-16 18:22:35 +09:00
HaloFour 256e8f2a64
Move async strategies to annotation support (#3574)
* Move async strategies to annotation support

* Fix dependencies and refactor copypasta

* Move AsyncSpanEndStrategy to annotation support project

* spotless
2021-07-16 10:55:23 +02:00
Mateusz Rzeszutek c1b5c0884d
Move caffeine patching to instrumentation-api-caching (#3559) 2021-07-14 13:59:50 +02:00
Mateusz Rzeszutek 71e7d666ed
Convert OkHttp 3 to Instrumenter API (#3538)
* Convert OkHttp 3 to Instrumenter API

* code review

* Update instrumentation/okhttp/okhttp-3.0/library/src/main/java/io/opentelemetry/instrumentation/okhttp/v3_0/OkHttpAttributesExtractor.java

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

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-07-13 18:41:19 -07:00
Trask Stalnaker d0cb08a37b
Rename javaagent-api artifact to javaagent-instrumentation-api (#3513)
* part 1

* part 2

* Undo change in examples

* Spotless
2021-07-12 21:53:49 -07:00
HaloFour 3e8d3e88bf
Update OpenTelemetry to version 1.4.0 (#3541)
* Update to OpenTelemetry 1.4.0

* Fix breaking changes with opentelemetry-api-metrics
2021-07-10 15:53:02 +09:00
Trask Stalnaker da75a7a6c6
Style guide section for Nullable annotation usage (#3499)
* Style guide section for Nullable annotation usage

* Set default to non-null

* More doc

* Review feedback
2021-07-08 08:54:26 -07:00
Trask Stalnaker 9e4da754c2
Use consistent logger field name (#3515) 2021-07-07 10:47:46 -07:00
Trask Stalnaker 0299428017
Fix maven packaging for instrumentation-api-caching (#3471)
* Fix maven packaging for instrumentation-api-caching

* Use new shadow pattern
2021-07-05 23:14:48 -07:00
Trask Stalnaker f5d6b39b72
Update Apache HttpAsyncClient to Instrumenter API (#3490) 2021-07-05 14:08:38 -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 93632d3f27
Rename instrumentation-api builds to kotlin (#3446)
* Rename instrumentation-api builds to kotlin

* Migrate

* Small cleanup
2021-06-30 19:20:55 +09:00
Mateusz Rzeszutek c1a0333cdb
Port AsyncSpanEndStrategy to Instrumenter API (#3262)
* Port AsyncSpanEndStrategy to Instrumenter API

* code review comments

* rename to AsyncOperationEndSupport

* weak-ref agent strategy storage; and passing response to Instrumenter if types match

* fix tests
2021-06-29 16:51:17 +02:00
Anuraag Agrawal 153bf1457a
Simplify jflex configuration (#3431) 2021-06-29 20:15:15 +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
Trask Stalnaker bcb282a220
Conform to google style guide checkstyle (#3399) 2021-06-24 10:53:23 +03: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
Mateusz Rzeszutek 0a8907d927
Hide Config#create() method and use builder everywhere (#3338)
* Hide Config#create() method and use builder everywhere

* Deprecate Config#asJavaProperties()
2021-06-17 10:39:39 -07:00
Anuraag Agrawal 91a2c18f30
Migrate jacoco.gradle to plugin (#3330) 2021-06-16 10:09:05 -07:00
Mateusz Rzeszutek 3e28b01e42
Spring Integration javaagent instrumentation (#3295)
* Spring Integration javaagent instrumentation

* codenarc

* inline gradle property

* Conditionally create CONSUMER spans instead of always INTERNAL

* merge fix

* Add attributes assertions to rabbitMq test

* minor fix

* fix javadocs

* Code review follow-up
2021-06-16 14:12:39 +03:00
Anuraag Agrawal a818f14957
Migrate publish.gradle to convention plugin (#3312)
* Migrate publish.gradle to convention plugin

* Migrate usages of publish.gradle

* Remove publish.gradle

* Newline
2021-06-15 22:12:48 +09: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 9f31a057b6
Refactor span names class (#3281)
* spanNameForMethod

* spanNameForClass

* Cache simple name using ClassValue
2021-06-14 11:56:40 -07: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
Mateusz Rzeszutek 1cc893b009
Spring Integration library instrumentation (#3120)
* Spring Integration library instrumentation

* testLatestDeps

* attributesExtractor

* errorprone

* Code review comments

* rename package messaging -> integration

* move package in groovy files too

* thread local map

* Revert "thread local map"

This reverts commit 7c8d614f4c.

* Always extract parent SpanContext from the incoming message

* checkstyle

* codenarc
2021-06-10 14:51:32 +02:00
Trask Stalnaker e9c3df6dac
Static factory method ordering (#3206) 2021-06-07 15:29:30 -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 c3ed9a381b
Add an optimized Attributes implementation for instrumenter (#3136) 2021-05-31 10:42:15 +09:00
dengliming ca5b792f95
Update methods-javaagent to Instrumenter API (#3070)
* Update methods-javaagent to Instrumenter API

Signed-off-by: dengliming <liming.d.pro@gmail.com>

* introduce SpanNames

Signed-off-by: dengliming <liming.d.pro@gmail.com>

* Add test for SpanNames

Signed-off-by: dengliming <liming.d.pro@gmail.com>

* Fix merge

* Codenarc

* Remove unused dep

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-05-28 17:23:50 -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
Lauri Tulmin 35d6bdb730
Hibernate query span naming (#3106)
* Hibernate query span naming

* remove commented out code

* modify query sanitizer to accept queries that start with from clause

* add sql sanitizer test for queries starting with from

* rename hibernate-4.3 to hibernate-procedure-call-4.3
2021-05-28 11:31:52 -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
Ago Allikmaa 165bc1e492
Akka propagation fix and concurrency tests (#3099) 2021-05-27 09:43:09 -07:00
Anuraag Agrawal acedbff78d
Migrate gRPC to Instrumenter API (#3073)
* Migrate gRPC to Instrumenter API

* Don't unwrap grpc exception

* Fix merge and cleanup
2021-05-27 15:40:53 +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
Trask Stalnaker a6c3d80b50
Update cassandra-3.0 to Instrumenter API (#3066) 2021-05-25 21:45:03 -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 1583683aec
Add Nullable to Instrumenter API response args (#3041) 2021-05-24 09:14:48 -07:00
Trask Stalnaker f11bd75710
Don't use singleton for propagator getters/setters (#3054) 2021-05-21 11:48:54 -07:00
Trask Stalnaker 329233e576
Change a couple of Longs to Integers in Instrumenter API (#3043) 2021-05-20 14:33:22 -07:00
Anuraag Agrawal 4b1714c3f4
Update to Gradle 7.0 (#2983)
* Update to Gradle 7.0

* Fix scala

* Restore accidental

* Fix deprecations
2021-05-14 11:52:20 +09:00
Anuraag Agrawal 057d8861fa
Record HTTP server metrics in instrumenter API. (#2877)
* Record HTTP server metrics in instrumenter API.

* Fix

* Response attributes

* Start cleaning

* Docs

* Test

* Finish test

* Cleanups

* Cleanups
2021-05-12 17:49:12 +09:00
Lauri Tulmin d29bf39428
Don't set span status to unset (#2956) 2021-05-11 16:14:19 -07:00
Trask Stalnaker 10db083e77
Update to OTel API/SDK 1.2.0 (#2945)
* Update to OTel API/SDK 1.2.0

* TCP.IP -> tcp_ip

* Fix smoke tests
2021-05-10 10:14:07 -07:00
Hangzhi 60ee981d07
Prevent http.url containing credentials in HttpClientTracer (#2707)
* http.url must not contain credentials

* remove user info from url

* Update HttpClientTracerTest.groovy

fix inconsistency in protocol

* fix httpClient and httpServer

* Update HttpServerTracer.java

* Only scrub userinfo if present

Co-authored-by: Anuraag Agrawal <aanuraag@amazon.co.jp>
2021-05-06 23:31:26 -07:00
Lauri Tulmin 1fba62807f
Resteasy server span naming (#2900)
* Resteasy server span naming
2021-05-06 15:04:56 +03:00
Lauri Tulmin 357140c081
Server span naming for servlet filters (#2887)
* Server span naming for servlet filters

* wildfly default servlet has empty mappings

* jetty11 requires java11

* try a differnt way to disable jetty11 tests on java8

* Update instrumentation/servlet/servlet-5.0/javaagent/src/test/groovy/TomcatServlet5FilterMappingTest.groovy

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

* review fix

* rework to use InstrumentationContext

* remove debugging code

* move MappingResolver to avoid ClassCastException on wildfly

* Update instrumentation/servlet/servlet-3.0/javaagent/src/test/groovy/TomcatServlet3FilterMappingTest.groovy

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

* review fixes

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
Co-authored-by: Mateusz Rzeszutek <mrzeszutek@splunk.com>
2021-05-06 13:25:17 +03: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
Nikita Salnikov-Tarnovski 9e9fe118fb
Update NamingConvention.java (#2913)
Improved wording.
2021-05-05 09:42:04 -07:00
Mateusz Rzeszutek e00341729f
Use Instrumenter in JMS instrumentation (#2803)
* Use Instrumenter in JMS instrumentation

And introduce messaging semantic conventions

* Code review comments

* Use Instrumenter in JMS instrumentation - code review comments

* remove useless test

* fix missing instrumentation version

* Code review comments

* Do not allow conditional delegation to SDK
2021-05-05 10:35:39 +03:00
Anuraag Agrawal a66a13f938
Only reset server context if there is a leak. (#2876)
* Only reset server context if there is a leak.

* Spot
2021-04-28 15:35:49 +09:00
Trask Stalnaker 1824e36b96
Better server span name for Grails and Wicket (#2814) 2021-04-22 14:16:54 -07:00
Lauri Tulmin 9f8371e77c
Use locale insensitive lower/upper case conversion (#2838) 2021-04-22 11:24:13 +09:00
Mateusz Rzeszutek ce3a88ca8c
Move ContextPropagationDebug to internal package (#2804)
And use it in the Instrumenter API
2021-04-14 10:12:36 -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
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
Mateusz Rzeszutek 42cf3bc077
Record internal metric for SQL cache misses (#2747)
* Record internal metric for SQL cache misses

And use `SupportabilityMetrics` in `Instrumenter`

* Fix broken shouldStart() logic

* Code review comments
2021-04-08 17:50:48 +02:00
Trask Stalnaker 6ea316e22e
Remove timeout annotations (#2725) 2021-04-06 16:36:18 +09:00
Anuraag Agrawal cc47da585b
New Instrumenter API (#2596)
* Instrumenter

* Spotless

* More instrumenter

* More

* Instrumenter API

* New Instrumenter API - InstrumenterBuilder (#20)

* New Instrumenter API - InstrumenterBuilder

* New Instrumenter API - InstrumenterBuilder - code review comments

* Start doccing

* Docs

* Most tests

* Last test

* Stick with current hostName lookup for now

* Update testing-common/src/main/groovy/io/opentelemetry/instrumentation/test/base/HttpClientTest.groovy

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

* New Instrumenter API - code review comments (#21)

* Doc

* Checkstyle

* Cleanups

Co-authored-by: Mateusz Rzeszutek <mrzeszutek@splunk.com>
2021-04-05 15:45:07 +09:00
HaloFour bf8ea885f2
Add AsyncSpanEndStrategy implementation for RxJava 2 instrumentation (#2665) 2021-04-04 22:05:01 -07:00
Lauri Tulmin 949d82fbef
Reset context class loader for new thread (#2691) 2021-04-01 16:29:11 -07:00
HaloFour 9a5c65284f
Rename Jdk8AsyncEndStrategy to Jdk8AsyncSpanEndStrategy (#2664) 2021-03-30 19:09:27 -07:00
HaloFour b0d27405eb
Add asynchronous tracing to Spring Boot Autoconfigure WithSpanAspect (#2618) 2021-03-29 16:35:08 -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
Trask Stalnaker 0ce9ca57d9
Move attributes to span builder for use by samplers (#2587)
* Move attributes to span builder for sampler use

* Fix test

* Remove unnecessary test
2021-03-17 15:02:56 +02: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
Anuraag Agrawal cf6d9deb4e
Extract library instrumentation for lettuce 5.1 (#2533) 2021-03-10 10:03:53 +09: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
Mateusz Rzeszutek 3dff44874f
Fix RestTemplateInterceptor so that it calls endExceptionally() on exception (#2516) 2021-03-08 09:36:47 -08:00
Mateusz Rzeszutek fe4d95a689
Refactor BaseTracer#onError() method (and unwrapThrowable()) (#2513)
* Refactor BaseTracer#onError() method (and unwrapThrowable())

Also remove the deprecated BaseTracer(Tracer) constructor.

* Update BaseTracer javadoc

* fix tests

* Code review comments
2021-03-08 15:08:26 +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
Trask Stalnaker 5162c023bc
Updates to thread propagation debug property (#2500) 2021-03-05 11:02:36 -08:00
Mateusz Rzeszutek 72ffb3b7c5
Make BaseTracer fields private (#2492)
* Make BaseTracer fields private

By making `tracer` private we're forcing all tracer implementation to use the `spanBuilder()` utility method and pass the parent context manually.
2021-03-05 10:54:00 -08:00
Anuraag Agrawal d7f8967ff6
Add a caching API based on caffeine for use from instrumentation, not just javaagent (#2477)
* Add caching API

* Finish

* javadoc

* Extract dep

* git add

* Drift

* Spotbugs

* checkstyle

* Fix package

* Test Caffeine patch
2021-03-05 17:57:23 +09:00
Lauri Tulmin 29790d8472
Low cardinality name for servlet span (#2417) 2021-03-04 12:39:37 -08:00
Trask Stalnaker 0abc492bc3
Rename more properties (#2486)
* Rename more props to experimental

* Rename more properties

* Rename .internal to .testing

* Revert changes to examples distro

* Move chunk.new-trace to experimental

* Fix unrelated build issue
2021-03-04 11:20:47 -08:00
Mateusz Rzeszutek 8242a01b3a
Clean up and document BaseTracer (#2482) 2021-03-04 11:21:46 +01:00
Mateusz Rzeszutek fbe55e04aa
Use low cardinality span names in Cassandra instrumentation (#2423) 2021-03-03 17:54:44 +01:00
Mateusz Rzeszutek 04d6fb67ff
Move SERVER and CLIENT span context keys out of BaseTracer (#2468)
* Move SERVER and CLIENT span context keys out of BaseTracer

Inspired by https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues/1726#issuecomment-731890267

* Rename context keys

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

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-03-03 16:12:42 +01:00
Mateusz Rzeszutek a139d72014
Initialize Config for library instrumentations (#2467)
* Initialize Config for library instrumentations

Extracted from https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/2434

* Fix tests
2021-03-03 09:55:14 +02:00
Anuraag Agrawal 9f3dfdbc51
Use atomic updaters instead of atomic fields to reduce allocations fo… (#2462)
* Use atomic updaters instead of atomic fields to reduce allocations for commonly created objects.

* Typo
2021-03-03 14:56:37 +09:00
Mateusz Rzeszutek 8f3ea83504
Move some classes out of instrumentation-api (#2466)
* MethodsConfigurationParser is moved to javaagent-tooling - it's only used in some instrumentation modules
* BootstrapPackagePrefixesHolder is moved to javaagent-api - it just needs to be in the bootstrap CL for the classloader instrumentation, so it does not necessarily need to be instrumentation-api
2021-03-02 10:31:53 -08:00
Trask Stalnaker c838498a73
Rename two props to otel.instrumentation.common.* (#2457) 2021-03-02 10:25:36 -08:00