opentelemetry-java-instrume.../examples/distro
dependabot[bot] 7235043d0d
Bump net.bytebuddy:byte-buddy-dep from 1.14.2 to 1.14.3 in /examples/distro (#8154)
Bumps
[net.bytebuddy:byte-buddy-dep](https://github.com/raphw/byte-buddy) from
1.14.2 to 1.14.3.
<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.3</h2>
<ul>
<li>Make <code>MethodGraph.Compiler</code> failsafe when processing
incomplete methods.</li>
<li>Update ASM.</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>13. March 2023: version 1.14.3</h3>
<ul>
<li>Make <code>MethodGraph.Compiler</code> failsafe when processing
incomplete methods.</li>
<li>Update ASM.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="bee0115cf7"><code>bee0115</code></a>
[maven-release-plugin] prepare release byte-buddy-1.14.3</li>
<li><a
href="2e50ec0ce7"><code>2e50ec0</code></a>
[release] Release new version.</li>
<li><a
href="57e32d779a"><code>57e32d7</code></a>
[release] Release new version.</li>
<li><a
href="389e408f41"><code>389e408</code></a>
Fjerner import.</li>
<li><a
href="c66e3086eb"><code>c66e308</code></a>
Add fail safe wrapper to registry.</li>
<li><a
href="9609c3232e"><code>9609c32</code></a>
Update internal Byte Buddy and checksums.</li>
<li><a
href="518c31d9a5"><code>518c31d</code></a>
[maven-release-plugin] prepare for next development iteration</li>
<li>See full diff in <a
href="https://github.com/raphw/byte-buddy/compare/byte-buddy-1.14.2...byte-buddy-1.14.3">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.14.2&new-version=1.14.3)](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-03-29 08:00:54 +00: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 Upgrade to gradle 8.0.2 (#7978) 2023-03-07 10:29:26 +02:00
instrumentation Update HTTP span name extractors (#7730) 2023-02-14 07:40:05 -08:00
smoke-tests Bump ch.qos.logback:logback-classic from 1.4.5 to 1.4.6 in /examples/distro (#8062) 2023-03-16 09:02:35 +02: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.14.2 to 1.14.3 in /examples/distro (#8154) 2023-03-29 08:00:54 +00:00
gradle.properties Run Gradle and compile code with Java 17 (#5623) 2022-03-18 15:38:51 -07:00
gradlew Upgrade to gradle 8.0.2 (#7978) 2023-03-07 10:29:26 +02:00
gradlew.bat Upgrade to gradle 8.0.2 (#7978) 2023-03-07 10:29:26 +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.