{"id":15177434,"url":"https://github.com/open-telemetry/opentelemetry-java-instrumentation","last_synced_at":"2026-03-14T22:58:40.039Z","repository":{"id":37072687,"uuid":"210933087","full_name":"open-telemetry/opentelemetry-java-instrumentation","owner":"open-telemetry","description":"OpenTelemetry auto-instrumentation and instrumentation libraries for Java","archived":false,"fork":false,"pushed_at":"2025-05-12T05:12:45.000Z","size":185151,"stargazers_count":2186,"open_issues_count":395,"forks_count":951,"subscribers_count":50,"default_branch":"main","last_synced_at":"2025-05-12T13:08:33.120Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://opentelemetry.io","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/open-telemetry.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"code-of-conduct.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":"docs/supported-libraries.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-09-25T20:19:14.000Z","updated_at":"2025-05-12T10:00:40.000Z","dependencies_parsed_at":"2024-04-18T17:45:11.181Z","dependency_job_id":"602b964b-cea2-4a92-aef0-9ea382efb4b8","html_url":"https://github.com/open-telemetry/opentelemetry-java-instrumentation","commit_stats":null,"previous_names":[],"tags_count":106,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-telemetry%2Fopentelemetry-java-instrumentation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-telemetry%2Fopentelemetry-java-instrumentation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-telemetry%2Fopentelemetry-java-instrumentation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-telemetry%2Fopentelemetry-java-instrumentation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/open-telemetry","download_url":"https://codeload.github.com/open-telemetry/opentelemetry-java-instrumentation/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253745160,"owners_count":21957317,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-27T14:22:15.741Z","updated_at":"2026-03-14T22:58:40.025Z","avatar_url":"https://github.com/open-telemetry.png","language":"Java","funding_links":[],"categories":["指标库","Java"],"sub_categories":[],"readme":"# OpenTelemetry Instrumentation for Java\n\n[![Release](https://img.shields.io/github/v/release/open-telemetry/opentelemetry-java-instrumentation?include_prereleases\u0026style=)](https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/)\n[![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/open-telemetry/opentelemetry-java-instrumentation/badge)](https://scorecard.dev/viewer/?uri=github.com/open-telemetry/opentelemetry-java-instrumentation)\n[![Slack](https://img.shields.io/badge/slack-@cncf/otel--java-blue.svg?logo=slack)](https://cloud-native.slack.com/archives/C014L2KCTE3)\n\n* [About](#about)\n* [Getting Started](#getting-started)\n* [Configuring the Agent](#configuring-the-agent)\n* [Supported libraries, frameworks, and application servers](#supported-libraries-frameworks-and-application-servers)\n* [Creating agent extensions](#creating-agent-extensions)\n* [Manually instrumenting](#manually-instrumenting)\n* [Logger MDC auto-instrumentation](#logger-mdc-mapped-diagnostic-context-auto-instrumentation)\n* [Troubleshooting](#troubleshooting)\n* [Contributing](#contributing)\n\n## About\n\nThis project provides a Java agent JAR that can be attached to any Java 8+\napplication and dynamically injects bytecode to capture telemetry from a\nnumber of popular libraries and frameworks.\nYou can export the telemetry data in a variety of formats.\nYou can also configure the agent and exporter via command line arguments\nor environment variables. The net result is the ability to gather telemetry\ndata from a Java application without code changes.\n\nThis repository also publishes standalone instrumentation for several libraries (and growing)\nthat can be used if you prefer that over using the Java agent.\nPlease see the standalone library instrumentation column\non [Supported Libraries](docs/supported-libraries.md#libraries--frameworks).\nIf you are looking for documentation on using those.\n\n## Getting Started\n\nDownload\nthe [latest version](https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/latest/download/opentelemetry-javaagent.jar).\n\nThis package includes the instrumentation agent as well as\ninstrumentations for all supported libraries and all available data exporters.\nThe package provides a completely automatic, out-of-the-box experience.\n\nEnable the instrumentation agent using the `-javaagent` flag to the JVM.\n\n```\njava -javaagent:path/to/opentelemetry-javaagent.jar \\\n     -jar myapp.jar\n```\n\nBy default, the OpenTelemetry Java agent uses the\n[OTLP exporter](https://github.com/open-telemetry/opentelemetry-java/tree/main/exporters/otlp)\nconfigured to send data to an\n[OpenTelemetry collector](https://github.com/open-telemetry/opentelemetry-collector/blob/main/receiver/otlpreceiver/README.md)\nat `http://localhost:4318`.\n\nConfiguration parameters are passed as Java system properties (`-D` flags) or\nas environment variables. See [the configuration documentation][config-agent]\nfor the full list of configuration items. For example:\n\n```\njava -javaagent:path/to/opentelemetry-javaagent.jar \\\n     -Dotel.resource.attributes=service.name=your-service-name \\\n     -Dotel.traces.exporter=zipkin \\\n     -jar myapp.jar\n```\n\n## Configuring the Agent\n\nThe agent is highly configurable! Many aspects of the agent's behavior can be\nconfigured for your needs, such as exporter choice, exporter config (like where\ndata is sent), trace context propagation headers, and much more.\n\nFor a detailed list of agent configuration options, see the [agent configuration docs][config-agent].\n\nFor a detailed list of additional SDK configuration environment variables and system properties,\nsee the [SDK configuration docs][config-sdk].\n\n*Note: Config parameter names are very likely to change over time, so please check\nback here when trying out a new version!\nPlease [report any bugs](https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues)\nor unexpected behavior you find.*\n\n## Supported libraries, frameworks, and application servers\n\nWe support an impressively huge number\nof [libraries and frameworks](docs/supported-libraries.md#libraries--frameworks) and\na majority of the most\npopular [application servers](docs/supported-libraries.md#application-servers)...right out of the\nbox!\n[Click here to see the full list](docs/supported-libraries.md) and to learn more about\n[disabled instrumentation](docs/supported-libraries.md#disabled-instrumentations)\nand how to [suppress unwanted instrumentation][suppress].\n\n## Creating agent extensions\n\n[Extensions](examples/extension/README.md) add new features and capabilities to the agent without\nhaving to create a separate distribution or to fork this repository. For example, you can create\ncustom samplers or span exporters, set new defaults, and embed it all in the agent to obtain a\nsingle jar file.\n\n## Creating an agent distribution\n\n[Distribution](examples/distro/README.md) provides guidance on creating a separate distribution, serving as a collection of examples for extending the functionality of the OpenTelemetry Java instrumentation agent. It also demonstrates how to repackage the agent while incorporating custom features.\n[Agent extensions](#creating-agent-extensions) are recommended instead for most users as they are simpler and do not require rebuilding with each OpenTelemetry Java agent release.\n\n## Manually instrumenting\n\nFor most users, the out-of-the-box instrumentation is completely sufficient and nothing more has to\nbe done. Sometimes, however, users wish to add attributes to the otherwise automatic spans,\nor they might want to manually create spans for their own custom code.\n\nFor detailed instructions, see [Manual instrumentation][manual].\n\n## Logger MDC (Mapped Diagnostic Context) auto-instrumentation\n\nIt is possible to inject trace information like trace IDs and span IDs into your\ncustom application logs. For details, see [Logger MDC\nauto-instrumentation](docs/logger-mdc-instrumentation.md).\n\n## Troubleshooting\n\nTo turn on the agent's internal debug logging:\n\n`-Dotel.javaagent.debug=true`\n\n**Note**: These logs are extremely verbose. Enable debug logging only when needed.\nDebug logging negatively impacts the performance of your application.\n\n## Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md).\n\n### Maintainers\n\n- [Lauri Tulmin](https://github.com/laurit), Splunk\n- [Trask Stalnaker](https://github.com/trask), Microsoft\n\nFor more information about the maintainer role, see the [community repository](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#maintainer).\n\n### Approvers\n\n- [Gregor Zeitlinger](https://github.com/zeitlinger), Grafana Labs\n- [Jack Berg](https://github.com/jack-berg), Grafana Labs\n- [Jason Plumb](https://github.com/breedx-splk), Splunk\n- [Jay DeLuca](https://github.com/jaydeluca), Grafana Labs\n- [Jean Bisutti](https://github.com/jeanbisutti), Microsoft\n- [John Watson](https://github.com/jkwatson), Sublime Security\n- [Jonas Kunz](https://github.com/JonasKunz), Elastic\n- [Steve Rao](https://github.com/steverao), Alibaba\n- [Sylvain Juge](https://github.com/SylvainJuge), Elastic\n\nFor more information about the approver role, see the [community repository](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#approver).\n\n### Emeritus maintainers\n\n- [Mateusz Rzeszutek](https://github.com/mateuszrzeszutek)\n- [Nikita Salnikov-Tarnovski](https://github.com/iNikem)\n- [Tyler Benson](https://github.com/tylerbenson)\n\nFor more information about the emeritus role, see the [community repository](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#emeritus-maintainerapprovertriager).\n\n### Thanks to all of our contributors!\n\n\u003ca href=\"https://github.com/open-telemetry/opentelemetry-java-instrumentation/graphs/contributors\"\u003e\n  \u003cimg alt=\"Repo contributors\" src=\"https://contrib.rocks/image?repo=open-telemetry/opentelemetry-java-instrumentation\" /\u003e\n\u003c/a\u003e\n\n[config-agent]: https://opentelemetry.io/docs/zero-code/java/agent/configuration/\n\n[config-sdk]: https://opentelemetry.io/docs/languages/java/configuration/\n\n[manual]: https://opentelemetry.io/docs/languages/java/instrumentation/#manual-instrumentation\n\n[suppress]: https://opentelemetry.io/docs/zero-code/java/agent/disable/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-telemetry%2Fopentelemetry-java-instrumentation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopen-telemetry%2Fopentelemetry-java-instrumentation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-telemetry%2Fopentelemetry-java-instrumentation/lists"}