Commit Graph

59 Commits

Author SHA1 Message Date
Mateusz Rzeszutek e3944a53a5
Make net.transport an optional attribute (#8279) 2023-04-20 08:14:03 -07:00
OpenTelemetry Bot 22df5866b0
Update the OpenTelemetry SDK version to 1.25.0 (#8262)
Co-authored-by: Lauri Tulmin <ltulmin@splunk.com>
2023-04-10 18:12:57 -07:00
Mateusz Rzeszutek f501569106
Switch from http.flavor to net.protocol.* in HTTP client instrumentat… (#8131) 2023-04-07 13:39:42 +02:00
Lauri Tulmin a51535d08e
Test http client captured headers (#7993) 2023-03-07 20:05:29 +02:00
Mateusz Rzeszutek e1895e548c
Rename all methods in all Getters to use the `get*()` naming scheme (#7619)
Resolves #6562

This PR only contains renames; the actual content is in the `*Getter`
interfaces, the rest of changes is just IntelliJ doing its job.
2023-01-23 09:28:11 +00:00
jason plumb c5e384fe9f
Http testing refactor prework (#7623)
As part of discussions #7616, the idea of trying to do a more piecemeal
approach came up. A reasonable ask.

This is the first step in refactoring the http client tests. It factors
out the `HttpClientResult` inner class of the `AbstractHttpClientTest`
so that this can be reused by new test framework later. It also factors
the relevant abstract methods in the abstract class to a new type
adapter, which will also be reused.

Co-authored-by: Mateusz Rzeszutek <mrzeszutek@splunk.com>
2023-01-20 18:20:42 +00:00
Lauri Tulmin e683fd9bee
Preserve original exception in jetty http client wrappers (#7455)
Same issue as in
https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/7452
2022-12-21 09:26:44 +01:00
Mateusz Rzeszutek 95ec4a8c1f
HTTP semconv: filter out default peer/host ports (#7258)
After a loooong break, the next part of the HTTP semconv implementation:
filtering out default HTTP ports, client and server.

>  [5]: If not default (80 for http scheme, 443 for https).


https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/http.md#http-client
2022-11-22 17:14:20 +00:00
Aaron Ai 3911cacfdc
Fix typos (#6961) 2022-10-24 09:06:01 -07:00
Mateusz Rzeszutek 77035fc88c
Extract `net.peer.{name,port}` on start for CLIENT spans (#6828)
The [HTTP
spec](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/http.md#http-client)
says these two attributes must be provided at span creation time - I
think it makes sense to extend it over to all `net`-related
instrumentations, cause these are supposed to be the logical peer
name/port, which are supposed to be known before the connection is
started/exchange is made.
2022-10-10 16:00:19 -07:00
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 f50f1fed3b
Fix instrumentation-api-semconv packages (#6590)
* Fix instrumentation-api-semconv packages

* Move test

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2022-09-12 14:51: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
Trask Stalnaker 9fe3761731
Document upper version limits (#6436) 2022-08-08 10:08:40 -07: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 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 b668e73e13
Convert all logging statements from slf4j to jul (#5674)
* Convert all logging statements from slf4j to jul

* code review comments

* fix tests

* Fix randomly failing test
2022-03-25 10:02:51 -07:00
Mateusz Rzeszutek 56f65e4fab
Convert all logging statements from slf4j to jul - part 1 (#5628)
* Convert all logging statements from slf4j to jul - part 1

* fix tests

* use placeholders

* fixed all comments, added static imports for Level
2022-03-22 10:35:27 -07:00
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
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
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
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
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
Nikita Salnikov-Tarnovski 41b5bf999a
Prevent NPE (#4527) 2021-10-27 12:54:18 -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
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
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
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 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
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
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 d6c8e3a1f2
Update supported libs list (#4077) 2021-09-09 08:07:04 -07:00
Mateusz Rzeszutek ab9c688e7a
Test nested CLIENT span suppression in library instrumentations (#3970) 2021-08-27 11:16:59 +02: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
Steve Dodge 6c8d2e1fc3
chore: apply the same wrapper fix as in open-telemetry#3831, but this time for request listners (#3833) 2021-08-13 16:45:18 -07:00