Query trace data with BigQuery Studio

This document describes how to query your trace data from BigQuery Studio. When you use BigQuery Studio, you can join your trace data with other business data.

To get started with Observability Analytics, see Query and analyze traces.

Before you begin

  1. Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
  2. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  3. Verify that billing is enabled for your Google Cloud project.

  4. Enable the Cloud Monitoring and Observability APIs.

    Roles required to enable APIs

    To enable APIs, you need the Service Usage Admin IAM role (roles/serviceusage.serviceUsageAdmin), which contains the serviceusage.services.enable permission. Learn how to grant roles.

    Enable the APIs

  5. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  6. Verify that billing is enabled for your Google Cloud project.

  7. Enable the Cloud Monitoring and Observability APIs.

    Roles required to enable APIs

    To enable APIs, you need the Service Usage Admin IAM role (roles/serviceusage.serviceUsageAdmin), which contains the serviceusage.services.enable permission. Learn how to grant roles.

    Enable the APIs

  8. To get the permissions that you need to query a linked dataset from BigQuery, ask your administrator to grant you the BigQuery Data Viewer (roles/bigquery.dataViewer) IAM role on your project or linked dataset. For more information about granting roles, see Manage access to projects, folders, and organizations.

    You might also be able to get the required permissions through custom roles or other predefined roles.

  9. Verify that the linked BigQuery dataset for the observability bucket named _Trace exists. If the linked BigQuery dataset doesn't exist, then create it.

Run queries on BigQuery Studio

To open BigQuery from the Observability Analytics page and then query your trace data, do the following:

  1. In the Google Cloud console, go to the Observability Analytics page:

    Go to Observability Analytics

    If you use the search bar to find this page, then select the result whose subheading is Logging.

  2. Enter or load a query. For more information, see Query and analyze traces.

  3. In the toolbar, expand the menu labeled Run query or Run on BigQuery, and select Open in BigQuery.

    BigQuery Studio opens. On this page, the FROM statement specifies the linked dataset by using the BigQuery Table path syntax. You can perform any supported actions on the query, such as editing it.

    If the Open in BigQuery option is disabled, then either a linked dataset doesn't exist or you don't have the necessary permissions to open and view the query in BigQuery.

  4. On BigQuery Studio, click Run query.

Pricing

To learn about the costs associated with using BigQuery, see BigQuery pricing.

What's next