docs/docs/observability/troubleshoot/traces.mdx
import Thumbnail from '@site/src/components/Thumbnail'; import HeadingIcon from '@site/src/components/HeadingIcon'; import ProductBadge from '@site/src/components/ProductBadge';
Traces are invaluable for debugging, performance analysis, and understanding request flows. This section explains how to
leverage traces, including their integration with Error TraceQL queries, alerts, and how to use request_id and
trace_id for pinpointing issues.
To fully understand and utilize traces, refer to the following resources:
Traces provide valuable insights into the flow of requests and performance bottlenecks. They typically list spans with details such as operation execution time, database queries, and the request lifecycle.
<Thumbnail src="/img/observability/troubleshoot/trace.jpeg" alt="traces" />/v1/graphql: Responsible for executing the GraphQL query.db.query: SQL queries performed on the database.db.system: Database system name.enduser.role: The role of the end user.graphql.operation.type: The type of GraphQL operation.graphql.operation.name: The name of the GraphQL operation.graphql.query: The GraphQL query from the client.request_id: The unique request identifier.service.name: The name of the GraphQL service.source.kind: The source of the database.status: The query's status.You can filter traces using any of the above tags. Here are some examples:
{resource.service.name="hasura" && span.enduser.role="admin"}
{resource.service.name="hasura" && span.graphql.operation.name="test"}
{resource.service.name="hasura" && span.graphql.operation.type="mutation"}
{resource.service.name="hasura" && name="/v1/graphql" && duration > 3s}
Traces are invaluable for debugging, performance analysis, and understanding request flows. This section explains how to
leverage traces, including their integration with Error TraceQL queries, alerts, and how to use request_id and
trace_id for pinpointing issues.
Error TraceQL queries allow you to filter and analyze traces based on specific error conditions in your GraphQL operations. With TraceQL, you can:
Both request_id and trace_id are critical for tracking and debugging GraphQL operations. They provide a unique way
to trace the request lifecycle across various services, helping you isolate issues.
Traces provide a comprehensive view of GraphQL errors and performance. They help you:
Traces reveal the exact SQL queries generated by Hasura, which is crucial for debugging database issues or optimizing performance. Traces help you:
Traces help identify long-running queries, which are critical for performance optimization. By pinpointing which parts of the request consumed the most time in the database, you can optimize slow-performing queries and improve overall system efficiency.
Check out the enterprise observability boilerplate.