Groovy apps that parse a lot of scripts can generate a lot of
classloaders that will ultimately end up causing the agent to cache a
LOT of memory. For example, some java code that uses the Gremlin groovy
script engine to dynamically create and execute scripts can reproduce
this:
```
GremlinGroovyScriptEngine engine = new GremlinGroovyScriptEngine();
Bindings bindings = new SimpleBindings();
TinkerGraph graph = TinkerGraph.open();
GraphTraversalSource g = graph.traversal();
bindings.put("g", g);
for (int i = 0; i < 100000; i++) {
engine.eval("g.V(" + i + ")", bindings);
if(i % 250 == 0) System.out.println("Iteration " + i);
}
```
I have manually confirmed that ignoring the groovy classloaders (in this
PR) prevent the agent from exploding the cache and holding onto memory.
I could use another brain in deciding if there could be other unintended
consequences.
This PR resolves#7629
This adds javaagent instrumentation for the
[jodd-http](https://http.jodd.org/) `HttpRequest`.
It creates `Http Client Spans` and `Http Client Metrics`, the lowest
supported version is `org.jodd:jodd-http:4.2.0` (most recent: `6.3.0`),
since this is the first version of the library supporting java 8, having
follow-redirect capability and `HttpRequest#overwriteHeader()` method.
The instrumented method's signature and return type `HttpRequest#send()`
has not been modified since, and therefore the instrumentation works for
all `jodd-http` versions above `4.2.0`.
Since this is my first contribution/instrumentation, I orientated myself
on the `apache-httpclient-5.0` instrumentation, but obviously I would be
glad to get some feedback on this
---------
Co-authored-by: Mateusz Rzeszutek <mrzeszutek@splunk.com>
Bumps `byteBuddyVersion` from 1.13.0 to 1.14.0.
Updates `net.bytebuddy:byte-buddy` from 1.13.0 to 1.14.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/raphw/byte-buddy/releases">net.bytebuddy:byte-buddy's
releases</a>.</em></p>
<blockquote>
<h2>Byte Buddy 1.14.0</h2>
<ul>
<li>Add <code>Step.Factory.ForDelegation</code> in
<code>MemberSubstitution</code> that allows for delegation similar to
<code>MethodDelegation</code> but in-code.</li>
<li>Add handlers for <code>MethodDelegation</code> and
<code>Advice</code> that leverage method handles for field access and
self-invocation.</li>
<li>Add <code>Step.Factory</code> for type assignment that allows
casting the return value from a previous step to another type.</li>
<li>Avoid usage of <code>URL</code> class loader as it is deprecated,
and use newer method if available.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/raphw/byte-buddy/blob/master/release-notes.md">net.bytebuddy:byte-buddy's
changelog</a>.</em></p>
<blockquote>
<h3>18. February 2023: version 1.14.0</h3>
<ul>
<li>Add <code>Step.Factory.ForDelegation</code> in
<code>MemberSubstitution</code> that allows for delegation similar to
<code>MethodDelegation</code> but in-code.</li>
<li>Add handlers for <code>MethodDelegation</code> and
<code>Advice</code> that leverage method handles for field access and
self-invocation.</li>
<li>Add <code>Step.Factory</code> for type assignment that allows
casting the return value from a previous step to another type.</li>
<li>Avoid usage of <code>URL</code> class loader as it is deprecated,
and use newer method if available.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="00da41ec54"><code>00da41e</code></a>
[maven-release-plugin] prepare release byte-buddy-1.14.0</li>
<li><a
href="c601a7886a"><code>c601a78</code></a>
[release] Release new version</li>
<li><a
href="102ee25440"><code>102ee25</code></a>
Avoid test execution on Java 7.</li>
<li><a
href="3b5f4dcb8a"><code>3b5f4dc</code></a>
Remove unused packages.</li>
<li><a
href="b42f78b2a5"><code>b42f78b</code></a>
Add scheme part to URI.</li>
<li><a
href="d94d66a18c"><code>d94d66a</code></a>
Add scheme part to URI.</li>
<li><a
href="aaa18f29c9"><code>aaa18f2</code></a>
Adjust expectation for dynamic lambda invocation.</li>
<li><a
href="0f3bd5f2e6"><code>0f3bd5f</code></a>
Add hints for spotbugs.</li>
<li><a
href="c2242c7f3c"><code>c2242c7</code></a>
fix javadoc.</li>
<li><a
href="0a2e4ea5d2"><code>0a2e4ea</code></a>
Merge pull request <a
href="https://github-redirect.dependabot.com/raphw/byte-buddy/issues/1407">#1407</a>
from capthua/master</li>
<li>Additional commits viewable in <a
href="https://github.com/raphw/byte-buddy/compare/byte-buddy-1.13.0...byte-buddy-1.14.0">compare
view</a></li>
</ul>
</details>
<br />
Updates `net.bytebuddy:byte-buddy-dep` from 1.13.0 to 1.14.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/raphw/byte-buddy/releases">net.bytebuddy:byte-buddy-dep's
releases</a>.</em></p>
<blockquote>
<h2>Byte Buddy 1.14.0</h2>
<ul>
<li>Add <code>Step.Factory.ForDelegation</code> in
<code>MemberSubstitution</code> that allows for delegation similar to
<code>MethodDelegation</code> but in-code.</li>
<li>Add handlers for <code>MethodDelegation</code> and
<code>Advice</code> that leverage method handles for field access and
self-invocation.</li>
<li>Add <code>Step.Factory</code> for type assignment that allows
casting the return value from a previous step to another type.</li>
<li>Avoid usage of <code>URL</code> class loader as it is deprecated,
and use newer method if available.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/raphw/byte-buddy/blob/master/release-notes.md">net.bytebuddy:byte-buddy-dep's
changelog</a>.</em></p>
<blockquote>
<h3>18. February 2023: version 1.14.0</h3>
<ul>
<li>Add <code>Step.Factory.ForDelegation</code> in
<code>MemberSubstitution</code> that allows for delegation similar to
<code>MethodDelegation</code> but in-code.</li>
<li>Add handlers for <code>MethodDelegation</code> and
<code>Advice</code> that leverage method handles for field access and
self-invocation.</li>
<li>Add <code>Step.Factory</code> for type assignment that allows
casting the return value from a previous step to another type.</li>
<li>Avoid usage of <code>URL</code> class loader as it is deprecated,
and use newer method if available.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="00da41ec54"><code>00da41e</code></a>
[maven-release-plugin] prepare release byte-buddy-1.14.0</li>
<li><a
href="c601a7886a"><code>c601a78</code></a>
[release] Release new version</li>
<li><a
href="102ee25440"><code>102ee25</code></a>
Avoid test execution on Java 7.</li>
<li><a
href="3b5f4dcb8a"><code>3b5f4dc</code></a>
Remove unused packages.</li>
<li><a
href="b42f78b2a5"><code>b42f78b</code></a>
Add scheme part to URI.</li>
<li><a
href="d94d66a18c"><code>d94d66a</code></a>
Add scheme part to URI.</li>
<li><a
href="aaa18f29c9"><code>aaa18f2</code></a>
Adjust expectation for dynamic lambda invocation.</li>
<li><a
href="0f3bd5f2e6"><code>0f3bd5f</code></a>
Add hints for spotbugs.</li>
<li><a
href="c2242c7f3c"><code>c2242c7</code></a>
fix javadoc.</li>
<li><a
href="0a2e4ea5d2"><code>0a2e4ea</code></a>
Merge pull request <a
href="https://github-redirect.dependabot.com/raphw/byte-buddy/issues/1407">#1407</a>
from capthua/master</li>
<li>Additional commits viewable in <a
href="https://github.com/raphw/byte-buddy/compare/byte-buddy-1.13.0...byte-buddy-1.14.0">compare
view</a></li>
</ul>
</details>
<br />
Updates `net.bytebuddy:byte-buddy-agent` from 1.13.0 to 1.14.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/raphw/byte-buddy/releases">net.bytebuddy:byte-buddy-agent's
releases</a>.</em></p>
<blockquote>
<h2>Byte Buddy 1.14.0</h2>
<ul>
<li>Add <code>Step.Factory.ForDelegation</code> in
<code>MemberSubstitution</code> that allows for delegation similar to
<code>MethodDelegation</code> but in-code.</li>
<li>Add handlers for <code>MethodDelegation</code> and
<code>Advice</code> that leverage method handles for field access and
self-invocation.</li>
<li>Add <code>Step.Factory</code> for type assignment that allows
casting the return value from a previous step to another type.</li>
<li>Avoid usage of <code>URL</code> class loader as it is deprecated,
and use newer method if available.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/raphw/byte-buddy/blob/master/release-notes.md">net.bytebuddy:byte-buddy-agent's
changelog</a>.</em></p>
<blockquote>
<h3>18. February 2023: version 1.14.0</h3>
<ul>
<li>Add <code>Step.Factory.ForDelegation</code> in
<code>MemberSubstitution</code> that allows for delegation similar to
<code>MethodDelegation</code> but in-code.</li>
<li>Add handlers for <code>MethodDelegation</code> and
<code>Advice</code> that leverage method handles for field access and
self-invocation.</li>
<li>Add <code>Step.Factory</code> for type assignment that allows
casting the return value from a previous step to another type.</li>
<li>Avoid usage of <code>URL</code> class loader as it is deprecated,
and use newer method if available.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="00da41ec54"><code>00da41e</code></a>
[maven-release-plugin] prepare release byte-buddy-1.14.0</li>
<li><a
href="c601a7886a"><code>c601a78</code></a>
[release] Release new version</li>
<li><a
href="102ee25440"><code>102ee25</code></a>
Avoid test execution on Java 7.</li>
<li><a
href="3b5f4dcb8a"><code>3b5f4dc</code></a>
Remove unused packages.</li>
<li><a
href="b42f78b2a5"><code>b42f78b</code></a>
Add scheme part to URI.</li>
<li><a
href="d94d66a18c"><code>d94d66a</code></a>
Add scheme part to URI.</li>
<li><a
href="aaa18f29c9"><code>aaa18f2</code></a>
Adjust expectation for dynamic lambda invocation.</li>
<li><a
href="0f3bd5f2e6"><code>0f3bd5f</code></a>
Add hints for spotbugs.</li>
<li><a
href="c2242c7f3c"><code>c2242c7</code></a>
fix javadoc.</li>
<li><a
href="0a2e4ea5d2"><code>0a2e4ea</code></a>
Merge pull request <a
href="https://github-redirect.dependabot.com/raphw/byte-buddy/issues/1407">#1407</a>
from capthua/master</li>
<li>Additional commits viewable in <a
href="https://github.com/raphw/byte-buddy/compare/byte-buddy-1.13.0...byte-buddy-1.14.0">compare
view</a></li>
</ul>
</details>
<br />
Updates `net.bytebuddy:byte-buddy-gradle-plugin` from 1.13.0 to 1.14.0
You can trigger a rebase of this PR by commenting `@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
</details>
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: opentelemetrybot <107717825+opentelemetrybot@users.noreply.github.com>
Co-authored-by: Lauri Tulmin <ltulmin@splunk.com>
Bumps
[net.bytebuddy:byte-buddy-dep](https://github.com/raphw/byte-buddy) from
1.13.0 to 1.14.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/raphw/byte-buddy/releases">net.bytebuddy:byte-buddy-dep's
releases</a>.</em></p>
<blockquote>
<h2>Byte Buddy 1.14.0</h2>
<ul>
<li>Add <code>Step.Factory.ForDelegation</code> in
<code>MemberSubstitution</code> that allows for delegation similar to
<code>MethodDelegation</code> but in-code.</li>
<li>Add handlers for <code>MethodDelegation</code> and
<code>Advice</code> that leverage method handles for field access and
self-invocation.</li>
<li>Add <code>Step.Factory</code> for type assignment that allows
casting the return value from a previous step to another type.</li>
<li>Avoid usage of <code>URL</code> class loader as it is deprecated,
and use newer method if available.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/raphw/byte-buddy/blob/master/release-notes.md">net.bytebuddy:byte-buddy-dep's
changelog</a>.</em></p>
<blockquote>
<h3>18. February 2023: version 1.14.0</h3>
<ul>
<li>Add <code>Step.Factory.ForDelegation</code> in
<code>MemberSubstitution</code> that allows for delegation similar to
<code>MethodDelegation</code> but in-code.</li>
<li>Add handlers for <code>MethodDelegation</code> and
<code>Advice</code> that leverage method handles for field access and
self-invocation.</li>
<li>Add <code>Step.Factory</code> for type assignment that allows
casting the return value from a previous step to another type.</li>
<li>Avoid usage of <code>URL</code> class loader as it is deprecated,
and use newer method if available.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="00da41ec54"><code>00da41e</code></a>
[maven-release-plugin] prepare release byte-buddy-1.14.0</li>
<li><a
href="c601a7886a"><code>c601a78</code></a>
[release] Release new version</li>
<li><a
href="102ee25440"><code>102ee25</code></a>
Avoid test execution on Java 7.</li>
<li><a
href="3b5f4dcb8a"><code>3b5f4dc</code></a>
Remove unused packages.</li>
<li><a
href="b42f78b2a5"><code>b42f78b</code></a>
Add scheme part to URI.</li>
<li><a
href="d94d66a18c"><code>d94d66a</code></a>
Add scheme part to URI.</li>
<li><a
href="aaa18f29c9"><code>aaa18f2</code></a>
Adjust expectation for dynamic lambda invocation.</li>
<li><a
href="0f3bd5f2e6"><code>0f3bd5f</code></a>
Add hints for spotbugs.</li>
<li><a
href="c2242c7f3c"><code>c2242c7</code></a>
fix javadoc.</li>
<li><a
href="0a2e4ea5d2"><code>0a2e4ea</code></a>
Merge pull request <a
href="https://github-redirect.dependabot.com/raphw/byte-buddy/issues/1407">#1407</a>
from capthua/master</li>
<li>Additional commits viewable in <a
href="https://github.com/raphw/byte-buddy/compare/byte-buddy-1.13.0...byte-buddy-1.14.0">compare
view</a></li>
</ul>
</details>
<br />
[](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
You can trigger a rebase of this PR by commenting `@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
</details>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps com.github.ben-manes.versions from 0.45.0 to 0.46.0.
[](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
You can trigger a rebase of this PR by commenting `@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
</details>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Another part of #932
In this PR I changed all the library instrumentation packages -- these
are breaking changes, so I figured the earlier we do this the less
painful it'll be to the users. I know that at least some of them are
actively used, so we'll need to spell this out in the release notes.
---------
Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
Hi,
I copied existing JSF 1.2-2 instrumentation, updated dependencies and
namespaces related to JSF 3+.
I don't work with Mojjara implementation, but copied by analogy and
verified that package names are unchanged.
I named new packages by anology with `servlet` packages, but I use
`jsf-jakarta-common` when in servlet we have `servlet-javax-common`.
My idea was to avoid touching existing packages, but perhaps to keep
consistency, I can rename old `jsf-common` to `jsf-javax-common`.
Tested with Tomcat and my app, it's working fine with JSF 4 :)
Basically, `akka-http` instrumenter has the responsibility to instrument
the `http.server.duration` for the Play framework application, but the
current implementation has not marked the `http.route` attribute.
ref:
8e8161cb2e/instrumentation/akka/akka-http-10.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/akkahttp/server/AkkaHttpServerAttributesGetter.java (L59)
Actually, it's hard to record that attribute by only the akka-http layer
because that library's request object doesn't hold the route
information, e.g. placeholder.
So this patch delegates that job to the `play-mvc` instrumenter and when
that has been able to get the route info, the instrumenter puts
`http.route` attribute onto `http.server.duration`.
For example, when the routes configuration of the Play is like the
following:
```
GET /foo/:bar controllers.HomeController.doSomething(bar: String)
```
and when it tries to access that API, then OTEL instruments like so:
```prometheus
http_server_duration_count{otel_scope_name="io.opentelemetry.akka-http-10.0",otel_scope_version="1.23.0-alpha-SNAPSHOT",http_flavor="1.1",http_method="GET",http_route="/foo/$bar<[^/]+>",http_scheme="http",http_status_code="200",net_host_name="localhost",net_host_port="9000"} 1.0 1676078079798
http_server_duration_sum{otel_scope_name="io.opentelemetry.akka-http-10.0",otel_scope_version="1.23.0-alpha-SNAPSHOT",http_flavor="1.1",http_method="GET",http_route="/foo/$bar<[^/]+>",http_scheme="http",http_status_code="200",net_host_name="localhost",net_host_port="9000"} 12183.558843 1676078079798
http_server_duration_bucket{otel_scope_name="io.opentelemetry.akka-http-10.0",otel_scope_version="1.23.0-alpha-SNAPSHOT",http_flavor="1.1",http_method="GET",http_route="/foo/$bar<[^/]+>",http_scheme="http",http_status_code="200",net_host_name="localhost",net_host_port="9000",le="0.0"} 0.0 1676078079798
...
http_server_duration_bucket{otel_scope_name="io.opentelemetry.akka-http-10.0",otel_scope_version="1.23.0-alpha-SNAPSHOT",http_flavor="1.1",http_method="GET",http_route="/foo/$bar<[^/]+>",http_scheme="http",http_status_code="200",net_host_name="localhost",net_host_port="9000",le="+Inf"} 1.0 1676078079798
```
Rel: #1415
---------
Signed-off-by: moznion <moznion@mail.moznion.net>
We are seeing examples where Spring Scheduling INTERNAL spans are
created inside of an existing parent span, which creates unnecessary
noise.
And these spans don't necessary make sense as these are not "background
jobs" (since they occur inside of an existing span).
(see for example
https://github.com/microsoft/ApplicationInsights-Java/issues/2870)
This PR changes Spring Scheduling instrumentation to only instrumenting
repeating jobs, not one-time scheduled jobs (which corresponds to
ScheduledExecutorService behavior where context is not propagated to
runnable)
---------
Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>