docs/docs/observability/troubleshoot/logs.mdx
import Thumbnail from '@site/src/components/Thumbnail'; import HeadingIcon from '@site/src/components/HeadingIcon'; import ProductBadge from '@site/src/components/ProductBadge';
Logs are critical for monitoring, debugging, and ensuring the stability of your Hasura-powered applications. By reviewing logs, you can gain insights into the behavior of your GraphQL API, diagnose errors, and monitor performance trends.
To enable logs, you must configure the following environment variable:
HASURA_GRAPHQL_ENABLED_LOG_TYPES
You can find detailed information about different log types supported by Hasura in the Hasura Documentation. Grafana provides a filter that allows you to filter different log types.
<Thumbnail src="/img/observability/troubleshoot/errorsuccesslogs.jpeg" alt="traces" />You can perform searches in Grafana using the search bar. Example searches include:
OperationNamerequest_iderrorOperationNameRolesTo troubleshoot a query, focus on the following important attributes:
attributes_typebody_operation_error_errorbody_operation_query_operationNamebody_operation_query_querybody_http_info_urlbody_operation_error_codeoperationName: Look under body_operation_query_operationName and, if enabled, check
body_operation_query_query for the GraphQL query.If you're encountering issues with Loki, consider the following configuration suggestions:
{service_name="hasura"} |= "error"
{service_name="hasura"} |= "validation-failed"
Check out the enterprise observability boilerplate.