Commit Graph

41 Commits

Author SHA1 Message Date
Anuraag Agrawal cd528e98fb
Rename library entrypoints to Telemetry (#5624)
* Rename library entrypoints to Telemetry

* Renames
2022-03-22 14:39:23 +09:00
Mateusz Rzeszutek b0d5fc6b99
Remove deprecated methods from instrumentation-api and library instrumentations (#5575) 2022-03-15 09:33:48 +09:00
Mateusz Rzeszutek f6cca58f1f
Deprecate CapturedHttpHeaders and replace it with builder methods (#5533) 2022-03-09 12:21:32 -08:00
Mateusz Rzeszutek 4a98dae431
Add builders for setting optional attributes on HTTP extractors (#5347)
* Add builders for setting optional attributes on HTTP extractors

* errorprone

* fix compilation failure
2022-03-08 17:21:14 +01:00
Trask Stalnaker 1077258263
Add InternalJavadoc custom error prone check (#5277)
* Add InternalJavadoc custom error prone check

* Add example usage

* Move to conventions

* Revert "Move to conventions"

This reverts commit d8a8209b59.

* Just get it working

* Clearer error message

* versions

* Apply almost everywhere

* feedback

* Always at the end of javadoc

* Fix test

* Missed (at least) one

* No longer internal

* Fix NPE

* Spotless

* Convert awslambda Java test to JUnit 5 so can reduce visibility

* Reduce visibility

* Rename the check

* More

* Move into errorprone-convention

* Fix UserExcludedClassesConfigurerTest
2022-02-01 17:54:57 -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
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
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 e7b8cca107
Convert TextMapSetters and TextMapGetters to enums (#4522)
* Convert TextMapSetters to enums

* Convert TextMapGetters to enums
2021-11-08 22:01:40 +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
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
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
Mateusz Rzeszutek f80f4a9f63
Allow configuring captured HTTP headers in library instrumentations (#4309) 2021-10-06 13:32:39 +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
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 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
Mateusz Rzeszutek a277a8b636
Separate HTTP client/server AttributesExtractors (#4195) 2021-09-24 10:06:23 -07:00
Trask Stalnaker b8391b1354
Remove the only two author tags (#4129)
* Remove the only two author tags

* Spotless
2021-09-15 09:42:04 -07:00
Mateusz Rzeszutek ab9c688e7a
Test nested CLIENT span suppression in library instrumentations (#3970) 2021-08-27 11:16:59 +02:00
John Watson fa168268c5
Revert okhttp library instrumentation back to using standard reflection to support Android usage (#3910)
* Revert back to using standard reflection to support Android usage

* Add a comment about not using MethodHandles
2021-08-23 18:58:43 -07:00
John Watson 6dbb64ec7a
Implement a Call.Factory for okhttp 3.x+ library instrumentation (#3812)
* Add a README for the okhttp library instrumentation.

* Create new instrumentation for okhttp3 4.x+

This exposes a `Call.Factory` which will properly handle internal context propagation when used with async callbacks.

* update the "4.x" instrumentation to support 3.x

* Get rid of the 4.x instrumentation, and just update the 3.x instrumentation to work

* updates from PR review

* replace old reflection with method handle usage

* Apply suggestions from code review

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

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-08-18 12:16:24 +09:00
Anuraag Agrawal 8cbec715ff
Fill HTTP_CLIENT_IP in ServerInstrumenter (#3756) 2021-08-05 13:11:30 +09:00
Lauri Tulmin 26dc106399
Okhttp3: fix concurrency test with callback (#3669) 2021-07-26 13:12:29 +09: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
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
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 b7bfbf0cc6
Migrate instrumentation-library / common to plugins (#3320) 2021-06-15 11:54:48 -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
Michael Bannister d1b9413d88
Use configured NetPeerAttributes in OkHttp3 client tracer (#3063)
This will make it notice the peer-service-mapping settings to set peer.service span attribute

I know this approach is deprecated but I hope to follow this up with another change to use the
new Instrumenter API.

#3009
2021-05-23 09:29:18 +03: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 3bc058b10b
Don't create duplicate headers (#2727)
* Test infra

* Update examples

* Update instrumentation

* Update tests

* jaxrs-client fixes

* Remove doRequest/doReusedRequest

* Fix muzzle

* some fixes

* fix test

* doc

* not private

* Apply to doRequestWithCallback also

* Update doc

* groovy

* better

* Don't hardcode traceparent

* Reuse request in SpringRestTemplateTest
2021-04-12 12:21:16 +03:00
Anuraag Agrawal fbba3001ee
Test callbacks for okhttp library instrumentation (#2752) 2021-04-08 14:20:32 -07:00
Anuraag Agrawal d8f6018ba6
Split HttpClientTest execution methods for sync and callback (#2675) 2021-04-06 15:26:01 -07:00
Trask Stalnaker 0d11dbe565
Fix webflux client filter subscribe (#2646)
* Fix webflux client filter subscribe

* Add test

* Fix test

* Fix test, take 2

* Fix another test

* Suppress test for another module

* Suppress another library instrumentation

* Another

* Add nested client suppression in Armeria

* Add comments

* Revert extra line
2021-03-31 07:54:41 +03: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 41fec5f610
Extract okhttp3 library instrumentation. (#2489)
* Extract okhttp3 library instrumentation.

* bad spotless
2021-03-05 09:35:35 +09:00