Skip to content

JIM Data in Grafana

Explore JIM trace data in Grafana via the Summary, Audit, or Deep Dive workflows.

4 min read Updated SS

Requires Grafana access, a Jaeger data source and collected JIM traces.

Introduction#

The Java Instrumentation and Monitoring (JIM) agent monitors the Java applications of clients. JIM agent gives the execution time of the methods in the application, method parameter details, stack trace, exceptions occurred, etc.

JIM agent and client applications run on the target server. There may be multiple client applications running on the target server. One instance of the JIM agent monitors one instance of the application.

The JIM agent sends code-level analysis details to the Jaeger collector in the form of gRPC protocol buffers. Authorized administrators set JIM mode in Control Center through Java Intrusive Agent Setting; the agent receives the approved configuration from Control Center.

The Jaeger collector processes the data it receives from the JIM agent and stores the data in the OpenSearch database. In a microservices framework, where various microservices communicate with each other, you can capture the transaction flow using the JIM agent. Grafana is for visualization. You can view the details on the Grafana UI.

Jaeger Collector, OpenSearch, Jaeger Query API, and Grafana are part of the HEAL installer.

Viewing JIM data in Grafana#

You can instrument an application using the JIM agent. You can see service names corresponding to the application in Grafana. You can identify the application based on the service name. These services can be front-end, back-end, or query services. In Grafana, a service represents an application. You can view traces as per the query you execute. A trace consists of multiple spans. A span represents a captured operation; depending on the instrumentation, that operation can be a method, request, query, or client call. Each row in the trace view represents one captured span. Grafana displays spans in waterfall fashion.

Click Explore.

Grafana Welcome screen with Explore option

Select the Jaeger data source you created to view the traces and spans.

Selecting the Jaeger data source in Grafana Explore

Click Search.

Search query type with Service and Operation boxes

Select a service from the Service box.

Selecting a service from the Service box drop-down

Select an operation (method call) from the Operation box.

Selecting an operation from the Operation box drop-down

You can specify the query filter in the Tags box. You can select values in the Advanced Options section. Whatever value you provide in the Min Duration box, Grafana displays traces having durations greater than or equal to that value. Whatever value you provide in the Max Duration box, Grafana displays traces having durations less than or equal to that value. Provide the count of traces in the Limit box which you need to see in the query result.

Advanced options with Min Duration, Max Duration, and Limit boxes

Click 'Run query' in the top right corner. You can view the traces corresponding to the query execution.

Traces displayed in the Trace ID column after running the query

You can select the time period from the top right corner to view the results as per the time interval you select.

Selecting the time period and clicking a Trace ID to open the Trace View

Click on an ID in the Trace ID column. Grafana displays the Trace View in the right pane. Grafana displays all the spans corresponding to the trace and the method execution time for each of the spans. Grafana represents a service in a unique color in the trace. The waterfall positions each span relative to the trace start. Child and sibling spans can nest, overlap, or run concurrently, so do not calculate a span start by adding the prior row's duration.

Trace View showing spans for the selected trace
Trace View with expanded spans and execution times
Trace View showing spans in waterfall representation
Trace View with services represented in unique colors
Trace View showing method execution times for spans
Trace View showing waterfall of spans with start times
Span detail showing Tags, Processes, and Logs sections
Span Tags section showing attributes such as CPU time and System time

Grafana displays three sections for each span – Tags, Processes, and Logs. The logs section displays the stack trace for the method execution. The tags section displays various attributes related to the method, like thread counts, name of the method getting executed, status of the transaction, CPU time, System time, mode of the JIM agent, etc.

Grafana trace view showing App2Controller.getVeryBadHandler span tags
App2Controller.getVeryBadHandler span Tags panel in Grafana

Thread CPU time fields record the thread-CPU counters captured at operation entry and exit. Use their difference only according to the field semantics and units documented for the installed JIM agent version; do not assume clock ticks or a CPU-capacity percentage.

thread.cpu.time.entry and thread.cpu.time.exit are the captured entry and exit counter values.

The system-time field names and displayed units can vary by installed JIM and dashboard version. Confirm the unit shown by the current field definition before comparing values.

(sys.time.millis.exit - sys.time.millis.entry) is the elapsed system time.

(thread.cpu.time.exit - thread.cpu.time.entry) is the consumed CPU time.

If the elapsed system time and consumed CPU time are reasonably proportional, then the transaction is normal. An authorized administrator can set the JIM agent to Auto or Verbose through Java Intrusive Agent Setting. The status of a transaction can be OK, SLOW, or ERROR. Verbose mode adds load onto the server since it captures all types of transactions. The JIM agent captures stack traces for slow, error, and success spans in verbose mode. The JIM agent captures stack traces for slow and error spans in auto mode.

App2Controller.getVeryBadHandler span Tags panel with thread CPU time values
App2Controller.getVeryBadHandler span Logs entry showing stack trace
App2Controller.getVeryBadHandler span Tags panel in Grafana trace view
App2Controller.getVeryBadHandler span Tags panel showing span_status SLOW
Grafana Explore Jaeger trace view for Service2 /app1/mulcall
App2Controller.getBadHandler span Tags panel showing ERROR status
App2Controller.getBadHandler span Logs entry showing error stack trace
Grafana Explore Jaeger trace view with Service & Operation breakdown
App2Controller.getVeryBadHandler span Tags panel in Grafana trace view
App2Controller.getVeryBadHandler span Tags and query results in Grafana
App2Controller.getVeryBadHandler span Tags panel in Grafana trace view
App2Controller.getVeryBadHandler span Logs entry showing stack trace
BasicErrorController.errorHtml span Tags panel showing database details

JIM Dashboards#

Below are the different types of JIM dashboards: