Query Trace Logs

Feature Overview

Trace Logs enable users to query and analyze logs associated with a specific distributed trace using its unique TraceID. This feature helps developers and operators quickly locate issues, understand request flows, and correlate business logs with trace contexts.

Key Benefits:

  • Root Cause Analysis: Identify errors and latency issues across microservices in distributed systems.
  • Context Correlation: Link business logs to trace spans for end-to-end visibility.
  • Efficient Filtering: Filter logs by Pods or TraceID to focus on relevant data.

Applicable Scenarios:

  • Debugging cross-service transaction failures.
  • Analyzing performance bottlenecks in complex workflows.
  • Auditing request processing flows for compliance.

Core Features

  • TraceID-Based Query: Retrieve all logs associated with a specific trace using its TraceID.
  • Pod-Centric Filtering: View logs from specific Pods involved in the trace.
  • Log Export: Export filtered log data in customizable formats.
  • Contextual Log Viewing: Examine log records before/after a target entry for deeper analysis.

Prerequisites

TIP

Before querying trace logs by TraceID, you must first instrument your services to include TraceID in business logs. Follow the Business Log Correlation with TraceID Guide for configuration details.

Default Behavior:

  • Displays logs from the entire trace duration.
  • For traces shorter than 1 minute, queries logs within 1 minute after the trace start time.

Log Query Operations

Access Trace Logs

  1. After querying traces, click on a specific trace to view its details.
  2. Click the View Log tab in the trace visualization panel.

Filter Logs

By Pod Name

In the Pod Name selector, choose target Pod from the participating services list.

By Time Range

In the Time Range selector, choose target time range.

By Query Conditions

Enter keywords in the Query Conditions text box to filter logs based on specific content.

Contain Trace ID

Select the Contain Trace ID checkbox.

Advanced Operations

Export Logs

  1. Click Export.
  2. Select fields to include using column checkboxes.
  3. Choose export format (JSON/CSV).

Customize Display Fields

Click Set. Toggle visibility of log fields in the display panel.

View Log Context

  1. Click Insight next to any log entry.
  2. Explore 5 preceding and succeeding logs around the target timestamp.
  3. Scroll up/down with mouse to load more logs.