OpenTelemetry auto-instrumentation and instrumentation libraries for Java
Go to file
Felix Barnsteiner 56c52bc315
Add runtime.jvm.gc.collection.count metric (#2616)
* Add runtime.jvm.gc.collection.count metric

* Fix format violation

* Rename gc.collection to gc.collection.time

* Another rename 😅
2021-03-23 14:11:23 +02:00
.githooks Use Spotless for formatting (DataDog/dd-trace-java#1619) 2020-06-30 11:15:48 -07:00
.github Use azure/docker-login action (#2580) 2021-03-16 11:04:50 +02:00
benchmark Update old name (#2440) 2021-03-01 15:43:49 -08:00
benchmark-e2e AWS SDK - SNS to SQS tracing propagation test (#2483) 2021-03-04 13:33:22 -08:00
benchmark-integration Remove JCenter which is about to be sunset (#2387) 2021-03-19 23:21:52 +02:00
bom-alpha Publish a BOM (#2339) 2021-02-19 15:29:07 +09:00
buildSrc Remove JCenter which is about to be sunset (#2387) 2021-03-19 23:21:52 +02:00
docs Update supported libraries doc for rocketmq (#2575) 2021-03-15 13:27:11 +02:00
examples/distro Update example distro to 1.0.0 (#2507) 2021-03-07 20:12:00 -08:00
gradle Remove JCenter which is about to be sunset (#2387) 2021-03-19 23:21:52 +02:00
instrumentation Add runtime.jvm.gc.collection.count metric (#2616) 2021-03-23 14:11:23 +02:00
instrumentation-api Move attributes to span builder for use by samplers (#2587) 2021-03-17 15:02:56 +02:00
instrumentation-api-caching Fix shading of caching artifact. (#2523) 2021-03-08 13:32:20 +09:00
instrumentation-core Update servlet attr names to match log attr names (#2593) 2021-03-18 14:03:06 +02:00
javaagent Update old name (#2440) 2021-03-01 15:43:49 -08:00
javaagent-api Minor InstrumentationClassPredicate refactor (don't treat javaagent-t… (#2536) 2021-03-12 16:36:34 +01:00
javaagent-bootstrap Fix RestTemplateInterceptor so that it calls endExceptionally() on exception (#2516) 2021-03-08 09:36:47 -08:00
javaagent-bootstrap-tests Add a caching API based on caffeine for use from instrumentation, not just javaagent (#2477) 2021-03-05 17:57:23 +09:00
javaagent-spi Let the ComponentInstaller be passed a Config instance (#2569) 2021-03-18 00:11:42 +02:00
javaagent-tooling ComponentInstallers should run after LogManager if a custom one is detected (#2592) 2021-03-18 14:10:22 +02:00
licenses Better license grouping (#2297) 2021-02-16 09:00:08 -08:00
load-generator Update old name (#2440) 2021-03-01 15:43:49 -08:00
opentelemetry-api-shaded-for-instrumenting Update to OTel 0.14.1 (#2059) 2021-01-18 13:02:04 +09:00
opentelemetry-ext-annotations-shaded-for-instrumenting Rename auto annotations to ext annotations (#1799) 2020-11-29 21:04:55 -08:00
smoke-tests Add runtime.jvm.gc.collection.count metric (#2616) 2021-03-23 14:11:23 +02:00
testing Fix references of otel.trace. to otel.traces. (#2269) 2021-02-13 11:16:25 -08:00
testing-common Concurrent http client tests with connection reuse (#2550) 2021-03-16 16:27:54 +02:00
.editorconfig Update old name (#2440) 2021-03-01 15:43:49 -08:00
.gitattributes Add task to generate license report into licenses folder. (#2239) 2021-02-12 17:20:08 +09:00
.gitignore Remove usage of Contexts from grpc instrumentation. (#1426) 2020-10-21 09:58:45 +09:00
CONTRIBUTING.md Update CONTRIBUTING.md (#2426) 2021-03-09 09:49:51 -08:00
LICENSE Update to standard LICENSE file for OpenTelemetry (#19) 2019-11-19 09:46:10 -08:00
README.md give `service.name` additional visibility within the resource def. (#2563) 2021-03-12 08:47:01 +02:00
RELEASING.md Update links to workflows in RELEASING.md (#2340) 2021-02-19 15:39:58 +09:00
VERSIONING.md Add VERSIONING doc (#2490) 2021-03-05 10:54:26 -08:00
build.gradle Remove JCenter which is about to be sunset (#2387) 2021-03-19 23:21:52 +02:00
code-of-conduct.md Add code-of-conduct file. (#2341) 2021-02-19 16:24:41 +09:00
gradle.properties No more gradle warnings (#2103) 2021-01-26 08:24:18 +02:00
gradlew Upgrade to Gradle 6.6 (#1073) 2020-08-20 16:30:47 +09:00
gradlew.bat Upgrade to Gradle 6.6 (#1073) 2020-08-20 16:30:47 +09:00
settings.gradle Apache Camel - S3 to SQS propagation impl + tests (#2583) 2021-03-19 08:33:29 +02:00

README.md

<p align="center"> <strong> <a href="https://github.com/open-telemetry/opentelemetry-java-instrumentation#getting-started">Getting Started</a>   •   <a href="https://github.com/open-telemetry/community#special-interest-groups">Getting Involved</a>   •   <a href="https://github.com/open-telemetry/opentelemetry-java-instrumentation/discussions">Getting In Touch</a> </strong> </p> <p align="center"> <a href="https://github.com/open-telemetry/opentelemetry-java-instrumentation/actions?query=workflow%3A%22Nightly+build%22"> <img alt="Build Status" src="https://img.shields.io/github/workflow/status/open-telemetry/opentelemetry-java-instrumentation/Nightly%20build?style=for-the-badge"> </a> <a href="https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases"> <img alt="GitHub release (latest by date including pre-releases)" src="https://img.shields.io/github/v/release/open-telemetry/opentelemetry-java-instrumentation?include_prereleases&style=for-the-badge"> </a> <img alt="Beta" src="https://img.shields.io/badge/status-beta-informational?style=for-the-badge&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAIRlWElmTU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAACQAAAAAQAAAJAAAAABAAOgAQADAAAAAQABAACgAgAEAAAAAQAAABigAwAEAAAAAQAAABgAAAAA8A2UOAAAAAlwSFlzAAAWJQAAFiUBSVIk8AAAAVlpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iPgogICAgICAg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q+sAKi9jhHxNqagY2hiaYgRCm0f0QP7H4Fp11LSXiuBY2aYFlh0DeDIVVFUJQn5rCnpiNI2gvLxHnASn9DIVHJJlm5rXvQAGEo4zvKq2w5G1NxENN7jrft1oxMdekETjxdH2Z3x+VTVYsPb+O0C/9/auN6v2hNZw5b2UOmSbG5/rkC3LBA+1PdxFxORjxpQ81GcxKc+ybVjEBvUJvaGJ7p7n5A5KSwe4AzkasA+crmzFtowoIVTiLjANm8GDsrWW35ScI3JY8Urv83tnkF8JR0yLvEt2hO/0qNyy3Jb3YKeHeHeLeOuVLRpNF+pkf85OW7/zJxWdXsbsKBUk2TC0BCPwMq5Q/CPvaJFkNS/1l1qUPe+uH3oD59erYGI/Y4sce6KaXYElAIOLt+0O3t2+/xJDF1XvOlWGC1W1B8VMszbGfOvT5qaRRAIFK3BCO164nZ0uYLH2YjNN8thXS2v2BK9gTfD7jHVxzHr4roOlEvYYz9QIz+Vl/sLDXInsctFsXjqIRnO2ZO387lxmIboLDZCJ59KLFliNIgh9ipt6tLg9SihpRPDO1ia5byw7de1aCQmF5geOQtK509rzfdwxaKOIq+73AvwCC5/5fcV4vo3+3LpMdtWHh0ywsJC/ZGoCb8/9D8F/ifgLLl8S8QWfU8cAAAAASUVORK5CYII="> </p> <p align="center"> <strong> <a href="CONTRIBUTING.md">Contributing<a/>   •   <a href="docs/scope.md">Scope<a/>   •   <a href="docs/ga-requirements.md">Roadmap<a/> </strong> </p>

Getting Started   •   Getting Involved   •   Getting In Touch

Build Status GitHub release (latest by date including pre-releases) Beta

Contributing   •   Scope   •   Roadmap

OpenTelemetry Icon OpenTelemetry Instrumentation for Java

About

This project provides a Java agent JAR that can be attached to any Java 8+ application and dynamically injects bytecode to capture telemetry from a number of popular libraries and frameworks. You can export the telemetry data in a variety of formats. You can also configure the agent and exporter via command line arguments or environment variables. The net result is the ability to gather telemetry data from a Java application without code changes.

Getting Started

Download the latest version.

This package includes the instrumentation agent as well as instrumentations for all supported libraries and all available data exporters. The package provides a completely automatic, out-of-the-box experience.

Enable the instrumentation agent using the -javaagent flag to the JVM.

java -javaagent:path/to/opentelemetry-javaagent-all.jar \
     -jar myapp.jar

By default, the OpenTelemetry Java agent uses OTLP exporter configured to send data to OpenTelemetry collector at http://localhost:4317.

Configuration parameters are passed as Java system properties (-D flags) or as environment variables. See the configuration documentation for the full list of configuration items. For example:

java -javaagent:path/to/opentelemetry-javaagent-all.jar \
     -Dotel.resource.attributes=service.name=your-service-name \
     -Dotel.traces.exporter=zipkin \
     -jar myapp.jar

Configuring the Agent

The agent is highly configurable! Many aspects of the agent's behavior can be configured for your needs, such as exporter choice, exporter config (like where data is sent), trace context propagation headers, and much more.

Click here to see the detailed list of configuration environment variables and system properties.

Note: Config parameter names are very likely to change over time, so please check back here when trying out a new version! Please report any bugs or unexpected behavior you find.

Supported libraries, frameworks, and application servers

We support an impressively huge number of libraries and frameworks and a majority of the most popular application servers...right out of the box! Click here to see the full list and to learn more about disabled instrumentation and how to suppress unwanted instrumentation.

Manually instrumenting

For most users, the out-of-the-box instrumentation is completely sufficient and nothing more has to be done. Sometimes, however, users wish to add attributes to the otherwise automatic spans, or they might want to manually create spans for their own custom code.

See here for detailed instructions.

Logger MDC (Mapped Diagnostic Context) auto-instrumentation

It is possible to inject trace information like trace id and span id into your custom application logs.

See Logger MDC auto-instrumentation

Troubleshooting

To turn on the agent's internal debug logging:

-Dotel.javaagent.debug=true

Note: These logs are extremely verbose. Enable debug logging only when needed. Debug logging negatively impacts the performance of your application.

Roadmap to 1.0 (GA)

See GA Requirements

Contributing

See CONTRIBUTING.md.

Triagers (@open-telemetry/java-instrumentation-triagers):

Approvers (@open-telemetry/java-instrumentation-approvers):

Maintainers (@open-telemetry/java-instrumentation-maintainers):

Learn more about roles in the community repository.

Thanks to all the people who already contributed!