OpenTelemetry Integration for Go Applications

The main approach for integrating with OpenTelemetry is to configure the default OTLP exporter of any application that is monitored by OpenTelemetry to send its data to the Instana agent. This is described on the OpenTelemetry page.

Serverless OpenTelemetry Exporter

The module offers an OpenTelemetry exporter that converts and sends OpenTelemetry spans to the Instana back end.

The Instana Go OpenTelemetry exporter is designed primarily for usage in serverless environments, such as AWS Lambda or AWS Fargate. Instana already provides support for OpenTelemetry for SaaS and self hosted solutions through the host agent. However, if your Go applications run in a serverless environment, where the agent is not present, the serverless OpenTelemetry exporter is the way to go.

To use the exporter, install the module into your project, create a new instance of the exporter with instana.New() and add it to the Tracer Provider.

The exporter expects two Instana environment variables that must be provided to the application:


A full usage example of the exporter is described as follows:

package main

import (

	instana ""
	sdktrace ""

// This example application demonstrates how to use the Instana OTel Exporter.
// Make sure to provide the required environment variables before run the application:
func main() {
	ch := make(chan bool)
	// Acquire an instance of the Instana OTel Exporter
	exporter := instana.New()

	// Setup and bootstrap the tracer provider
	tracerProvider := sdktrace.NewTracerProvider(


	ctx := context.Background()

	// Instrument something with OTel
	tracer := otel.Tracer("my-traced-tech")
	_, span := tracer.Start(ctx, "my_span", trace.WithSpanKind(trace.SpanKindServer))

	// This simulates the time that a span takes to be completed
	time.Sleep(time.Millisecond * 400)


When the application that is monitored by OpenTelemetry runs, the Instana exporter will convert the OpenTelemetry spans to Instana spans, and send them to the back end endpoint.

The OpenTelemetry trace visualization will be present in the Instana UI, like regular Instana tracing spans.