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. 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

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

  6. To get the permissions that you need to query a linked dataset from BigQuery, ask your administrator to grant you the following IAM roles:

    • Observability View Accessor (roles/observability.viewAccessor) on the observability views that you want to query. This role supports IAM conditions, which let you restrict the grant to a specific view. If you don't attach a condition to the role grant, then the principal can access all observability views.
    • BigQuery Data Viewer (roles/bigquery.dataViewer) on the project or on the linked BigQuery 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.

  7. Verify that you have a linked BigQuery dataset on your observability dataset that stores your trace data. 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