Commit Graph

119 Commits

Author SHA1 Message Date
Jonas Kunz 980d8ea244
Allow multiple invokedynamic InstrumentationModules to share classloaders (#10015) 2024-02-02 15:35:54 +02:00
jason plumb 7e35f0c34a
Remove deprecated config properties (#10349) 2024-01-31 05:16:50 +00:00
Helen fdeb032b33
Disable controller and view spans by default (#10042)
Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2024-01-04 09:16:46 -08:00
Lauri Tulmin 30ddf6a66c
Fix transforming record types (#10052) 2023-12-13 10:25:16 -08:00
Mateusz Rzeszutek 65ee9510f5
Rename the `instrumentation-api-semconv` module into `instrumentation-api-incubator` (#9985) 2023-12-04 08:28:10 +01:00
Phil Clay 6ed32390bc
Capture enduser attributes in Spring Security (#9777) 2023-11-14 12:23:09 -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
Mateusz Rzeszutek d6c2aff7c2
Change `http.request.body.size` and `http.response.body.size` attributes from recommended to opt-in (#9799) 2023-11-02 11:20:50 -07:00
Phil Clay e8ef8ba947
Rename flag to capture enduser id (#9788) 2023-11-01 09:02:15 +02:00
Lauri Tulmin 05ae636ed8
Move capturing enduser.id attribute behind a flag (#9751) 2023-10-31 15:28:32 +02:00
Lauri Tulmin a2f01e577e
Make more tests run with indy (#9729) 2023-10-24 12:23:50 +03:00
Jonas Kunz 2d4d010cb0
Add capability for invokedynamic InstrumentationModules to inject proxies (#9565) 2023-10-19 10:11:24 -07:00
Matthieu MOREL 9a1c178d58
PeerService Resolver (#9061)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
Co-authored-by: Mateusz Rzeszutek <mrzeszutek@splunk.com>
Co-authored-by: jason plumb <75337021+breedx-splk@users.noreply.github.com>
Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
Co-authored-by: Lauri Tulmin <ltulmin@splunk.com>
2023-10-12 07:52:05 -07:00
Lauri Tulmin 7d2259742a
Transform inline advice to delegating advice and test indy modules (#9508) 2023-09-22 11:15:39 +03:00
Mateusz Rzeszutek 133de2486a
Extract HTTP server experimental metrics to a separate class (#9259) 2023-08-30 08:49:42 -07:00
Lauri Tulmin c2a3ba02d3
Remove unnecessary code (#9307) 2023-08-25 09:41:22 -07:00
jackshirazi 96457d3dc0
Add isIndyModule() default to InstrumentationModule (#9180)
Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2023-08-11 08:12:07 -07:00
Mateusz Rzeszutek 59e2da5aa3
Extract HTTP client experimental metrics to a separate class (#8769) 2023-07-18 08:34:39 -07:00
Mateusz Rzeszutek cc8160cffb
Support the `http.request.method_original` attribute (#8779) 2023-07-17 09:41:41 +00:00
Mateusz Rzeszutek eec8703188
Rename common HTTP configuration settings (#8758) 2023-06-28 11:43:07 -07:00
Lauri Tulmin 81f6a3a0c2
Faster type matching (#8525) 2023-06-02 18:35:31 +03: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 62c124f192
Add a few comments to the ClassLoaderHasClassesNamedMatcher (#8098)
@tylerbenson noted that the idea of assigning each matcher a index that
is used to cache the matching status in bit set is not obvious. Here's
an attempt to improve the comments.
2023-03-22 12:45:46 +01:00
Lauri Tulmin 7c54e9bab3
Remove unneeded line (#8096)
This was brought up in the review of
https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/7866
but somehow didn't get removed there 🙈
2023-03-21 11:26:43 +02:00
Lauri Tulmin f5f83fdeb8
Reduce memory usage for ClassLoaderHasClassesNamedMatcher (#7866)
See
https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/7698
This is an attempt to reduce memory usage for
`ClassLoaderHasClassesNamedMatcher`. Instead of having each matcher keep
a `Map<ClassLoader, Boolean>` we can have one `Map<ClassLoader, BitSet>`
where each matcher uses one bit in the `BitSet`. Alternatively
`Map<ClassLoader, Set<ClassLoaderHasClassesNamedMatcher>>` where set
contains matchers that match for given class loader would also work well
because these matchers usually don't match so we can expect to have only
a few elements in the set.
2023-03-17 18:42:55 +02: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
adamleantech 96fd1d7522
Add Baggage to logback MDC controlled by flag (#7892)
The intention here is to allow users of the java agent to set a VM flag
in order to be able to add values in the current Baggage context to MDC
for logback. It seemed unwise to turn this on by default - if the
application is configured to print all MDC contents (as it often the
case with JSON output) then baggage would be logged out by default which
may either bloat the logs or result in sensitive data being exposed
unitentionally.

Addresses #1391 and #6708

Note that this is my first contribution to this repo, I've done my best
to follow the existing approaches to things like testing but would
appreciate any feedback.

---------

Co-authored-by: Mateusz Rzeszutek <mrzeszutek@splunk.com>
2023-03-09 08:03:56 -08:00
Trask Stalnaker 93175522d4
Rename kafka propagation setting and clarify behavior (#6957) 2022-10-24 08:49:48 -07:00
Lauri Tulmin 3e89a8ab31
Delete deprecated configuration flags (#6771) 2022-09-28 12:33:57 -07:00
Mateusz Rzeszutek 7b139e9df9
Remove agent's Ordered interface and use the SDK one (#6589) 2022-09-12 12:15:18 -07:00
Mateusz Rzeszutek 59cb9ca0df
Remove deprecated code (#6501)
* Remove deprecated code

* unnecessary semicolon

* fix distro and extension examples
2022-08-24 14:36:57 -07:00
Trask Stalnaker 7f5d0cb5b7
Fix default-enabled config (#6491) 2022-08-19 12:41:08 -07:00
Mateusz Rzeszutek fdc325e209
Deprecate agent config SPIs (#6476) 2022-08-18 10:28:16 +02:00
Lauri Tulmin 07d7cfd551
Capture messaging header value as span attribute (#6454)
* Capture messaging header value as span attribute

* add comment
2022-08-11 17:28:04 -07:00
Mateusz Rzeszutek 976ab9411c
Deprecate Config (#6360)
* Deprecate Config

* suppress deprecation on ConfigTest
2022-07-25 12:10:11 -07:00
Mateusz Rzeszutek b917b3bf9c
Use ConfigProperties instead of Config in the agent code (#6322)
* Use ConfigProperties instead of Config in the agent code

* Fix merge conflict

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2022-07-18 19:04:48 -07:00
Mateusz Rzeszutek 8d1ba17d29
InstrumentationConfig part 4: DB sanitization (#6317)
* InstrumentationConfig part 4: DB sanitization

* fix couchbase unit tests

* code review comments

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2022-07-15 21:47:33 -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 35c63a4184
Remove the 'noop API' feature (#6313)
* Remove the 'noop API' feature

* remove noop api dep

* fix tooling tests
2022-07-12 10:36:19 -07:00
Mateusz Rzeszutek b23db97a28
Use ConfigProperties in javaagent SPIs (#6285)
* Use ConfigProperties in javaagent SPIs

* remove deprecated

* errorprone

* fix javaagent build

* fix javaagent-tooling tests

* spotless
2022-07-12 08:41:01 +02:00
Mateusz Rzeszutek 7bbe918008
InstrumentationConfig part 2 (#6292) 2022-07-11 09:47:19 +02:00
Mateusz Rzeszutek e7887ac929
Idea: deprecate `Config`, add agent-only `InstrumentationConfig` (#6264)
* Idea: deprecate Config, add agent-only InstrumentationConfig

* fix

* fix camel test

* fix external-annotation tests
2022-07-08 16:20:49 +02:00
Mateusz Rzeszutek 198dad00d6
Prefer using ConfigProperties over Config in AgentListener (#6202)
* Prefer using ConfigProperties over Config in AgentListener

* normalize property name

* add TODOs
2022-07-07 15:44:32 +02:00
Trask Stalnaker 701ed54311
Use "class loader" instead of "classloader" consistently in docs and comments (#6236)
* Use "class loader" consistently instead of classloader

* Java comments too

* Fix bad merge
2022-06-30 14:57:07 -07:00
Mateusz Rzeszutek cb7421c592
Add an SPI for customizing Config just before it's set (#6010)
* Add an SPI for customizing Config just before it's set

* deprecate ConfigPropertySource in favor of ConfigCustomizer

* errorprone
2022-05-16 11:55:01 -07:00
Mateusz Rzeszutek 6a0ca530b7
Instrumentation API changes: VirtualField (#6017)
* Instrumentation API changes: VirtualField

* change class name in string constant
2022-05-12 11:17:24 -07:00
Mateusz Rzeszutek 25d929b5e7
Deprecate the AgentListener#beforeAgent() method (#6006)
* Deprecate the AgentListener#beforeAgent() method

* errorprone
2022-05-10 10:30:40 -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 202a24c867
Remove deprecated code from instrumentation-api, extension-api (#5883) 2022-04-19 12:22:11 -07:00