opentelemetry-java-instrume.../instrumentation
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
..
akka HTTP semconv: filter out default peer/host ports (#7258) 2022-11-22 17:14:20 +00:00
apache-camel-2.20 Disable YodaCondition check and revert some of the changes (#7596) 2023-01-17 19:44:15 -08:00
apache-dbcp-2.0 Introduce markdown lint check (#7175) 2022-11-16 20:48:42 -08:00
apache-dubbo-2.7 Use new semantic attribute constants (#6946) 2022-10-23 09:32:03 -07:00
apache-httpasyncclient-4.1/javaagent HTTP semconv: filter out default peer/host ports (#7258) 2022-11-22 17:14:20 +00:00
apache-httpclient HTTP semconv: filter out default peer/host ports (#7258) 2022-11-22 17:14:20 +00:00
armeria-1.3 HTTP semconv: filter out default peer/host ports (#7258) 2022-11-22 17:14:20 +00:00
async-http-client HTTP semconv: filter out default peer/host ports (#7258) 2022-11-22 17:14:20 +00:00
aws-lambda Bump errorProneVersion from 2.17.0 to 2.18.0 (#7532) 2023-01-11 20:25:46 -08:00
aws-sdk HTTP semconv: filter out default peer/host ports (#7258) 2022-11-22 17:14:20 +00:00
azure-core Bump spotless-plugin-gradle from 6.12.1 to 6.13.0 (#7591) 2023-01-17 19:43:46 -08:00
c3p0-0.9 Introduce markdown lint check (#7175) 2022-11-16 20:48:42 -08:00
cassandra Use new semantic attribute constants (#6946) 2022-10-23 09:32:03 -07:00
cdi-testing Update gradle to 7.5.1 (#6359) 2022-08-12 12:03:43 +02:00
couchbase Bump spotless-plugin-gradle from 6.12.1 to 6.13.0 (#7591) 2023-01-17 19:43:46 -08:00
dropwizard Update to slf4j 2.0.2 (#6774) 2022-10-06 01:28:53 +00:00
elasticsearch Support spring-data 3.0 (test only) (#7376) 2023-01-11 20:10:38 -08:00
executors Bump spotless-plugin-gradle from 6.12.1 to 6.13.0 (#7591) 2023-01-17 19:43:46 -08:00
external-annotations Introduce markdown lint check (#7175) 2022-11-16 20:48:42 -08:00
finatra-2.9/javaagent Fix finatra latest deps test (#6616) 2022-09-14 13:27:16 +03:00
geode-1.4/javaagent Rename `newInstrumenter()` into `buildInstrumenter()` (#6363) 2022-07-25 12:02:46 -07:00
google-http-client-1.19/javaagent HTTP semconv: filter out default peer/host ports (#7258) 2022-11-22 17:14:20 +00:00
grails-3.0/javaagent Convert vaadin tests to java (#7444) 2023-01-03 12:46:48 -08:00
graphql-java-12.0 Introduce markdown lint check (#7175) 2022-11-16 20:48:42 -08:00
grizzly-2.0/javaagent Capture net.host.name for netty (#6892) 2022-10-19 09:21:50 -07:00
grpc-1.6 Add gRPC request metadata instrumentation (#7011) 2023-01-17 21:18:37 -08:00
guava-10.0 More spotless (#7126) 2022-11-11 05:01:21 +00:00
gwt-2.0/javaagent Bump errorProneVersion from 2.17.0 to 2.18.0 (#7532) 2023-01-11 20:25:46 -08:00
hibernate Disable YodaCondition check and revert some of the changes (#7596) 2023-01-17 19:44:15 -08:00
hikaricp-3.0 Fix connection pool timeouts unit (#7404) 2022-12-13 08:19:38 -08:00
http-url-connection/javaagent Disable YodaCondition check and revert some of the changes (#7596) 2023-01-17 19:44:15 -08:00
hystrix-1.4/javaagent Rename `newInstrumenter()` into `buildInstrumenter()` (#6363) 2022-07-25 12:02:46 -07:00
internal Disable YodaCondition check and revert some of the changes (#7596) 2023-01-17 19:44:15 -08:00
java-http-client/javaagent HTTP semconv: filter out default peer/host ports (#7258) 2022-11-22 17:14:20 +00:00
java-util-logging Java util logging config doc (#7398) 2022-12-13 12:04:49 +02:00
jaxrs Bump errorProneVersion from 2.17.0 to 2.18.0 (#7532) 2023-01-11 20:25:46 -08:00
jaxrs-client Limit cxf latest dep version (#7470) 2022-12-23 09:54:25 -08:00
jaxws Disable YodaCondition check and revert some of the changes (#7596) 2023-01-17 19:44:15 -08:00
jboss-logmanager Disable YodaCondition check and revert some of the changes (#7596) 2023-01-17 19:44:15 -08:00
jdbc Bump spotless-plugin-gradle from 6.12.0 to 6.12.1 (#7500) 2023-01-03 09:58:06 +00:00
jedis Use new semantic attribute constants (#6946) 2022-10-23 09:32:03 -07:00
jetty Introduce markdown lint check (#7175) 2022-11-16 20:48:42 -08:00
jetty-httpclient/jetty-httpclient-9.2 Preserve original exception in jetty http client wrappers (#7455) 2022-12-21 09:26:44 +01:00
jms Instrument JMS 3.0 (Jakarta) (#7418) 2023-01-11 19:54:42 -08:00
jmx-metrics Bump errorProneVersion from 2.17.0 to 2.18.0 (#7532) 2023-01-11 20:25:46 -08:00
jsf Use new semantic attribute constants (#6946) 2022-10-23 09:32:03 -07:00
jsp-2.3 Use new semantic attribute constants (#6946) 2022-10-23 09:32:03 -07:00
kafka Disable YodaCondition check and revert some of the changes (#7596) 2023-01-17 19:44:15 -08:00
kotlinx-coroutines Bump spotless-plugin-gradle from 6.12.0 to 6.12.1 (#7500) 2023-01-03 09:58:06 +00:00
ktor Bump spotless-plugin-gradle from 6.12.1 to 6.13.0 (#7591) 2023-01-17 19:43:46 -08:00
kubernetes-client-7.0 HTTP semconv: filter out default peer/host ports (#7258) 2022-11-22 17:14:20 +00:00
lettuce Bump errorProneVersion from 2.17.0 to 2.18.0 (#7532) 2023-01-11 20:25:46 -08:00
liberty Capture net.host.name for netty (#6892) 2022-10-19 09:21:50 -07:00
log4j Disable YodaCondition check and revert some of the changes (#7596) 2023-01-17 19:44:15 -08:00
logback Add logback configuration doc (#7392) 2022-12-12 13:55:23 -08:00
methods Bump spotless-plugin-gradle from 6.12.1 to 6.13.0 (#7591) 2023-01-17 19:43:46 -08:00
micrometer/micrometer-1.5 Fix metric units (#6931) 2022-10-22 10:00:48 -07:00
mongo Fix tests for mongodb 4.8 (#7183) 2022-11-15 13:21:07 -08:00
netty Disable YodaCondition check and revert some of the changes (#7596) 2023-01-17 19:44:15 -08:00
okhttp Disable YodaCondition check and revert some of the changes (#7596) 2023-01-17 19:44:15 -08:00
opensearch More spotless (#7126) 2022-11-11 05:01:21 +00:00
opentelemetry-api Agent context storage wrapper should not override other wrappers (#7355) 2022-12-12 10:22:41 -08:00
opentelemetry-extension-annotations-1.0 Introduce markdown lint check (#7175) 2022-11-16 20:48:42 -08:00
opentelemetry-extension-kotlin-1.0/javaagent Add instrumentation for opentelemetry-extension-kotlin (#7341) 2022-12-05 21:06:04 -08:00
opentelemetry-instrumentation-annotations-1.16 Introduce markdown lint check (#7175) 2022-11-16 20:48:42 -08:00
opentelemetry-instrumentation-api Capture net.host.name for netty (#6892) 2022-10-19 09:21:50 -07:00
oracle-ucp-11.2 Introduce markdown lint check (#7175) 2022-11-16 20:48:42 -08:00
oshi Fix metric units (#6931) 2022-10-22 10:00:48 -07:00
play HTTP semconv: filter out default peer/host ports (#7258) 2022-11-22 17:14:20 +00:00
quartz-2.0 Assert on instrumentation version (#6773) 2022-09-29 10:53:10 +03:00
rabbitmq-2.7 More spotless (#7126) 2022-11-11 05:01:21 +00:00
ratpack HTTP semconv: filter out default peer/host ports (#7258) 2022-11-22 17:14:20 +00:00
reactor Disable YodaCondition check and revert some of the changes (#7596) 2023-01-17 19:44:15 -08:00
rediscala-1.8/javaagent Remove external usages of ClassNames (and move it to internal) (#6584) 2022-09-13 13:58:19 -07:00
redisson End groovy files with newline (#7127) 2022-11-10 12:21:55 +01:00
resources/library Disable YodaCondition check and revert some of the changes (#7596) 2023-01-17 19:44:15 -08:00
restlet Capture net.host.name for netty (#6892) 2022-10-19 09:21:50 -07:00
rmi Disable YodaCondition check and revert some of the changes (#7596) 2023-01-17 19:44:15 -08:00
rocketmq/rocketmq-client Bump errorProneVersion from 2.17.0 to 2.18.0 (#7532) 2023-01-11 20:25:46 -08:00
runtime-metrics Do not install GC metrics when GarbageCollectionNotificationInfo is n… (#7405) 2022-12-13 08:11:51 -08:00
rxjava Update error prone (#6646) 2022-09-23 11:24:40 -07:00
scala-fork-join-2.8/javaagent Remove scala from dependency management (#7296) 2022-11-29 07:55:35 -08:00
servlet Disable YodaCondition check and revert some of the changes (#7596) 2023-01-17 19:44:15 -08:00
spark-2.3/javaagent Use new semantic attribute constants (#6946) 2022-10-23 09:32:03 -07:00
spring Disable YodaCondition check and revert some of the changes (#7596) 2023-01-17 19:44:15 -08:00
spymemcached-2.12 Rename `newInstrumenter()` into `buildInstrumenter()` (#6363) 2022-07-25 12:02:46 -07:00
struts-2.3/javaagent Add test latest dep limit for struts2 (#7322) 2022-11-28 11:21:53 -08:00
tapestry-5.4/javaagent Rename ErrorCauseExtractor.jdk() to getDefault() (#6580) 2022-09-12 17:36:34 +03:00
tomcat Introduce markdown lint check (#7175) 2022-11-16 20:48:42 -08:00
twilio-6.6 HTTP semconv: filter out default peer/host ports (#7258) 2022-11-22 17:14:20 +00:00
undertow-1.4 Use new semantic attribute constants (#6946) 2022-10-23 09:32:03 -07:00
vaadin-14.2 Disable YodaCondition check and revert some of the changes (#7596) 2023-01-17 19:44:15 -08:00
vertx Populate `messaging.kafka.message.offset` in all kafka instrumentations (#7374) 2022-12-09 17:13:31 -08:00
vibur-dbcp-11.0 Introduce markdown lint check (#7175) 2022-11-16 20:48:42 -08:00
wicket-8.0/javaagent Merge javaagent-instrumentation-api into javaagent-extension-api (#5936) 2022-04-28 20:11:15 -07:00
build.gradle.kts Bump spotless-plugin-gradle from 6.12.0 to 6.12.1 (#7500) 2023-01-03 09:58:06 +00:00