[ Web Proxy ]
URL:
Viewing: https://cloud.google.com/stackdriver/docs/otlp/overview [Back]  [Original]

OTLP ingestion overview  |  Google Cloud Observability  |  Google Cloud Documentation Skip to main content
Google Cloud Documentation [Google Cloud Documentation]
Send feedback

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

This document introduces the use of the Telemetry (OTLP) API, telemetry.googleapis.com, which implements the OpenTelemetry Protocol. The Telemetry API lets you ingest OTLP-formatted log, metric, and trace data into Google Cloud Observability:

You can send telemetry data to the Telemetry API from applications that use SDKs or by exporting from an OpenTelemetry Collector.

If you are using Google Kubernetes Engine, then you can use Managed OpenTelemetry for GKE instead of manually deploying and configuring an OpenTelemetry Collector that uses the Telemetry API.

Protocol support

The OTLP endpoint supports all of the OTLP transport and serialization protocols, including http/protobuf, http/json, and grpc. When exporting directly from applications using SDKs, we recommend using the gRPC OTLP exporter rather than HTTP exporters because most SDK exporters lack support for dynamic token refreshing.

Authentication

You must configure your exporters with the credentials necessary to send data to your Google Cloud project. For example, when you use collectors, typically you use the googleclientauth extension to authenticate with Google credentials.

For an example of authentication when using direct export of trace data, see Configure authentication. This example illustrates how to configure the exporter with your Google Cloud Application Default Credentials (ADC) and add a language-specific Google Auth Library to your application.

To send telemetry data to your Google Cloud project by using the Telemetry API, you must also do the following:

OTLP ingestion

This section describes how your log, metric, and trace data is converted from OTLP into Google Cloud Observability data structures.

Log data ingestion

When you use the Telemetry API to ingest OTLP-formatted logs, your log data is converted into Cloud Logging log entries. An incoming OTLP-formatted log request in JSON has the following general structure:

"resourceLogs": [
    {
      "resource": {
        "attributes": [...]
      },
      "scopeLogs": [
        {
          "scope": { ...}
          "logRecords": [...]
        }
      ]
    }
]

Each item in each logRecords array becomes a single Cloud Logging log entry. The resource attributes determine the monitored resource in the resulting LogEntry. For more information about which attributes are required for ingestion of OTLP-formatted logs, see OTLP attributes to resource-type mapping.

To support ingestion of OTLP-formatted logs, the Cloud Logging LogEntry structure contains an additional field, otel. Because the OTLP and Cloud Logging data models differ in structure, the otel field preserves a copy of the resource, scope, and entity metadata from the incoming OTLP request.

For example, if you send an OTLP resourceLogs payload like the following to the Telemetry API, then each resulting log entry contains a resource field (for the monitored resource) and an otel field, as shown on the other tabs:

resourceLogs

{
  "resourceLogs": [
    {
      "resource": {
        "attributes": [
          {
            "key": "gcp.project_id",
            "value": { "stringValue": "PROJECT_ID" }
          },
          {
            "key": "gcp.resource_type",
            "value": { "stringValue": "global" }
          }
        ]
      },
      "scopeLogs": [
        {
          "scope": {
            "name": "my.library",
            "version": "1.0.0",
            "attributes": [
              {
                "key": "my.scope.attribute",
                "value": { "stringValue": "some scope attribute" }
              }
            ]
          },
          "logRecords": [ ... ]
         }
       ]
     }
   ]
}

resource

  {
    ...
    "resource": {
      "labels": {
        "project_id": "PROJECT_ID"
      },
      "type": "global"
    },
    ...
}

otel

  {
    ...
    "otel": {
      "resource": {
        "attributes": {
          "gcp.project_id": "PROJECT_ID",
          "gcp.resource_type": "global"
        }
      },
      "scope": {
        "attributes": {
          "my.scope.attribute": "some scope attribute"
        },
        "name": "my.library",
        "version": "1.0.0"
      }
    },
   ...
  }

Because Cloud Logging log entries are self-contained and don't link to external resource schemas, all OTLP resource, scope, and entity metadata is copied into each log entry.

Metric data ingestion

OTLP for Prometheus metrics only works when using the OpenTelemetry Collector version 0.140.0 or newer.

When metrics are ingested into Cloud Monitoring by using an OpenTelemetry Collector and the otlphttp exporter or sent directly by using an OpenTelemetry SDK, the OTLP metrics are mapped to Cloud Monitoring metric structures. To get information about those mappings, see the following:

Google Cloud Observability converts metrics into the Prometheus time-series format. Metric names must have either no domain or the domain prometheus.googleapis.com. After conversion, the metric name includes the prometheus.googleapis.com prefix and an additional suffix, based on the OTLP point kind. The resulting Cloud Monitoring metric has the following structure:

prometheus.googleapis.com/{metric_name}/{suffix}

Additionally, for each unique OpenTelemetry resource, the conversion adds a target_info metric that contains all resource attributes except service.name, service.instance.id, and service.namespace.

Note: Value-type collisions can occur if you previously sent INT64 target_info metrics. If you encounter collisions, the best long-term solution for this is for you to delete the metric descriptor for the INT64 target_info metrics. To delete this descriptor from your metric scope, use this Golang script.

Because metric names and label keys in Cloud Monitoring don't support full UTF-8, metric data can be rejected:

To prevent rejection of your metrics for these reasons, use the replace_pattern function to transform your metric names and attributes.

Trace data ingestion

Regardless of whether you use the Telemetry API or the Cloud Trace API, incoming trace data is stored in a format consistent with OTLP. However, we recommend using the Telemetry API because it provides higher ingestion quotas than the Cloud Trace API.

The following is an example of trace data that might be sent from an application to your Google Cloud project:

{
  "resourceSpans": [
    {
      "resource": {
        "attributes": [...]
      },
      "scopeSpans": [
        {
          "scope": { ...},
          "spans": [...]
        }
      ]
    }
  ]
}

Each item in each scopeSpans.spans array becomes a single stored span:

For more information, see the following documents:

Billing

Billing for log, metric, and trace data that is ingested by using the Telemetry API depends on the telemetry signal. For complete information, see the Billing page.

Log data billing

You might see a change in your Cloud Logging storage and billing values when you use the Telemetry API to ingest logs due to a change in the log volume.

The largest changes to storage and billing for your Google Cloud project occur when both of the following are true:

Because this resource and scope metadata is copied onto every individual log entry, your stored log volume can increase.

To minimize storage volume, we recommend the following:

Note: If you plan to use the volume of the resourceLogs object to estimate the volume of the resulting LogEntry objects, then send one logRecord object per resourceLogs object. Otherwise, your estimates won't properly account for fields that are duplicated in each LogEntry object.

Metric data billing

Billing for OTLP metrics is accounted for under the "Prometheus Samples Ingested" SKU, the same one used for metrics from Google Cloud Managed Service for Prometheus.

Trace data billing

The API that you use to send trace data to your project doesn't affect how charges are computed for that data.

Querying your log, metric, and trace data

You can use the explorer pages—Logs Explorer, Metrics Explorer, and Trace Explorer—to query your log, metric, and trace data. You can also use the Observability Analytics page to analyze your log and trace data by using SQL.

The following tips might be helpful when you query your metric data using the Metrics Explorer:

Limits and quotas

The Telemetry API limits apply to all signal types.

The following quotas and limits also apply:

What's next

Send feedback

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 2026-08-14 UTC.

Need to tell us more? [[["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 2026-08-14 UTC."],[],[]]

Web Proxy Viewer  |  New URL  |  Original Page