Distributed tracing in Axiom allows you to observe how requests propagate through your distributed systems. This could involve a user request going through several microservices, and resources until the requested information is retrieved and returned. By tracing these requests, you're able to understand the interactions between these microservices, pinpoint issues, understand latency, and trace the life of the request through your application's architecture.
Traces and Spans
Trace: A trace is a representation of a single operation or transaction as it moves through a system. A trace is made up of multiple spans.
Span: Each span represents a logical unit of work in the system with a start and end time. For example, an HTTP request handling process might be a span.
Each span includes metadata like unique identifiers (
span_id), start & end times, parent-child relationships with other spans, and optional events, logs, or other details to help describe the span's operation.
Trace Schema Overview
|Unique identifier for a trace
|Unique identifier for a span within a trace
|Identifier of the parent span
|Name of the span e.g. the operation
|Type of the span (e.g., client, server, producer)
|Duration of the span
|Whether this span contains an error
|Status of the span (e.g. null, OK, error)
|Status message of the span
|Key-value pairs providing additional metadata
|Timestamped events associated with the span
|Links to related spans or external resources
|Information about the source of the span
Below we explore the various ways Axiom can be used to analyze and interrogate your trace data from simple overviews to complex queries.
The Axiom OpenTelemetry app automatically detects any OpenTelemetry trace data flowing into your datasets and publishes dashboards that let you easily browse your trace data:
Navigating the App
- Use the Filter Bar at the top of the app to narrow the charts to a specific service or operation.
- Use the Search Input to find a trace id in the selected time period.
- Use the Slowest Operations chart to identify performance issues across services and traces.
- Use the Top Errors list to quickly identify the worst-offending causes of errors.
- Use the Results table to get an overview and navigate between services, operations, and traces.
Viewing a Trace
Clicking on any trace id in a results table will show the "trace waterfall" view which will allow you to see that span in context of the entire trace from start to finish.
Customizing the App
Should you want to customize the app to your own liking, use the fork button at any time to duplicate an editable version for you and your team.
In Axiom, trace events are just like any other events inside datasets. This means they are directly queryable in the UI. While this is can be a powerful experience, it is important to note some important details to consider before querying:
Directly aggregating upon the
durationfield will produce aggregate values across every span in the dataset. This is usually not the desired outcome when wanting to inspect a service's performance or robustness.
For request, rate, and duration aggregations, it's best to only include the root span, which is as easy as using
To see how spans in a trace are related to each other, explore the trace in a waterfall view. In this view, each span in the trace is correlated with its parent and child spans.
To explore spans within a trace using the OpenTelemetry Traces app, follow these steps:
- Click the
- In the
Slowest Operationschart, click the service that contains the trace.
- In the list of trace IDs, click the trace you want to explore.
- Explore how spans within the trace are related to each other in the waterfall view.
To access the waterfall view from Explore, follow these steps:
Ensure the dataset you work with has trace data.
Run a query that returns the
trace_idfields. For example, the following query returns the number of spans in each trace:
['otel-demo-traces'] | summarize count() by trace_id
In the list of trace IDs, click the trace you want to explore.
Explore how spans within the trace are related to each other in the waterfall view.
Below are a collection of queries that can help get you started with traces inside Axiom. Queries are all executable on the Axiom Play sandbox.
Number of requests, avg response
| where isnull(parent_span_id)
| summarize count(),
percentiles_array(duration, 95, 99, 99.9)
Top five slowest services by operation
| summarize count(), avg(duration) by name
| sort by avg_duration desc
| limit 5
Top 5 errors per service and operation
| summarize topk(['status.message'], 5) by ['service.name'], name
| limit 5