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.
Bumps
[com.linecorp.armeria:armeria-junit5](https://github.com/line/armeria)
from 1.21.0 to 1.22.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/line/armeria/releases">com.linecorp.armeria:armeria-junit5's
releases</a>.</em></p>
<blockquote>
<h2>armeria-1.22.0</h2>
<p>See <a href="https://armeria.dev/release-notes/1.22.0/">the release
notes</a> for the complete change list.</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="c1fca3092b"><code>c1fca30</code></a>
Release armeria-1.22.0</li>
<li><a
href="904aee7e08"><code>904aee7</code></a>
Add release notes for 1.22.0 (<a
href="https://github-redirect.dependabot.com/line/armeria/issues/4656">#4656</a>)</li>
<li><a
href="a43cfa2204"><code>a43cfa2</code></a>
Return "431 Request Header Fields Too Large" for long headers
on HTTP/1 (<a
href="https://github-redirect.dependabot.com/line/armeria/issues/4655">#4655</a>)</li>
<li><a
href="e971022cc0"><code>e971022</code></a>
Fix a bug where duplicate parameters are shown in DocService (<a
href="https://github-redirect.dependabot.com/line/armeria/issues/4645">#4645</a>)</li>
<li><a
href="3713d52f39"><code>3713d52</code></a>
Fix a bug where <code>ClosedSessionException</code> is set to
<code>responseCause</code> for a succ...</li>
<li><a
href="bfc1924444"><code>bfc1924</code></a>
Use gRPC StatusRuntimeException instead of StatusException. (<a
href="https://github-redirect.dependabot.com/line/armeria/issues/4658">#4658</a>)</li>
<li><a
href="c11b7abf74"><code>c11b7ab</code></a>
Upgrade dependencies for 1.22.0 (<a
href="https://github-redirect.dependabot.com/line/armeria/issues/4653">#4653</a>)</li>
<li><a
href="c2cadb8c80"><code>c2cadb8</code></a>
Fix a <code>NullPointerException</code> raised while an aborted
<code>FixedStreamMessage</code> is ...</li>
<li><a
href="c6013672ac"><code>c601367</code></a>
Add <code>AsyncServerInterceptor</code> for gRPC services (<a
href="https://github-redirect.dependabot.com/line/armeria/issues/4647">#4647</a>)</li>
<li><a
href="36164e279f"><code>36164e2</code></a>
Support Thrift TypeDef in DocService (<a
href="https://github-redirect.dependabot.com/line/armeria/issues/4628">#4628</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/line/armeria/compare/armeria-1.21.0...armeria-1.22.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>
There were so many changes in the tests that extracting a base class
wouldn't really improve the readability; so I just reimplemented them in
Java.
The instrumentation itself is pretty much a copy-paste of the `jms-1.1`
instrumentation, with `s/javax/jakarta/` applied.
Bumps [spotless-plugin-gradle](https://github.com/diffplug/spotless)
from 6.12.0 to 6.12.1.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="718a504c12"><code>718a504</code></a>
Published gradle/6.12.1</li>
<li><a
href="c13acee213"><code>c13acee</code></a>
Published lib/2.31.1</li>
<li><a
href="552aabf876"><code>552aabf</code></a>
fix(deps): update dependency com.facebook:ktfmt to v0.42 (<a
href="https://github-redirect.dependabot.com/diffplug/spotless/issues/1421">#1421</a>)</li>
<li><a
href="4063e9f6d1"><code>4063e9f</code></a>
Add support for KtLint 0.48.0 (<a
href="https://github-redirect.dependabot.com/diffplug/spotless/issues/1432">#1432</a>
fixes <a
href="https://github-redirect.dependabot.com/diffplug/spotless/issues/1430">#1430</a>)</li>
<li><a
href="062e835846"><code>062e835</code></a>
Bump changelogs.</li>
<li><a
href="8f7e00594d"><code>8f7e005</code></a>
spotlessApply</li>
<li><a
href="9a8ccae9ec"><code>9a8ccae</code></a>
Bump default ktfmt 0.41 -> 0.42</li>
<li><a
href="fb4277d2b1"><code>fb4277d</code></a>
Merge branch 'main-ktlint-0.48.0' into renovate/ver_ktfmt</li>
<li><a
href="b44d70d00a"><code>b44d70d</code></a>
Move changelog entries to the correct release.</li>
<li><a
href="b3d8e89002"><code>b3d8e89</code></a>
spotlessApply for 2023</li>
<li>Additional commits viewable in <a
href="https://github.com/diffplug/spotless/compare/gradle/6.12.0...gradle/6.12.1">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>
Co-authored-by: Mateusz Rzeszutek <mrzeszutek@splunk.com>
Bumps [armeria-junit5](https://github.com/line/armeria) from 1.20.3 to
1.21.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/line/armeria/releases">armeria-junit5's
releases</a>.</em></p>
<blockquote>
<h2>armeria-1.21.0</h2>
<p>See <a href="https://armeria.dev/release-notes/1.21.0/">the release
notes</a> for the complete change list.</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="a2de8291b1"><code>a2de829</code></a>
Release armeria-1.21.0</li>
<li><a
href="684329f5ee"><code>684329f</code></a>
Update to use JDK 19 when releasing</li>
<li><a
href="fbc45b3a39"><code>fbc45b3</code></a>
Update the project version to 1.21.1-SNAPSHOT</li>
<li><a
href="d18f029a72"><code>d18f029</code></a>
Add release note for 1.21.0 and 1.16.1 (<a
href="https://github-redirect.dependabot.com/line/armeria/issues/4581">#4581</a>)</li>
<li><a
href="3a23bffac4"><code>3a23bff</code></a>
Update dependencies (<a
href="https://github-redirect.dependabot.com/line/armeria/issues/4579">#4579</a>)</li>
<li><a
href="2ff218bae2"><code>2ff218b</code></a>
build with jdk 19 and Gradle 7.6 (<a
href="https://github-redirect.dependabot.com/line/armeria/issues/4466">#4466</a>)</li>
<li><a
href="5d92b30a73"><code>5d92b30</code></a>
<code>Flags#meterRegistry</code> returns a <code>MeterRegistry</code>
(<a
href="https://github-redirect.dependabot.com/line/armeria/issues/4580">#4580</a>)</li>
<li><a
href="dd49448e73"><code>dd49448</code></a>
Limit the max length of decoded content in
<code>Decoding{Service,Client}</code> (<a
href="https://github-redirect.dependabot.com/line/armeria/issues/4564">#4564</a>)</li>
<li><a
href="fee87f8da9"><code>fee87f8</code></a>
Add client and server default headers (<a
href="https://github-redirect.dependabot.com/line/armeria/issues/4520">#4520</a>)</li>
<li><a
href="f4781d52a3"><code>f4781d5</code></a>
Fix a deadlock when a late response are written first in HTTP/1
pipelining (#...</li>
<li>Additional commits viewable in <a
href="https://github.com/line/armeria/compare/armeria-1.20.3...armeria-1.21.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>
Related to #7220
Unfortunately it doesn't fix the aforementioned issue; while the CL used
is no longer the agent classloader, gauge collection still throws that
error.
Still, I think this is a good change that removes one source of agent's
CL leaking into application runtime.
Working PR to capture all the changes required to update to otel java
1.19.0. The new log API force allows
`:instrumentation-appender-api-internal` and
`:instrumentation-appender-sdk-internal`, but necessitates a decent
amount of refactoring as a result.
The PR points at the `1.19.0-SNAPSHOT`, which I'll update upon
publication.
Co-authored-by: Mateusz Rzeszutek <mrzeszutek@splunk.com>
Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
Co-authored-by: Lauri Tulmin <ltulmin@splunk.com>
* Move concurrent instrumentation utils out from javaagent-instrumentation-api
* Move AgentLogEmitterProvider, InstrumentedTaskClasses and OpenTelemetrySdkAccess out of javaagent-instrumentation-api
* during install, hook up the log emitter provider for instrumentation to use.
* spotless
* Fix tests
* Default instrumentation name to ROOT when logger name null/empty
Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
* rename artifacts and packages
* Library users shouldn't need to use internal
* Update docs
* Rename in order to simplify HelperClassPredicate
* Spotless
* Move AgentLogEmitterProvider to javaagent-instrumentation-api
* Update Armeria for testing
* Fix aws sdk and netty tests for armeria update (#4841)
* Fix aws sdk tests for armeria update
* fix flaky aws11 test
* send path instread of full uri
* send path instread of full uri
* fix flaky aws11 test
* fix netty tests
* spotless
Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
Co-authored-by: Lauri Tulmin <ltulmin@splunk.com>