A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cloud.google.com/storage/docs/traces below:

Use client-side traces | Cloud Storage

Use client-side traces

Stay organized with collections Save and categorize content based on your preferences.

This page describes how to enable client-side traces with OpenTelemetry when you use the Cloud Storage client libraries to interact with Cloud Storage. You can collect and view trace data using the following supported Cloud Storage client libraries:

Overview

Enabling traces in the Cloud Storage client libraries lets you monitor performance, pinpoint latency issues, and quickly perform debugging for Cloud Storage requests. Traces let you see the sequence of a completed request, providing a detailed view of how the request was received, managed, and responded to by Cloud Storage. A single trace is composed of multiple spans, which are detailed, time-stamped records of each function or operation your application performed throughout the Cloud Storage request.

Benefits

Collecting and propagating trace data provides the following benefits to your application:

How client-side traces work

The following sections provide a detailed look at how trace collection works.

How trace collection works with OpenTelemetry

The Cloud Storage client libraries supports trace data collection using the OpenTelemetry SDK to set up the following components required to collect and propagate trace data:

How trace exporters work

Configuring traces using the OpenTelemetry SDK includes selecting an observability backend to export your data to where it is analyzed, stored, and visualized. While you can export your trace data to any observability backend of your choice, we recommend using Cloud Trace, which can be accessed using the Google Cloud console and provides integration with other Google Cloud services.

Once the trace provider and the trace exporter are configured and enabled, you can view trace data in near real-time as traces and spans are generated for each Cloud Storage request.

Using the Cloud Trace explorer in the Google Cloud console, you can view each trace which contains the following:

To read more about traces and spans, see the OpenTelemetry documentation about traces and spans.

Pricing

Trace data is chargeable. Charges are based on the number of trace spans ingested and scanned by Cloud Trace. To learn more about chargeable trace spans and pricing examples, see Cloud Trace costs.

Before you begin

Before you can collect traces for your Cloud Storage API usage, you must complete the following steps:

  1. Install the Cloud Storage client library.

  2. Set up authentication.

  3. Enable the Cloud Trace API.

    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 API

  4. Enable the Cloud Storage API.

    Enable the API

Required roles

To get the permission that you need to write traces to Cloud Trace, ask your administrator to grant you the Cloud Trace Agent (roles/coudtrace.agent) IAM role on the project used by the client.

This predefined role contains the cloudtrace.traces.patch permission, which is required to write traces to Cloud Trace.

You might also be able to get these permissions with predefined roles, or you can create custom roles to grant specific permissions. For instructions on granting roles on projects, see Grant or revoke a role. For more information about the Cloud Trace Agent role, see Identity and Access Management (IAM) documentation.

Configure tracing for your application

Use the following instructions to configure tracing and begin collecting trace data using the Cloud Storage client library:

C++
  1. Install the following versions:

  2. To enable OpenTelemetry tracing instrumentation in the C++ client library, update your build system configuration for CMake or Bazel.

  3. Create an instance of the Cloud Storage client with OpenTelemetry traces enabled.

Java
  1. Install the following Cloud Storage Java client library versions:

  2. Install the Cloud Trace exporter for OpenTelemetry. You can also use any exporter of your choice.

  3. Install the Cloud Trace propagator.

  4. Create an instance of the Cloud Storage client with OpenTelemetry traces enabled.

Python
  1. Install the Cloud Storage Python client library:

    pip install google-cloud-storage[tracing]>=2.18.0
  2. Install the Cloud Trace exporter and propagator. You can also use any exporter of your choice.

    pip install opentelemetry-exporter-gcp-trace opentelemetry-propagator-gcp
  3. Install the OpenTelemetry requests instrumentation to trace the underlying HTTP requests.

    pip install opentelemetry-instrumentation-requests
  4. Set the environment variable to selectively opt in to tracing for the Python storage client:

    export ENABLE_GCS_PYTHON_CLIENT_OTEL_TRACES=True
  5. Configure the trace exporter and trace provider.

    Note: In the following sample, trace results are exported to Cloud Trace. For more options for exporting your traces, see OpenTelemetry's list of available exporters.
View your traces

Use the Cloud Trace explorer to view your trace data in the Google Cloud console:

  1. In the Google Cloud console, go to the Trace explorer page:

    Go to Trace explorer

    You can also find this page by using the search bar.

  2. In the Trace explorer page, click a specific trace in the scatter plot to view the trace details.

    The Trace details pane displays a table of trace spans.

  3. Optional: click a span row to view detailed information about a specific span such as the following information:

For more information about using the Cloud Trace explorer, see Find and explore traces.

What's next

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-10-02 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-10-02 UTC."],[],[]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.5