javaagent
javaagent copied to clipboard
Hypertrace OpenTelemetry Java agent with payload/body and headers data capture.
Similar to #98 but for HTTP server. - [ ] test JSON capture - [ ] test plain text capture - [ ] test `x-www-form-urlencoded` capture - [ ] test...
Startup in api-anomaly-detector service in Traceable takes around 30s at least based on the agent logs ``` Picked up JAVA_TOOL_OPTIONS: -XX:InitialRAMPercentage=50.0 -XX:MaxRAMPercentage=75.0 -javaagent:/mnt/hypertrace/hypertrace-agent-all.jar [main] INFO org.hypertrace.agent.core.config.HypertraceConfig - Config loaded: {"serviceName":"api-anomaly-detector","reporting":{"endpoint":"http://collector:9411/api/v2/spans","opa":{"endpoint":"http://aaa:8181/","pollPeriodSeconds":30}},"dataCapture":{"httpHeaders":{"request":true,"response":true},"httpBody":{"request":true,"response":true},"rpcMetadata":{"request":true,"response":true},"rpcBody":{"request":true,"response":true},"bodyMaxSizeBytes":131072},"propagationFormats":["TRACECONTEXT"]}...
The output and input stream instrumentations live in the Apache HTTP client module. ``` [opentelemetry.auto.trace 2020-12-18 16:34:16:766 +0100] [main] DEBUG io.opentelemetry.javaagent.tooling.bytebuddy.matcher.LoggingFailSafeMatcher - Instrumentation type matcher unexpected exception: io.opentelemetry.javaagent.instrumentation.hypertrace.java.inputstream.InputStreamInstrumentationModule java.lang.IllegalStateException: Cannot...
The semantics mandate the presence of `net.peer.name` or `net.peer.ip` and conditionally `net.peer.port` attributes. These attributes are absent in the span reported by HT Java agent Attaching the screen shot for...
This is so that the agent logs can be separated from the application logs, if the application uses stdout for example.
https://github.com/open-telemetry/opentelemetry-java/blob/4897f4c3200bbd77197797b94317de045e0489d7/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/config/package-info.java#L15 Use OTEL jagent `PropertySource` SPI to do that - consider also migrating property settings from `premain` to property source.
This will have to be done at the grpc-netty level. If we could do it in such a way that it works with single instrumentation on `grpc-okhttp` `grpc-netty-shaded` it would...
The close method instrumentation should check whether body has been added to span and if not add it.