---
title: "Instrument applications for tracing | Grafana Cloud documentation"
description: "Instrument your applications to emit distributed traces to Grafana Cloud"
---

# Instrument applications for tracing

To send distributed traces to Grafana Cloud, instrument your applications using OpenTelemetry (OTel) or instrumentation options such as Grafana Beyla. You can also use manual instrumentation to create spans and traces.

For additional information, refer to [About instrumentation](/docs/tempo/next/set-up-for-tracing/instrument-send/about-instrumentation/).

## OpenTelemetry SDKs

OpenTelemetry provides language-specific SDKs and auto-instrumentation libraries.

- Overview and language guides: [OpenTelemetry instrumentation](https://opentelemetry.io/docs/instrumentation/)
- Specification: [OpenTelemetry specification](https://github.com/open-telemetry/opentelemetry-specification/)

Common patterns:

- Set a stable service name (resource attribute `service.name`).
- Enable context propagation across services (for example, W3C TraceContext).
- Export via OTLP (HTTP or gRPC) to a local collector such as Grafana Alloy or OpenTelemetry Collector.

## Auto-instrumentation

Auto-instrumentation can discover common frameworks/libraries and emit spans without code changes.

- Java agent: [OpenTelemetry Java instrumentation](https://github.com/open-telemetry/opentelemetry-java-instrumentation)
- Kubernetes OpenTelemetry Operator (auto-injection): [OpenTelemetry Operator](https://github.com/open-telemetry/opentelemetry-operator)

Notes:

- Auto-instrumentation coverage varies by language and framework.
- You can combine auto-instrumentation with manual spans for critical paths and business events.

## Grafana Beyla

Grafana Beyla is an eBPF-based application zero-code instrumentation tool to get started with Application Observability. Beyla uses eBPF to automatically inspect application executables and the OS networking layer, and capture trace spans related to web transactions and Rate Errors Duration (RED) metrics for Linux HTTP/S and gRPC services. All data capture occurs without any modifications to application code or configuration.

Refer to [Set up Beyla](/docs/beyla/latest/distributed-traces/) for information about how to instrument using Beyla.

- Captures HTTP/gRPC metadata, latency, and error information.
- Works alongside OpenTelemetry; you can forward traces via OTLP to Alloy or the OTel Collector.

> Note
> 
> While Beyla is a good choice for metrics, span metrics, and service graphs, if you choose to use it for tracing, check the [Distributed traces with Beyla](/docs/beyla/latest/distributed-traces/)to verify that it meets your tracing needs.

## Minimal checklist

1. Choose instrumentation:
   
   - OTel SDK (manual + auto-instrumentation) or
   - Beyla (auto-instrumentation on Linux)
2. Set `service.name` and other resource attributes (for example, environment, version).
3. Export traces using OTLP to a local collector:
   
   - Grafana Alloy (preferred) or OpenTelemetry Collector.
4. In your collector, forward traces to Grafana Cloud Traces.
5. Verify traces in Grafana (Explore → TraceQL/Search).

## Next steps

- Set up a collector: [Set up tracing](/docs/grafana-cloud/send-data/traces/set-up/)
- Send traces with Grafana Alloy: [Set up Grafana Cloud Traces using Grafana Alloy](/docs/grafana-cloud/send-data/traces/set-up/traces-with-alloy/)
- Learn to query with TraceQL: [Query tracing data](/docs/grafana-cloud/send-data/traces/traces-query-editor/)
