Skip to main content

How are Metrics Calculated?

In Trace0, JVM metrics come from the following two OpenTelemetry sources:
  • Requests metrics are calculated from the service’s SPAN_KIND_SERVER spans, one per request the service handles. Request count, requests per second, latency percentiles and errors are all derived from these spans and their durations and statuses.
  • JVM runtime metrics (Memory, Garbage Collection, Threads, Buffers, Classes, CPU and File Descriptors) are calculated from the OpenTelemetry metrics the JVM reports, as defined by the OpenTelemetry semantic conventions for JVM metrics.

Service Instances

JVM runtime metrics are reported separately by each instance of your service, so we show them for one instance at a time. Requests metrics are calculated from spans and cover all instances. We identify an instance using one of the following OpenTelemetry resource attributes, in order of preference: Select an instance from the instance filter to view its JVM runtime metrics. If your service doesn’t report any of these attributes, JVM runtime metrics are not shown. JVM Runtime Metrics Light JVM Runtime Metrics Dark
JVM runtime metrics aren’t shown for serverless runtimes (e.g. AWS Lambda), as each execution environment is short-lived and its runtime metrics aren’t meaningful on their own. Serverless-specific metrics (e.g. cold starts) are coming soon.

Aggregation Temporality

OpenTelemetry Sum metrics (Counters and UpDownCounters) and Histogram metrics are reported with an aggregation temporality, which decides what each reported data point means. We use the most recent aggregation temporality the service reported for the metric in the selected period. An aggregation temporality can either be Cumulative or Delta. Gauge and Summary metrics don’t have an aggregation temporality, so this doesn’t apply to them.

Metrics

We currently display the following application metrics for services running on the JVM:

Requests

Single Value Chart

JVM Memory

JVM Garbage Collection

JVM Threads

JVM Buffers

JVM Classes

JVM CPU

JVM File Descriptors

Example Service

To see these metrics in action, checkout our example apps for working Java services with Trace0 installed: