Modern application architectures are complex, typically consisting of hundreds of distributed microservices implemented in different languages and by different teams. As a developer, SRE, or DevOps engineer, you are responsible for the reliability and performance of these complex systems. But while you might have metrics that will help you debug when there’s an issue, metrics alone can’t help you narrow down and ultimately identify the root cause.
With observability, you can ask questions about your system and get answers based on the telemetry data (metrics, traces, and logs) they produce. The tracing capabilities of VMware Tanzu Observability can help you pinpoint the root cause of failures and identify performance bottlenecks by analyzing every request moving across the various services.
So, using Tanzu Observability, how do we go about instrumenting our services to emit trace data? In addition to it supporting various instrumentation and ingestion methods for distributed tracing, Tanzu Observability now natively supports OpenTelemetry.
Support for OpenTelemetry
A new industry standard that merges OpenTracing and OpenCensus projects to offer a complete telemetry system for monitoring distributed systems, OpenTelemetry provides a set of APIs, SDKs, and integrations for collecting and exporting metrics, traces, and logs generated by your distributed microservices so they can be monitored and analyzed.
Let's explore how to get started with OpenTelemetry and Tanzu Observability without manually instrumenting your Java application. We can get you there in three simple steps.
Before we get started, you will need the following:
A Tanzu Observability account (If you don't have one already, you can sign up for one)
Java 8 or newer
Maven build tool
A sample application (download the beachshirts sample application)
Once you have all of those components, take the following steps.
Install Wavefront proxy
Configure your Tanzu Observability (Wavefront) URL and the token. (If you’ve signed up for the free trial, here’s how you can get your token.)
Install the OpenTelemetry Collector
Next, you’ll need to install the OpenTelemetry Collector.
Download the binary from the latest release of the OpenTelemetry Collector project and add it to a preferred directory.
In the same directory, create the otel_collector_config.yaml file and copy the below configuration to the yaml file. (Learn more about OpenTelemetry collector configuration.)
Navigate to the directory from your console and run the collector host with the config file using
--configparameter and the command
Auto-instrument the application
For instrumentation, we will use the Java agent provided by OpenTelemetry, which can be attached to any Java application. This agent will dynamically inject bytecode to collect telemetry data so that you don’t need to add any manual instrumentation.
Download the sample application and navigate to the directory.
Run mvn clean install from the root directory of the project.
Download the OpenTelemetry Java agent.
Attach the Java agent and start the services independently by executing the following commands.
Interact with your application to generate traces. For the sample application we’ve shared here, running the command below from the root directory will send requests to services every 10 seconds.
When the trace data collected from the OpenTelemetry collector are ingested, you can examine them in the Tanzu Observability user interface. Tanzu Observability gives you end-to-end visibility into the chain across services, even when those services are running in different environments. We enrich this trace data with application maps to help you understand interdependencies and the overall health of your application for faster root cause analysis.
From the Applications menu, you can access the out-of-the-box service dashboard that provides a health overview at a service level.
You can examine the traces using the Trace viewer page.
To see Tanzu Observability in action, watch this replay from our SpringOne 2021 keynote showing an example of how a team can use it to get to the bottom of an application incident.
Try it out!
The distributed tracing capabilities of VMware Tanzu Observability give you a single, concise view into your distributed systems, but it’s achievable only if you instrument your applications for distributed tracing. The good news is that OpenTelemetry provides a standard set of APIs and libraries for instrumenting our systems, and provides the foundation for auto-instrumentation of applications across languages and frameworks.
There’s much more to the Tanzu Observability platform, but hopefully we’ve piqued your interest enough so that you follow the prescribed steps to auto-instrument your Java application and install Tanzu Observability in order to experience it for yourself. Learn more or ask questions by joining the Tanzu Observability public Slack group.