APM & Distributed Tracing Fundamentals Certification / 03 / 04

Insight Discovery

What this domain covers

In this domain you learn which screen to look at in order to learn what from the data collected in APM. The entry point is Software Catalog, where you can list the owners and dependencies of services. Next, with the Trace Explorer search syntax, you narrow down spans using span attributes with @, span tags without @, wildcards, and numeric comparisons. There are 2 search targets: Live Search, which shows every ingested span of the last 15 minutes, and retained search, which shows the indexed spans kept by retention filters, and the time selector switches between them. You then cover the Continuous Profiler flame graph, deployment tracking with the version tag, Error Tracking, which groups similar errors into issues, Span Summary, and the standard graphs on the Service page. The exam asks what you can read from a given screen and why it is displayed that way.

Topics listed in the official guide

  • Software Catalog
  • Search Syntax
  • Trace Live vs Retained Search
  • Profilers
  • Deployment Tracking
  • Error Tracking
  • Span Summary
  • Service Performance Dashboards

Key points

  • Software Catalog registers entities through automatic discovery from telemetry, declaration with an Entity Definition, and import from external sources, and lists owners and dependencies.
  • The terms of a search query come in 2 kinds: span attributes and span tags. Attributes are searched with a leading @, while reserved attributes such as service and env are written without @.
  • There are 3 operators: AND (the default when omitted), OR, and - for exclusion. The wildcard is *, and for numbers you can use range notation such as [400 TO 499] in addition to > and <=.
  • Live Search shows every ingested span of the last 15 minutes without sampling, and choosing a period longer than 15 minutes in the time selector switches to searching indexed spans.
  • Creating a facet is not required for search, for generating metrics from spans, or for retention filters. It is an aid for type mapping and for listing values.
  • In a flame graph the width of a frame represents its share of CPU consumption, and the top list on the right aggregates only self time, the time used without calling other methods.
  • A process with both APM and Continuous Profiler enabled is linked automatically, and from the Profiles tab of a span within a trace you can drill down to the line of code.
  • For a service with the version tag, Deployments on the Service page lets you compare, per version, the time first seen, the number of new error types, the request rate, and the error rate.
  • Error Tracking computes a fingerprint from the error type, the message, and the frames of the stack trace, and groups errors with the same value into a single issue.
  • Avg % Exec Time in Span Summary is the share of active time not spent waiting for child spans to complete, and the spans active at any given moment are limited to leaf spans.

Terms and concepts

Software Catalog (a ledger of services)

Software Catalog is a ledger that lists entities such as services, queues, and data stores. Entities are discovered automatically from telemetry, and they can also be declared with an Entity Definition or imported from Backstage or ServiceNow. The Ownership view lets you see Slack, repositories, and on-call; the Reliability view shows recent deployments and rises in error rate; and the Performance view compares latency, error rate, and Apdex per environment. The service type (Web, DB, Cache, and so on) is determined from span.type.

Search Syntax (span attributes and span tags)

A Trace Explorer query is assembled from terms and operators. There are 2 kinds of terms: span attributes collected by instrumentation (for example @http.status_code) and span tags that come from hosts and containers. Attribute searches take a leading @, while reserved attributes such as service and env are written without @. The operators are AND (the default when omitted), OR, and - for exclusion, and the wildcard uses * as in service:web*. Numbers support comparisons such as @http.response_time:>100 and range notation such as [400 TO 499], and special characters such as : and = are escaped with a backslash.

Live Search and Retained Search

Trace Explorer has 2 search targets. Live Search shows every ingested span right after the Agent sends it, in a rolling 15 minute window without sampling. It suits use cases where you need to see everything happening now, such as checking version right after a deployment or tracking down an incident involving a specific customer ID. Choosing a period longer than 15 minutes in the time selector switches to searching indexed spans, where only the spans kept by retention filters are covered, so filtering by a tag that exists only on spans that were not indexed returns zero results. Exporting to dashboards and monitors is limited to retained spans.

Facets, Measures, and Trace Groups

A facet lists the values of a span attribute or tag in the left panel and lets you narrow down while seeing the count per value. A numeric attribute can be turned into a measure (a quantitative facet), which can be used for aggregations such as p95 and for a min-max slider. Creating a facet is not required for search, for generating metrics from spans, or for retention filters. In Trace Groups you can group by any tag or attribute in up to 4 dimensions and line up REQUESTS, ERRORS, and P95 Latency for each group. The source of the value can be the default Span, or you can choose Parent of span or Root span.

Trace Queries (searching by structure)

Trace Queries is a feature that searches whole traces using multiple span queries (a, b, c) and the relationships between them. && returns traces containing both spans, || returns traces containing either, -> returns traces where the left is upstream of the right, => returns traces where the left is the direct parent of the right, and NOT returns traces that do not contain the span. In the Where clause you can add trace-level conditions such as span_count(a):>10 or trace_duration:>5s. You view the results as request paths in the Flow Map or check them in a list of up to 50 sample traces. The data source is traces that were indexed as complete traces.

Profiler Visualizations (flame graph and timeline)

The default visualization in Continuous Profiler is the flame graph. The upper rows are callers and the lower rows are callees, and the width of a frame represents its share of CPU consumption. CPU time by Method aggregates self time, the time used without calling other methods. Profile types differ by language; Java has CPU, Wall Time, Live Heap, Lock, and others. Wall Time is elapsed time including I/O waits, and Live Heap is memory that has not yet been garbage collected, which suits leak investigation. The timeline view shows skew along the time axis with one lane per thread.

Connecting Traces and Profiles

A process with both APM and Continuous Profiler enabled is linked automatically. Looking at the Profiles tab of a span in a trace tells you which method used the time, down to the line of code. Under Focus On in Open in Profiling you can choose Span & Children (the selected span and its descendants within the same service), Span only, Span time period, or Full profile (60 seconds of the whole process). Endpoint profiling narrows the flame graph per endpoint of a web service and finds the endpoints that consume the most resources.

Deployment Tracking (the version tag)

Adding the reserved Unified Service Tagging tag version to a service enables Deployment Tracking. Deployments on the Service page lists every version that ran in the selected period and displays the first and last trace times, the number of error types absent from the previous version, the request rate, and the error rate. This section appears only when 2 or more versions are reporting within the period. Clicking a row opens the comparison page, which compares against the immediately preceding version by default, but you can choose any 2 versions from the past 30 days. Use the error comparison and endpoint comparison to decide whether a canary or blue-green rollout can proceed.

Error Tracking (grouping errors into issues)

Error Tracking groups thousands of similar errors into a single issue. It works in every APM-supported language without any SDK or configuration change. A tracked error span must have the 3 attributes error.stack, error.message, and error.type and belong to a complete trace. The fingerprint is computed from the error type, the message, and the frames of the stack trace, and errors with the same value go into the same issue. Issues first seen within 2 days and in the FOR REVIEW state are labeled New, and issues that reappear in a new version after being resolved are labeled Regression.

Span Summary and Service Performance Dashboards

The Service page has the standard graphs Requests, Errors, Latency, and Avg Time per Request, and they can be exported to dashboards. Only Avg Time per Request is based on sampled traces; the other 3 are based on unsampled trace metrics. Span Summary aggregates the traces containing a resource by span and shows Avg Spans/trace, % of Traces, Avg Duration, and Avg % Exec Time. Active means not waiting for child spans to complete, and it is available only for resources that contain a service entry span.

Check your understanding

Check what you have learned with 5 questions