In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "what is the information of OpenTelemetry Java agent". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Now let the editor to take you to learn "what is the information of the OpenTelemetry Java agent?"
What is OpenTelemetry?
OpenTelemetry is a set of code, a set of API, SDK, tools, and integrations that help you generate, send, collect, process, and export Telemetry data.
Telemetry data captured by OpenTelemetry can make your system and applications observable. It also standardizes the process. The data you collect using OpenTelemetry is vendor-independent and can be exported in a variety of formats.
OpenTelemetry does not come with back-end analysis tools. For the storage, analysis, and visualization of Telemetry data, you can also use full-stack observability platforms like SigNoz.
How do we use OpenTelemetry to generate Telemetry data?
Telemetry data is generated using a process called detection. OpenTelemetry provides a detection library for manual and automatic detection. These libraries are specific to the language they use. The instructions for setting up detection also vary from programming language to programming language.
OpenTelemetry defines a detection library as a library that supports the observability of another library.
OpenTelemetry Java library
For Java applications, OpenTelemetry provides three repositories:
The opentelemetry-java repo is the primary OpenTelemetry Java SDK and provides components for manual detection. The top-level components include OpenTelemetry API, extension, SDK, and the bridging layer for OpenTracing and OpenCensus.
Opentelemetry-java-instrumentation, a sibling project of opentelemetry-java, provides an integrated, easy-to-install automatic detection Java agent. The OpenTelemetry Java agent enables you to capture Telemetry data from many popular libraries and frameworks. You need to attach it to any Java 8 + application. We will learn more about the Java agent below.
Opentelemetry-java-contribOpenTelemetry java provides this repo to cover JVM-based applications and workflows that are not suitable for the scope of opentelemetry-java and opentelemetry-java-instrumentation.
What is an OpenTelemetry Java agent?
OpenTelemetry has a very convenient Java JAR agent that can be attached to any Java 8 + application to detect Java applications. The Java JAR agent can detect many popular libraries and frameworks and test them out of the box to generate telemetry data.
The OpenTelemetry collector captures the generated Telemetry data, which can then be exported to the desired format. If you are using SigNoz, you can use the default OTLP exporter. The Java agent and exporter can configure some environment variables from the command line. You don't need to make any changes to the code, which is why it's so convenient to start using the OpenTelemetry Java proxy.
How do I use the OpenTelemetry Java agent?
You need to download and distribute the Java agent for each host you want to monitor.
To use the OpenTelemetry Java proxy:
Download the latest Java JAR agent and distribute it to each monitored host and service.
Prepare environment variables, such as the service name of the monitored service and the endpoint to which the data will be exported
Attach the agent to the application's jar at run time
If you want to export data to observability tools such as SigNoz, you must specify the IP address of the host hosting the SigNoz. SigNoz listens for incoming data at port number 4317. So remember the port number 4317 on which incoming requests are allowed to SigNoz.
Examples of some environment variables to deal with:
OTEL_TRACES_EXPORTER=otlpOTEL_METRICS_EXPORTER=noneOTEL_EXPORTER_OTLP_ENDPOINT=:4317OTEL_RESOURCE_ATTRIBUTES= "service.name=SERVICE_NAME"
Let's see what the command looks like when you want to run the Java agent attached to the application:
OTEL_METRICS_EXPORTER=noneOTEL_EXPORTER_OTLP_ENDPOINT= "http://:4317"OTEL_RESOURCE_ATTRIBUTES=service.name=javaAppjava-javaagent:/path/to/opentelemetry-javaagent-all.jar-jar target/*.jar
The path to the Java agent JAR file needs to be replaced with the location where the file was downloaded. For example, for my local, the command is as follows:
OTEL_METRICS_EXPORTER=noneOTEL_EXPORTER_OTLP_ENDPOINT= "http://:4317"OTEL_RESOURCE_ATTRIBUTES=service.name=javaAppjava-javaagent:/Users/Downloads/to/opentelemetry-javaagent-all.jar-jar target/*.jar
With this, the OpenTelemetry Java agent will dynamically inject bytecode to capture telemetry data from many popular libraries and frameworks. Let's take a look at some of the libraries and frameworks included in the list.
List of libraries and frameworks supported by the OpenTelemetry Java agent
Libraries and frameworks for automatic detection supported by the OpenTelemetry Java agent include:
Akka HTTP 10.0 +
Apache HttpClient 2.0 +
AWS Lambda 1.0 +
AWS Development Kit 1.11.x and 2.2.0+
Cassandra driver 3.0 +
Elastic search API 5.0 +
Elasticsearch REST client 5.0 +
GRPC 1.6 +
JDBC Java 8 +
Jedi 1.4 +
Kafka 0.11 +
Kubernetes client 7.0 +
MongoDB driver 3.1 +
OkHttp 3.0 +
RabbitMQ client 2.7 +
Spark Web Framework 2.3 +
Spring Web Service 2.0 +
Vert.x 3.0 +
Some of the popular application servers supported by the Java agent include Glassfish, JBoss EAP, Jetty, Payara, Tomcat, TomEE, Weblogic, and Wildfly.
You can find a complete list of supported libraries and frameworks supported by the OpenTelemetry Java agent in the opentelemetry-java-instrumentation GitHub repository.
At this point, I believe you have a deeper understanding of "what is the information of the OpenTelemetry Java agent?" you might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.