opentelemetry-java-instrume.../examples/distro
dependabot[bot] 22d21553e0
Bump net.bytebuddy:byte-buddy-dep from 1.13.0 to 1.14.0 in /examples/distro (#7864)
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 />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=net.bytebuddy:byte-buddy-dep&package-manager=gradle&previous-version=1.13.0&new-version=1.14.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>
2023-02-21 09:51:27 +02:00
..
agent Upgrade to otel java 1.19.0 (#6757) 2022-10-12 09:19:37 -07:00
bootstrap Improve sample distro (#6531) 2022-09-02 12:40:29 +02:00
custom Auto-update OTel SDK (#7633) 2023-02-10 21:34:47 +00:00
gradle Auto-update OTel SDK (#7633) 2023-02-10 21:34:47 +00:00
instrumentation Update HTTP span name extractors (#7730) 2023-02-14 07:40:05 -08:00
smoke-tests Bump com.google.protobuf:protobuf-java-util from 3.21.12 to 3.22.0 in /examples/distro (#7846) 2023-02-16 15:57:58 -08:00
testing/agent-for-testing Upgrade to otel java 1.19.0 (#6757) 2022-10-12 09:19:37 -07:00
README.md Introduce markdown lint check (#7175) 2022-11-16 20:48:42 -08:00
build.gradle Bump net.bytebuddy:byte-buddy-dep from 1.13.0 to 1.14.0 in /examples/distro (#7864) 2023-02-21 09:51:27 +02:00
gradle.properties Run Gradle and compile code with Java 17 (#5623) 2022-03-18 15:38:51 -07:00
gradlew Update gradle to 7.5.1 (#6359) 2022-08-12 12:03:43 +02:00
gradlew.bat Update gradle to 7.5.1 (#6359) 2022-08-12 12:03:43 +02:00
settings.gradle Improve sample distro (#6531) 2022-09-02 12:40:29 +02:00

README.md

Distro

Introduction

This repository serves as a collection of examples of extending functionality of OpenTelemetry Java instrumentation agent. It demonstrates how to repackage the aforementioned agent adding custom functionality. For every extension point provided by OpenTelemetry Java instrumentation, this repository contains an example of its usage.

General structure

This repository has four main submodules:

  • custom contains all custom functionality, SPI and other extensions
  • agent contains the main repackaging functionality and, optionally, an entry point to the agent, if one wishes to customize that
  • instrumentation contains custom instrumentations added by vendor
  • smoke-tests contains simple tests to verify that resulting agent builds and applies correctly

Extensions examples

Instrumentation customisation

There are several options to override or customise instrumentation provided by the upstream agent. The following description follows one specific use-case:

Instrumentation X from Otel distribution creates span that I don't like and I want to change it in my vendor distro.

As an example, let us take some database client instrumentation that creates a span for database call and extracts data from db connection to provide attributes for that span.

I don't want this span at all

The easiest case. You can just pre-configure your distribution and disable given instrumentation.

I want to add/modify some attributes and their values does NOT depend on a specific db connection instance

E.g. you want to add some data from call stack as span attribute. In this case just provide your custom SpanProcessor. No need for touching instrumentation itself.

I want to add/modify some attributes and their values depend on a specific db connection instance

Write a new instrumentation which injects its own advice into the same method as the original one. Use getOrder method to ensure it is run after the original instrumentation. Now you can augment current span with new information.

See DemoServlet3Instrumentation.

I want to remove some attributes

Write custom exporter or use attribute filtering functionality in Collector.

I don't like Otel span at all. I want to significantly modify it and its lifecycle

Disable existing instrumentation. Write a new one, which injects Advice into the same (or better) method as the original instrumentation. Write your own Advice for this. Use existing Tracer directly or extend it. As you have your own Advice, you can control which Tracer you use.