Send data to the Grafana Cloud OTLP endpoint
Grafana Cloud

Send data to the Grafana Cloud OTLP endpoint

The Grafana Cloud OTLP endpoint is OpenTelemetry Protocol (OTLP) compliant, and the recommended endpoint to send OpenTelemetry metrics, logs, and traces to Grafana Cloud.

The recommended architecture for production observability uses Grafana Alloy, the Grafana Labs supported distribution of the OpenTelemetry Collector.

Grafana Cloud OpenTelemetry architecture via an OpenTelemetry Collector The recommended OpenTelemetry architecture uses Grafana Alloy.

Grafana Alloy offers the following advantages over non-Collector setups:

  1. A robust, reliable, and scalable pipeline to handle transport issues.
  2. Support to enrich telemetry metadata data, for example to add k8s.* attributes.
  3. Support to sample and redact data, and route data to multiple observability backends.

Note

You can use other OpenTelemetry Collector distributions but need to perform additional set up and maintenance.

Quickstart architecture

For non-production observability, such as development or testing, or when it isn’t possible to deploy an OpenTelemetry Collector distribution, use OpenTelemetry instrumentation SDKs to send OTLP data directly to the OTLP endpoint.

You can use a language specific instrumentation agent or SDK for automatic or manual instrumentation with full support to send OTLP metrics, logs, and traces.

Grafana Cloud OpenTelemetry Architecture - Direct A quickstart architecture that uses language specific agents or SDKs.

Alternatively you can use Grafana Beyla an eBPF instrumentation solution that is easy to set up and automatically instruments network-level telemetry for all languages and frameworks. Beyla supports Response, Error, and Duration metrics (RED metrics) and distributed traces.

Grafana Cloud OpenTelemetry Architecture - Beyla A quickstart architecture that uses Grafana Beyla eBPF auto-instrumentation SDK.

A quickstart architecture is easy to set up, however be aware of the following disadvantages compared to Collector-based architectures:

  1. Limited reliability to handle transport issues.
  2. No support to enrich telemetry metadata data.
  3. No support to sample and redact data, and route data to multiple observability backends.

For most production and quickstart use cases, we recommend to use the Grafana Cloud connection tiles to set up and send OpenTelemetry data to Grafana Cloud. This opinionated approach includes all the binaries, connection parameters, and configuration snippets you need to set up OpenTelemetry.

Connection tiles are available to set up a production architecture with:

  • Grafana auto-instrumentation agent for Java (JVM) and Grafana Alloy
  • Grafana instrumentation SDK for .Net and Grafana Alloy
  • Grafana Beyla eBPF auto-instrumentation and Grafana Alloy
  • OpenTelemetry (OTLP) with Grafana Alloy, for an application already instrumented with OpenTelemetry
  • The upstream OpenTelemetry Collector published by the OpenTelemetry Community, for an application already instrumented with OpenTelemetry

Note

For application-level instrumentation for programming languages other than Java (JVM) and .NET, follow the Application Observability instrumentation documentation or upstream OpenTelemetry instrumentation documentation and use the Grafana Alloy or upstream OpenTelemetry Collector connection tile to set up a Collector.

To use a Grafana Cloud connection tile to set up OpenTelemetry, follow these steps:

  1. Sign In to the Grafana Cloud Portal.
  2. From your organization Overview, select or click Launch to open a Grafana Cloud stack.
  3. With a stack selected, click Launch from the Grafana tile to launch Grafana Cloud.
  4. With Grafana Cloud launched, click Connections, or expand, then click Add new connection.
  5. Search for “OpenTelemetry” and press enter to filter the connection options.
  6. Select the desired OpenTelemetry connection tile and follow the instructions.

Grafana Cloud Administration Console / Grafana Cloud OTLP endpoint connection details Grafana Cloud connection tiles for OpenTelemetry

Manual OpenTelemetry setup for advanced users

Advanced users can manually set up OpenTelemetry components to send OpenTelemetry data to Grafana Cloud.

To send OTLP data to the Grafana Cloud OTLP endpoint you need to get your connection details from the Grafana Cloud administration console:

  1. Sign In to the Grafana Cloud Portal.
  2. From your organization Overview, select or click Launch to open a Grafana Cloud stack.
  3. With a stack selected, click Configure from the OpenTelemetry tile.
  4. Follow the instructions to generate an authentication token and OpenTelemetry environment variables for OTEL_EXPORTER_OTLP_PROTOCOL, OTEL_EXPORTER_OTLP_ENDPOINT, and OTEL_EXPORTER_OTLP_HEADERS.

Grafana Cloud Administration Console / Grafana Cloud OTLP endpoint connection details Configure the OTLP endpoint for a Grafana Cloud stack.

Note

If you use Python, replace “Basic " in your connection variables shell script with “Basic%20”.

Set up instructions are available for:

OpenTelemetry environment variables

The OpenTelemetry instrumentation SDKs and agents use specific environment variables to send application data to Grafana Cloud.

Customize the following shell script template to set environment variables:

sh
export OTEL_SERVICE_NAME=<< SERVICE >>
export OTEL_RESOURCE_ATTRIBUTES=deployment.environment=<< ENVIRONMENT >>,service.namespace=<< NAMESPACE >>,service.version=<< VERSION >>,service.instance.id=<< ID >>

Add each value after the equals replacing the placeholder << ... >> and remove any optional fields you don’t use. The OTEL_RESOURCE_ATTRIBUTES contains a comma separated list of field value pairs.

The OTEL_SERVICE_NAME is a required unique service identifier. A default value is often auto-discovered by the instrumentation. For example, ads or cart. You can optionally set the service name as a resource attribute, see below.

OTEL_RESOURCE_ATTRIBUTES fieldDescriptionExample value
service.nameRequired unique service identifier.
Alternatively, set the OTEL_SERVICE_NAME env var.
Default often auto-discovered by the instrumentation.
ads, cart
service.versionOptional service version.
Default often auto-discovered by the instrumentation.
1.0.0, 1.2.0 beta 3
service.instance.idOptional unique instance id.
Default often auto-generated UUID by the instrumentation.
Pod name
service.namespaceOptional organization-level identifier to group multiple services under.android, shop
deployment.environmentOptional organization-level unique deployment environment identifier.staging, production

Visualize and use OpenTelemetry data

Grafana Cloud provides a turnkey experience for application performance monitoring (APM) through Grafana Application Observability. It can detect anomalies, identify root causes, and fix problems in applications.

Alternatively, you can consume your OpenTelemetry traces, metrics, and logs through Tempo traces, Prometheus/Mimir metrics, and Loki logs visualization. Then use your ingested OpenTelemetry data with your preferred Grafana Labs tooling.

OpenTelemetry data format mapping to Grafana Cloud

Refer to the OTLP format considerations documentation for information on how OpenTelemetry metrics, logs, and traces are converted to Prometheus/Mimir, Loki, and Tempo.