Skip to content
Analytics Export

Analytics Export

Mtracer allows you to export analytics for the traces and spans generated by executed tests.

Multiple export methods can be specified simultaneously by repeating the --analytics or -a flag with different values. Supported methods are:

  • json: exports the analytics data in JSON format.
  • html: generates an interactive HTML report with detailed analytics.

This feature is particularly useful when running the same test multiple times using the --count flag. It provides a comprehensive overview of the system under test’s performance, highlighting any variations or anomalies in the results.

JSON Export

When using the json export method, Mtracer generates a JSON file containing the analytics of the traces and spans collected during the test execution. The JSON file can be easily parsed and integrated into monitoring tools or data analysis pipelines.

The JSON file contains the following fields:

FieldDescription
testNameName of the executed test suite
timestampTimestamp of the test execution
tracesArray containing the trace data collected during the test execution
traceAnalyticsObject containing the global analytics of the traces collected during the test execution
traceAnalytics.minDurationMinimum duration among all collected traces (in milliseconds)
traceAnalytics.maxDurationMaximum duration among all collected traces (in milliseconds)
traceAnalytics.p50Duration50th percentile (median) of the trace duration (in milliseconds)
traceAnalytics.p90Duration90th percentile of the trace duration (in milliseconds)
traceAnalytics.p99Duration99th percentile of the trace duration (in milliseconds)
traceAnalytics.durationStandardDeviationStandard deviation of the trace duration
traceAnalytics.averageDurationAverage duration of the collected traces
traceAnalytics.averageSpanCountAverage number of spans per trace
traceAnalytics.averageSpanErrorCountAverage number of spans with errors per trace
traceAnalytics.errorRatePercentage of traces that contain at least one span with an error status
traceAnalytics.spanAnalyticsArray containing detailed analytics grouped by span from different traces with the same serviceName and operationName
traceAnalytics.spanAnalytics.[].serviceNameName of the service to which the span belongs
traceAnalytics.spanAnalytics.[].operationNameName of the operation executed by the span
traceAnalytics.spanAnalytics.[].minDurationMinimum recorded duration for this operation (in milliseconds)
traceAnalytics.spanAnalytics.[].maxDurationMaximum recorded duration for this operation (in milliseconds)
traceAnalytics.spanAnalytics.[].p50Duration50th percentile (median) duration of this operation (in milliseconds)
traceAnalytics.spanAnalytics.[].p90Duration90th percentile duration of this operation (in milliseconds)
traceAnalytics.spanAnalytics.[].p99Duration99th percentile duration of this operation (in milliseconds)
traceAnalytics.spanAnalytics.[].durationStandardDeviationStandard deviation of the duration for this operation
traceAnalytics.spanAnalytics.[].averageDurationAverage duration of this operation
traceAnalytics.spanAnalytics.[].errorRateError rate specific to this operation (as a percentage)
traceAnalytics.spanAnalytics.[].averagePercentageOfTotalTraceAverage percentage of the time spent by this span relative to the total duration of the parent trace
Spans often overlap in time, as most of them are synchronous calls. Therefore, you should pay attention to the averagePercentageOfTotalTrace metric, since the sum of all span percentages will most likely not equal 100%.

HTML Export

When using the html export method, Mtracer generates an interactive HTML report that allows you to intuitively visualize the trace and span analytics. The HTML report includes charts and tables that make it easier to analyze the performance of the system under test, enabling quick identification of bottlenecks or anomalies in the results.

Below are some example screenshots of the HTML report generated by Mtracer: HTML report example - Trace overview HTML report example - Trace overview

The HTML report shows:

  • the main analytics of the traces and spans collected during the test execution;
  • a chart of the trace durations grouped by run number;
  • two histograms comparing different duration metrics, as well as the average number of spans compared to the average number of spans with errors;
  • a detailed table of span analytics grouped by serviceName and operationName;
  • the actual traces and spans collected for each test run, grouped by traceId. These display every span contained in the selected trace.

Additionally, from the drop-down menu in the top-left corner, you can select a specific test to view its analytics.