Commit Graph

79 Commits

Author SHA1 Message Date
renovate[bot] 27ee816a26
fix(deps): update dependency io.netty:netty-bom to v4.1.101.final (#9833)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Lauri Tulmin <ltulmin@splunk.com>
2023-12-06 10:20:54 -08:00
Mateusz Rzeszutek 65ee9510f5
Rename the `instrumentation-api-semconv` module into `instrumentation-api-incubator` (#9985) 2023-12-04 08:28:10 +01:00
Mateusz Rzeszutek dc81aae72f
Move HTTP classes to instrumentation-api (#9977) 2023-12-01 12:04:06 +01:00
Mateusz Rzeszutek 7cd705b555
Remove old HTTP semconv code (#9968) 2023-11-29 08:04:31 -08:00
Trask Stalnaker 5ba402fd2f
opentelemetry -> openTelemetry (#9858) 2023-11-14 12:31:42 +02:00
Mateusz Rzeszutek 9cb157492c
Replace `(client|server).socket.(address|port)` attributes with `network.(peer|local).(address|port)` (#9676) 2023-10-18 10:36:32 +00:00
Lauri Tulmin 13585c6d95
Implement spec changes for grpc server span error status (#9641) 2023-10-10 16:37:02 +03:00
Lauri Tulmin 432dc54de8
Use constants from semconv (#9626) 2023-10-09 13:31:48 +02:00
Trask Stalnaker 3b77cc4b2d
Semconv 1.21 (#9408)
Co-authored-by: Lauri Tulmin <ltulmin@splunk.com>
2023-09-13 19:20:23 +00:00
Mateusz Rzeszutek 65451b6529
Deprecate `NetClientAttributesExtractor` (#9165) 2023-08-16 11:21:10 +02:00
Mateusz Rzeszutek 42f07eedd8
Deprecate `NetServerAttributesExtractor` (#9156) 2023-08-11 15:04:52 +02:00
Lauri Tulmin d749ac0091
Rework grpc cancelation propagation (#8957) 2023-08-08 11:00:10 +03:00
Mateusz Rzeszutek 4f12fba9c3
Implement new stable client semantic conventions (#8704) 2023-06-13 17:00:27 -07:00
Mateusz Rzeszutek cde2e70148
Implement new stable server semantic conventions (#8663) 2023-06-13 11:07:59 +02:00
Mateusz Rzeszutek 506ccb6b7d
Implement new stable network semantic conventions (#8616) 2023-06-12 16:51:47 +02:00
Mateusz Rzeszutek eeb6ffd6e3
Deprecate InetSocketAddressNetClientAttributesGetter and move its met… (#8591) 2023-05-31 08:30:56 +02:00
Mateusz Rzeszutek c4ee60dad4
Deprecate InetSocketAddressNetServerAttributesGetter and move its met… (#8341) 2023-05-29 10:04:32 +02:00
Mateusz Rzeszutek e3944a53a5
Make net.transport an optional attribute (#8279) 2023-04-20 08:14:03 -07:00
Lauri Tulmin 4023a59068
Grpc client instrumentation net.sock.peer.addr (#7742)
Currently grpc client instrumentation unreliably fills
`net.sock.peer.addr` which makes tests flaky
https://ge.opentelemetry.io/s/nni57d5zryafk/tests/:instrumentation:grpc-1.6:javaagent:test/io.opentelemetry.javaagent.instrumentation.grpc.v1_6.GrpcStreamingTest/conversation(int,%20int)%5B8%5D?expanded-stacktrace=WyIwIl0&top-execution=1
This pr moves capturing `net.sock.peer.addr` to a later point where it
seems to work reliably.
2023-02-14 12:04:53 -08: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
Tav Herzlich b9c10c9607
Add gRPC request metadata instrumentation (#7011)
Solves. #6991 

This PR implements the request portion of the new gRPC metadata
instrumentation spec:

https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/rpc.md#grpc-request-and-response-metadata

The changes include:

- new CommonConfig entry for desired gRPC metadata values:
'otel.instrumentation.grpc.capture-metadata.request'
(Similar to http headers)
- setting the desired metadata values in GrpcTelemetry
- new property in GrpcAttributesExtractor that holds a reference to the
GrpcRpcAttributesGetter
- new property in GrpcAttributesExtractor that stores the desired values
so it can iterate them and extract each one from the request
- inject the GrpcRpcAttributesGetter to GrpcAttributesExtractor (in
GrpcTelemetryBuilder)
- logic in GrpcRpcAttributesGetter to safely extract the gRPC metadata
value
- A new test in GrpcTest that makes sure that when a certain metadata
key name is inserted, it also ends up in the span attributes

** Doesn't take care of the response because gRPC response is not
implemented in java-instrumentation yet. (This is absolutely necessary
but out of scope for this PR)
** "metadataValue" is only implemented inside GrpcRpcAttributesGetter
and not in RpcAttributesGetter to avoid providing implementations for
every RpcAttributesGetter in the repo as this PR only focuses on gRPC.

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2023-01-17 21:18:37 -08:00
Anurag Agarwal 390803d3e7
GRPC: Adds peer socket address when the client call is ready (#7451)
Closes
https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues/7445
2023-01-02 11:01:37 +01:00
Trask Stalnaker f9c2c80ef7
Avoid constructing URI (#7293)
Resolves #6568 (Reactor Netty optimization was already implemented in
#6600)
2022-11-24 10:14:10 +01:00
Aaron Ai 2d7395c44b
Introduce markdown lint check (#7175)
Fixes #7129
2022-11-16 20:48:42 -08:00
Arik Sher deebf6d06c
Enhancement/add additionalServerExtractors (#7155)
fixes issue #7153

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2022-11-15 08:52:43 +01:00
Aaron Ai d266a604ed
Add docs for gRPC library instrumentation (#6981)
Fixes #6980
2022-10-27 15:31:28 +02: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
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
Mateusz Rzeszutek 82b39b1012
Rename `newInstrumenter()` into `buildInstrumenter()` (#6363)
* Rename newInstrumenter() into buildInstrumenter()

* spotless
2022-07-25 12:02:46 -07:00
Sam Xie fcda760ad5
Add shouldStart() call to gRPC instrumentation (#6356) 2022-07-22 10:38:53 +02:00
Mateusz Rzeszutek 3af56e7d22
InstrumentationConfig part 3: HTTP headers and peer service mappings (#6302) 2022-07-15 14:52:52 -07:00
Trask Stalnaker 11dd0797f6
Make rpc.grpc.status_code required (#6184) 2022-06-17 13:50:57 -07:00
ET aca80bee40
Make gRPC metadata available to AttributeExtractors (#6125)
* Allow GrpcTelemetryBuilder to be customized to add Extractors, etc

* fixup! Allow GrpcTelemetryBuilder to be customized to add Extractors, etc

* Call GrpcRequest.setMetadata() in TracingClientInterceptor.start()

* stop spotless from complaining

* Checkstyle satisfaction

* Spotless

* Suggestions (#6)

* Suggestions

* Apply suggestions from code review

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

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2022-06-03 12:51:12 +03:00
HaloFour b7fc80c98e
Change SpanStatusExtractor to use a builder that can set status description (#6035)
* Change SpanStatusExtractor to use a builder that can set status descripion

* Refactor SpanStatusExtractor to only support builder approach to setting status

* Revert setting the exception as the status description

* PR feedback

* Re-fix graghql instrumentation span extractor

* Spotless
2022-05-19 10:00:46 -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
jack-berg 6fe3299f52
Add metric support for grpc (#5923)
* Add metric support for grpc

* Spotless
2022-04-25 10:36:26 -07:00
Anuraag Agrawal 14372adb68
Migrate Guava tests to Java (#5668)
* Migrate Guava tests to Java

* Update instrumentation/guava-10.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/guava/ListenableFutureTest.java

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

* Workaround inline mock issue

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
Co-authored-by: Lauri Tulmin <tulmin@gmail.com>
2022-03-24 14:14:09 +09: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 1ee60aa6e6
Split out RpcAttributesGetter (#5548)
* Split out RpcAttributesGetter

* code review comments

* go back to RpcAttributesGetter
2022-03-17 11:14:19 +01:00
Anuraag Agrawal 1d9c23bfb3
Do not propagate gRPC deadline when propagating OTel context via javaagent. (#5543)
* Add test for early return in gRPC pattern.

* Do not propagate gRPC deadline when propagating OTel context via javaagent.
2022-03-11 11:06:26 -08:00
Anuraag Agrawal 9e5fdcebd5
Migrate gRPC tests to Java (#5521)
* Migrate gRPC tests to Java

* check

* clean
2022-03-09 14:37:59 +09:00
Trask Stalnaker 3ab1b8516f
Add markdown spell check (#5450)
* Add markdown link check

* Fix links

* update workflows

* move comment

* Add misspell check

* Fix misspellings

* Fix more misspellings

* Run against all files

* Spotless
2022-03-01 19:18:53 -08:00
eugeniyk bf16564321
Set custom gRPC client/server span name extractor (#5244)
* Set custom gRPC client/server span name extractor

* Fix imports

* Fix compilation

* Fix style rule

* Update to use Functions instead

* Fix formatting
2022-02-24 13:59:00 +02:00
ralphgj e551d99db3
fix: add attributes of net.peer.* for grpc client span (#5324) 2022-02-10 09:54:43 -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 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 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