Commit Graph

138 Commits

Author SHA1 Message Date
Mateusz Rzeszutek 714ba9189e
Remove deprecated `http.host` and `http.server_name` attributes (#6709)
... and make sure the `TemporaryMetricsView` follows the current spec
2022-09-24 11:02:21 -07:00
Trask Stalnaker 429ecfc713
Update error prone (#6646)
(note that change from BDDMockito is due to
https://github.com/google/error-prone/issues/3396)
2022-09-23 11:24:40 -07:00
Mateusz Rzeszutek cfdbe758f2
Net attributes getters changes (in preparation for HTTP spec impl) (#6503)
* Net attributes getters changes: instrumentation-api-semconv changes

* Net attributes getters changes: getter implementations

* Net attributes getters changes: test fixes

* Remove net.sock.host.name

* code review comments

* default getter methods & getPeerSocketAddress() method name

* set authority in grpc earlier
2022-09-12 09:20:27 -07:00
Trask Stalnaker f1774cabe2
Update net semantic convention changes (#6268)
* New net conventions: option a

* Feedback + sock.family + sock.peer.name

* peer.service + tests

* server net attributes attempt 1

* server net attributes attempt 2

* Javadoc

* Revisions

* Apply to instrumentations

* Feedback

* One more default method

* Spotless

* Fix javadoc
2022-08-18 09:02:23 -07:00
Mateusz Rzeszutek 6cd79b2a94
Deprecate the 2-arg variant of HttpCommonAttributesGeter#statusCode() (#6466)
* Deprecate the 2-arg variant of HttpCommonAttributesGeter#statusCode()

* fix liberty
2022-08-12 17:11:11 -07:00
Mateusz Rzeszutek 08f013f9d6
Update gradle to 7.5.1 (#6359)
* Update gradle to 7.5

* Bump to 7.5.1

* gradle 7.5.1 with jdk17

* spotless

* one more --add-opens

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
Co-authored-by: Lauri Tulmin <ltulmin@splunk.com>
2022-08-12 12:03:43 +02:00
Trask Stalnaker 68a9f20eb3
Enable PrivateConstructorForUtilityClass errorprone check (#6427)
* PrivateConstructorForUtilityClass

* Advice

* More advice

* More

* More advice

* More

* Spotless

* Fix

* Fix

* Fix

* A better solution

* Revert

* More

* Fix

* Spotless

* Fix
2022-08-10 11:30:22 +03:00
Mateusz Rzeszutek b2c90c79b5
Extract HTTP request & response content length from headers (#6415)
* Extract HTTP request & response content length from headers

* remove unused method

* fix camel tests

* fix google http client tests

* fix HttpUrlConnection tests

* fix k8s and jaxrs tests

* fix aws tests

* actually fix aws tests 🤞

* fix elasticsearch tests

* fix ratpack tests

* fix spring webflux tests

* fix vertx tests

* fix reactor netty tests
2022-08-05 10:55:47 -07:00
Mateusz Rzeszutek 5a152cd289
Deprecate uncompressed content length HTTP attributes (#6383) 2022-07-29 06:17:38 +02:00
Mateusz Rzeszutek 82b39b1012
Rename `newInstrumenter()` into `buildInstrumenter()` (#6363)
* Rename newInstrumenter() into buildInstrumenter()

* spotless
2022-07-25 12:02:46 -07:00
Mateusz Rzeszutek 3af56e7d22
InstrumentationConfig part 3: HTTP headers and peer service mappings (#6302) 2022-07-15 14:52:52 -07:00
Mateusz Rzeszutek afee828846
Use metrics batch API in connection pool instrumentations (#6231)
* Use metrics batch API in connection pool instrumentations

* Fix vibur muzzle

* Fix vibur muzzle
2022-07-05 13:47:15 +02:00
Lauri Tulmin 30248684d1
Capture enduser.id in servlet instrumentation (#6225)
* Capture enduser.id in servlet instrumentation

* delete TomcatAdditionalAttributesExtractor

* spotless

* spotless
2022-06-27 21:03:54 -07:00
jason plumb f1a746dca5
Add tomcat-jdbc connection pool metrics instrumentation (#6102)
* add tomcat-jdbc connection pool metrics instrumentation

* use duration

* code review comments

* remove unnecessary awaits

* udpate supported-libraries.md

* add comment about weakmap

* add sleeps for safety
2022-06-02 16:18:07 -07:00
Mateusz Rzeszutek 87b412fb40
Instrumentation API changes: OperationMetrics, OperationListener (#6016)
* Instrumentation API changes: OperationMetrics, OperationListener

* errorprone
2022-05-12 11:16:46 -07:00
Mateusz Rzeszutek d919f84cf8
Merge javaagent-instrumentation-api into javaagent-extension-api (#5936)
* Merge javaagent-instrumentation-api into javaagent-extension-api

* remove some leftover references to javaagent-instrumentation-api

* add missing instrumentation-api to distro example
2022-04-28 20:11:15 -07:00
Mateusz Rzeszutek 50f91e6dee
Deprecate AttributesExtractor#set() method (#5749)
* Deprecate AttributesExtractor#set() method

* code review comments
2022-04-05 20:20:02 -07:00
Lauri Tulmin 8d513f9099
Make tests provide expected exception instance instead of class (#5540)
* Make tests provide expected exception instance instead of class

* exception is optional
2022-03-11 14:24:03 +02:00
Lauri Tulmin e9c1efece2
Update to Groovy 4 (#5532)
* Update to Groovy 4

* exclude spock from grails tests, update comment

* Update instrumentation/grails-3.0/javaagent/build.gradle.kts

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

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2022-03-09 15:07:41 -08:00
Lauri Tulmin b3496381f1
Write http server tests in java (#5501)
* Write http server tests in java

* typo

* Apply suggestions from code review

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

* add comments

* address review comments

* use Predicate

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2022-03-08 14:21:59 -08:00
Trask Stalnaker 0a6b87eb69
Remove server span peer name (#5404)
* Fix server -> client reference

* Remove server span peer name
2022-02-27 11:06:20 -08:00
Trask Stalnaker 53a8b85f4c
Updates to http.server_name (#5369)
* Updates to http.server_name

* Tests

* fix

* armeria

* fix

* fix

* codenarc
2022-02-18 09:38:21 -08:00
Trask Stalnaker 2f5e1f0703
Fix another reverse lookup (#5393)
* Fix another reverse lookup

* Update tests to verify NET_PEER_NAME is never captured for http server spans

* Revert "Update tests to verify NET_PEER_NAME is never captured for http server spans"

This reverts commit 44c9e91048.
2022-02-18 08:54:08 -08:00
Mateusz Rzeszutek 551418c283
Refactor AttributesExtractor so that it extracts route from Context (#5288)
* Refactor AttributesExtractor so that it extracts route from Context

* typo

* fix tests

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

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

* fix all AttributesExtractors

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2022-02-08 10:38:41 +01:00
Trask Stalnaker 022914139e
test latest deps cleanup (#5269)
* test latest deps cleanup

* Revert currently irrelevant change

* Update instrumentation/lettuce/lettuce-4.0/javaagent/build.gradle.kts

Co-authored-by: Nikita Salnikov-Tarnovski <gnikem@gmail.com>

Co-authored-by: Nikita Salnikov-Tarnovski <gnikem@gmail.com>
2022-02-01 09:49:07 -08:00
Mateusz Rzeszutek 8b767ac435
Refactor HTTP attributes extractors to use composition over inheritance (#5267)
* Refactor HTTP attributes extractors to use composition over inheritance

* Rename remaining variables: *Extractor to *Getter
2022-01-31 09:25:27 -08:00
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 edc185b133
Rename ServerSpanNaming to HttpRouteHolder (#5211)
* Rename ServerSpanNaming to HttpRouteHolder

* HttpRouteBiGetter
2022-01-25 09:44:15 -08:00
Mateusz Rzeszutek 9381d5a264
Expected server span name for null route should be HTTP GET (#5197) 2022-01-21 19:35:48 -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
Mateusz Rzeszutek 540e4cfafb
Remove HttpServerTest#extraAttributes() method (#5176)
* Remove HttpServerTest#extraAttributes() method

* fix ktor tests

* fix ratpack and restlet tests

* fix servlet2 tests

* Fix webflux and vertx tests
2022-01-20 10:41:41 -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
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
Lauri Tulmin 12c15b226f
Capture servlet request parameters at the end of the request (#5019)
* Capture servlet request parameters at the end of the request

* add comment
2022-01-06 12:02:42 -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 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
Mateusz Rzeszutek 0dc410a2e3
Reorganize shared servlet code (intro to #4317) (#4785)
* Reorganize shared servlet code (intro to #4317)

* Fix dropwizard tests

* fix compile error
2021-12-06 13:49:55 +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
Lauri Tulmin bbb571792a
Try to make tomcat async servlet exception test less flaky (#4772) 2021-12-02 08:31:30 -08:00
Lauri Tulmin c53c8a0f01
Record exception for async servlet invocations (#4677)
* Record exception for asyn servlet invocations

* add back accidentally commented out line

* rearrange test so that it passes on both jetty and tomcat
2021-11-22 11:17:59 -08:00
Nikita Salnikov-Tarnovski e7b8cca107
Convert TextMapSetters and TextMapGetters to enums (#4522)
* Convert TextMapSetters to enums

* Convert TextMapGetters to enums
2021-11-08 22:01:40 +02:00
Lauri Tulmin e31439ee0d
Fix context propagation in tomcat thread pool (#4521) 2021-10-27 16:52:55 -07:00
Nikita Salnikov-Tarnovski 5908cd31ed
Move constant away from deprecated class (#4487) 2021-10-25 12:19:58 +03: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 ef131acd6d
Enable http server concurrency test everywhere (#4465)
* Enable http server concurrency test everywhere

* remove testConcurrency method as test is now always enabled

* rebase
2021-10-22 08:39:30 -07: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
Mateusz Rzeszutek b2bc41453b
Rename some *InstrumenterBuilder classes to *InstrumenterFactory (#4391) 2021-10-15 14:47:32 +03:00
Nikita Salnikov-Tarnovski efddb72cef
Convert AttributesExtractor to interface (#4363) 2021-10-14 08:36:47 +03:00
Trask Stalnaker 53a639bbba
Fix tomcat async spans (#4339)
* Add test

* Fix tomcat async spans

* Preserve existing test controller behavior

* Comments
2021-10-13 13:04:23 -07:00
Lauri Tulmin b06c1f9018
Collect more attributes from servlet instrumenter (#4356)
* Collect more attributes from servlet instrumenter

* spotless
2021-10-12 10:58:47 -07:00
Mateusz Rzeszutek 354699647a
Test captured HTTP headers - HTTP server tests, part 2 (#4328)
* Test captured HTTP headers - HTTP server tests, part 2

* Turn off captured HTTP headers testing for grizzly

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-10-08 13:05:35 -07:00
Lauri Tulmin 478f936d54
Retry strict context check failures (#4282) 2021-10-08 10:47:52 -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 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
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 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
Lauri Tulmin 8e54d540bb
Convert liberty instrumentation to instrumenter api (#4205)
* Convert liberty instrumentation to instrumenter api

* review comment
2021-09-28 09:22:55 -07:00
Mateusz Rzeszutek a277a8b636
Separate HTTP client/server AttributesExtractors (#4195) 2021-09-24 10:06:23 -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
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
Trask Stalnaker 0f9308b4fb
Optimize tomcat uri construction (#4008)
* Optimize tomcat uri construction

* Add TODO
2021-08-30 13:34:23 -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
Lauri Tulmin a2928663f4
Strict context check for tomcat and jetty (#3923) 2021-08-24 11:45:53 -07:00
Trask Stalnaker 3525733ea8
Enable strict context check in tests by default (#3822) 2021-08-23 17:40:02 -07:00
Trask Stalnaker ec344b3184
Small simplification of servlet/tomcat tests (#3710)
* Small simplification of servlet/tomcat tests

* Spotless
2021-08-09 09:24:21 -07:00
Lauri Tulmin 9df06868fb
Instrument tomcat executor (#3789) 2021-08-07 10:07:42 -07:00
Lauri Tulmin d73e030000
Fix NullPointerException on tomcat (#3705)
* Fix NullPointerException on tomcat

* remove commented out line

* instrument CoyoteAdapter
2021-07-28 12:10:14 -07: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
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
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
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
Trask Stalnaker d8ea53d431
Remove last advice class refs (#3203)
* Remove last advice class refs

* Two more
2021-06-07 10:56:14 +03:00
Trask Stalnaker 1a56ddb427
Simplify tomcat version detection (#3129) 2021-05-30 15:08:00 +09:00
Ago Allikmaa fd132d463d
Change Async Servlet span end logic to fix race condition on Undertow (#2992)
* Attach servlet async listener with asyncStart instrumentation

* Exclude Spring packages containing servlet request classes from global ignores

* Exclude Tapestry HSR proxy with global ignore

* Improve comments.

* Fix for Liberty - request response when adding async listener

* Removed unused methods

* Explicit response to async listeners on all servlet engines

* Attach response to request on Jetty

* Fix broken build due to rebase, improved a comment

* Address PR comments

* Added a comment.

* Addressed PR comments
2021-05-25 20:46:37 -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
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
Trask Stalnaker 1824e36b96
Better server span name for Grails and Wicket (#2814) 2021-04-22 14:16:54 -07:00
Trask Stalnaker 9bd028f767
Remove unnecessary genericness (#2797) 2021-04-14 00:01:28 -07:00
Ago Allikmaa 7027006f66
Request handlers and test images for Tomcat 10 and Jetty 11 (Servlet API 5) (#2703)
* Tomcat 10 and Jetty 11 handlers with Servlet API 5

* Jetty 11 and Tomcat 10 Windows images
2021-04-05 09:45:02 -07:00