Commit Graph

482 Commits

Author SHA1 Message Date
Angel 478404539d
Add UserExcludedClassloadersConfigurer (#10134) 2024-01-11 07:50:46 -08:00
Helen f6176919e4
Change default OTLP protocol to http/protobuf (#9993)
Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2024-01-04 13:30:17 -08:00
Lauri Tulmin 9c36539d24
Remove unneeded @SuppressWarnings("UnusedVariable") (#10121) 2024-01-01 17:35:18 -08:00
Lauri Tulmin fda1ee124a
Add timeout to awaitGc (#10081) 2023-12-15 11:45:35 -08:00
Lauri Tulmin a7e8ed81ff
Associate value with class loader (#10051) 2023-12-14 15:04:25 -08:00
Lauri Tulmin 30ddf6a66c
Fix transforming record types (#10052) 2023-12-13 10:25:16 -08:00
Mateusz Rzeszutek 4123a639fa
Enable OTLP logs exporter (#10055) 2023-12-13 08:22:08 -08:00
Gregor Zeitlinger 1a054a53ad
rename telemetry.auto.version to telemetry.distro.version and add telemetry.distro.name (#9065)
Co-authored-by: Lauri Tulmin <tulmin@gmail.com>
2023-12-13 08:19:03 -08:00
Lauri Tulmin 14dc34e50e
Capture http.route for akka-http (#10039)
Co-authored-by: jason plumb <75337021+breedx-splk@users.noreply.github.com>
2023-12-12 11:10:17 -08:00
Mateusz Rzeszutek 63468157fc
Fix latest dep tests after the recent Spring release (#9947) 2023-11-24 21:07:48 +00:00
Lauri Tulmin 6313391d71
Rewrite @Advice.Enter for indy advice (#9887) 2023-11-17 07:49:19 -08:00
cleverchuk 81f8bf6231
Add `service.name` to MDC (#9647)
Co-authored-by: Lauri Tulmin <ltulmin@splunk.com>
2023-11-13 09:37:19 -08:00
Jonas Kunz 6eb8ae19df
Allow injection of helper bytecode as resources (#9752) 2023-11-06 09:37:52 -08:00
Lauri Tulmin 5a2f52978f
Make kafka library and javaagent instrumentations more similar (#9738) 2023-10-24 09:08:03 -07:00
Lauri Tulmin a2f01e577e
Make more tests run with indy (#9729) 2023-10-24 12:23:50 +03:00
Lauri Tulmin 93e0667816
Improve disableShadowRelocate (#9715)
Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2023-10-20 10:34:00 +03:00
Jonas Kunz 2d4d010cb0
Add capability for invokedynamic InstrumentationModules to inject proxies (#9565) 2023-10-19 10:11:24 -07:00
Mateusz Rzeszutek 76d0090f53
Define `url.scheme` in terms of logical operation in HTTP server semconv (#9698) 2023-10-17 11:04:39 -07:00
Lauri Tulmin de7cdcc22b
Run tests with java 21 (#9620) 2023-10-09 17:07:46 +03:00
SylvainJuge 6e97851a0b
Minor cleanup after bytebuddy 1.14.8 release (#9595) 2023-10-02 09:46:20 -07:00
Lauri Tulmin b464369253
Improve spring data reactive instrumentation (#9561) 2023-09-27 21:16:04 +03:00
Lauri Tulmin 7d2259742a
Transform inline advice to delegating advice and test indy modules (#9508) 2023-09-22 11:15:39 +03:00
Jonas Kunz 446d9a28ae
Implemented factory for generating invokedynamic proxy classes (#9502) 2023-09-20 12:26:56 -07:00
Jonas Kunz 10480adc64
Implement invokedynamic advice bootstrapping (#9382) 2023-09-13 17:44:47 -07:00
Trask Stalnaker 3b77cc4b2d
Semconv 1.21 (#9408)
Co-authored-by: Lauri Tulmin <ltulmin@splunk.com>
2023-09-13 19:20:23 +00:00
Trask Stalnaker db7eb14384
Remove deprecated experimental config (#9378) 2023-09-04 08:59:49 +03:00
SylvainJuge 4855eeee73
Bytecode version upgrade for invokedynamic dispatch (#9239) 2023-08-25 09:16:39 -07:00
Trask Stalnaker 39574290c9
Fix build (#9283) 2023-08-23 05:49:48 +02:00
Jonas Kunz 3dbb965e94
Fixed getDefinedPackage lookup for OpenJ9 (8) (#9272) 2023-08-22 11:12:25 +02:00
Jonas Kunz 5abba34ade
Implemented InstrumentationModuleClassLoader for invokedynamic Advice dispatching (#9177)
Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2023-08-21 12:11:52 +00:00
Lauri Tulmin 56dfd1ee6a
Implement @WithSpan support for kotlin coroutines (#8870)
Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2023-08-16 14:51:30 -07:00
OpenTelemetry Bot acbab58a46
Update the OpenTelemetry SDK version to 1.28.0 (#8897)
Co-authored-by: Lauri Tulmin <ltulmin@splunk.com>
2023-07-10 12:45:01 -07:00
OpenTelemetry Bot bbb05276be
Update the OpenTelemetry SDK version to 1.27.0 (#8688)
Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
Co-authored-by: Lauri Tulmin <ltulmin@splunk.com>
2023-06-13 12:02:11 +03:00
Lauri Tulmin 8cfacd5666
Fix flaky CacheProviderTest (#8684) 2023-06-11 09:13:22 +03:00
Mateusz Rzeszutek a2fd908d47
Disable the logging exporter by default (#8647)
Co-authored-by: opentelemetrybot <107717825+opentelemetrybot@users.noreply.github.com>
2023-06-05 20:04:03 +00:00
Mateusz Rzeszutek 8ee63d4441
Implement new stable URL semantic conventions (#8491) 2023-06-05 15:22:22 +00:00
Lauri Tulmin 81f6a3a0c2
Faster type matching (#8525) 2023-06-02 18:35:31 +03:00
Lauri Tulmin 45fbf4b47b
Skip not decorator check for classes in boot loader (#8594) 2023-05-30 11:23:16 +02:00
dependabot[bot] c60d0a2673
Bump com.diffplug.spotless:spotless-plugin-gradle from 6.18.0 to 6.19.0 (#8561)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Lauri Tulmin <ltulmin@splunk.com>
2023-05-24 12:23:07 -07:00
Lauri Tulmin 5627a15c29
Fix jetty context leak (#8552) 2023-05-23 12:42:17 -07:00
dependabot[bot] 3122897b2e
Bump errorProneVersion from 2.18.0 to 2.19.0 (#8459)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Lauri Tulmin <ltulmin@splunk.com>
2023-05-10 09:49:55 -07:00
Lauri Tulmin 43073e7df9
Allow transforming classes with missing field types (#8393) 2023-05-09 14:07:50 -07:00
Mateusz Rzeszutek 9b82a01dd7
Set up EarlyInitAgentConfig even earlier (#8413) 2023-05-06 16:24:23 -07:00
Lauri Tulmin 2f0819ae20
Improve compatibility with SecurityManager (#7983)
This pr gives classes defined in agent and extension class loaders all
permissions. Injected helper classes are also defined with all
permissions. Agent startup is altered so that we won't call methods that
require permission before we are able to get those permissions.
This pr does not attempt to address issues where agent code could allow
user code to circumvent security manager e.g.
https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/javaagent-bootstrap/src/main/java/io/opentelemetry/javaagent/bootstrap/InstrumentationHolder.java
gives access to `Instrumentation` that could be used to redefine classes
and remove security checks. Also this pr does not address failed
permission checks that could arise from user code calling agent code.
When user code, that does not have privileges, calls agent code, that
has the privileges, and agent code performs a sensitive operation then
permission check would fail because it is performed for all calling
classes, including the user classes. To fix this agent code should uses
`AccessController.doPrivileged` which basically means that, hey I have
done all the checks, run this call with my privileges and ignore the
privileges of my callers.
2023-04-05 15:41:37 +03:00
Lauri Tulmin e0ecb56e8b
Codeql detects zipslip vulnerability (#8209)
I think that the only way zipslip could happen is when name contains
`..` but codeql isn't able to cope with that. Removing the `..` check
gets rid of the code scanning alert.
2023-04-04 16:14:19 -07:00
Lauri Tulmin 8fba02e391
Skip spotless and other checks in CI test step (#8142)
Currently we run spotless and other checks for each of the parallel test
steps which seems wasteful. Here is an attempt to run only the tests in
given partition without any extra checks in the `test` step and run all
the checks in the `build` step.
2023-04-04 10:43:12 -07:00
Mateusz Rzeszutek 04f2e3e9e5
Bridge agent logs into application's slf4j logger (#7339)
Related discussion #7257
Resolves #3413
Resolves #5059
Resolves #6258
Resolves #7179

Adds a logging implementation that'll collect agent logs in memory until
slf4j is detected in the instrumented application; and when that happens
will dump all the logs into the application slf4j and log directly to
the application logger from that time on.

It's still in a POC state, unfortunately: while it works fine with an
app that uses & initializes slf4j directly, Spring Boot applications
actually reconfigure the logging implementation (e.g. logback) a while
after slf4j is loaded; which causes all the startup agent logs (debug
included) to be dumped with the default logback pattern.

Future work:
* ~~Make sure all logs produces by the agent are sent to loggers named
`io.opentelemetry...`
(https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/7446)~~
DONE
* Make this work on Spring Boot
* Documentation
* Smoke test?
2023-04-04 17:29:43 +02:00
Lauri Tulmin 93d7dd7261
Ignore appd agent classes (#8065)
Related to
https://github.com/open-telemetry/opentelemetry-java-instrumentation/discussions/8060
2023-03-22 13:04:14 +01:00
Ago Allikmaa a9788a22de
Provide ability to add HTTP server response headers, with Tomcat implementation (#7990)
This allows custom distributions of the agent to register
`HttpServerResponseCustomizer` implementations. When a supported HTTP
server instrumentation starts processing a response, the `onStart`
method of all registered implementations will be invoked with the
`Context` of the SERVER span, an instrumentation-specific response
object and `HttpServerResponseMutator` instance that allows appending
headers to that response.

The intent of this is to allow custom distributions to set a header
containing span context information, such as the trace and span IDs. As
such, the initial implementation only allows appending response headers
and nothing else.

The `HttpServerResponseCustomizer` and related classes are currently in
a subpackage of the `io.opentelemetry.javaagent.bootstrap` package in
`javaagent-extension-api`. This makes them get loaded in the bootstrap
classloader, thus directly accessible from instrumentations. I am not
aware if there is an elegant way to put it in the agent classloader
instead, yet have the same instance accessible from both
`AgentInstaller` and instrumentations.

This also includes Tomcat-specific implementation in order to be able to
demonstrate that it works, and add automated testing of this to
HttpServerTest including one implementation.
2023-03-13 17:46:39 +01:00
Lauri Tulmin 46861382e8
Check that extracting extension jar doesn't escape designated directory (#7908)
Mostly to appease code scanners.
2023-03-07 09:00:56 +02:00