1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2024-12-14 10:13:10 +02:00
opentelemetry-go/website_docs/exporters.md
Peter Liu 571ff65854
[doc] replace jaeger exporter with otlp http exporter (#3705)
* update exporters.md

Signed-off-by: Peter Liu <lpfvip2008@gmail.com>

* add jaeger version which support otlp exporter

Signed-off-by: Peter Liu <lpfvip2008@gmail.com>

* add jaeger version which support otlp exporter

Signed-off-by: Peter Liu <lpfvip2008@gmail.com>

* Update website_docs/exporters.md

Co-authored-by: Robert Pająk <pellared@hotmail.com>

---------

Signed-off-by: Peter Liu <lpfvip2008@gmail.com>
Co-authored-by: Robert Pająk <pellared@hotmail.com>
2023-03-21 09:56:25 -05:00

1.5 KiB

title aliases weight
Exporters
/docs/instrumentation/go/exporting_data
4

In order to visualize and analyze your traces and metrics, you will need to export them to a backend.

OTLP endpoint

To send trace data to an OTLP endpoint (like the collector or Jaeger >= v1.35.0) you'll want to configure an OTLP exporter that sends to your endpoint.

Using HTTP

import (
  	"go.opentelemetry.io/otel/exporters/otlp/otlptrace"
  	"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp"
)

func installExportPipeline(ctx context.Context) (func(context.Context) error, error) {
	client := otlptracehttp.NewClient()
	exporter, err := otlptrace.New(ctx, client)
	if err != nil {
		return nil, fmt.Errorf("creating OTLP trace exporter: %w", err)
	}
  	/* … */
}

To learn more on how to use the OTLP HTTP exporter, try out the otel-collector

Jaeger

To try out the OTLP exporter, since v1.35.0 you can run Jaeger as an OTLP endpoint and for trace visualization in a docker container:

docker run -d --name jaeger \
  -e COLLECTOR_OTLP_ENABLED=true \
  -p 16686:16686 \
  -p 4318:4318 \
  jaegertracing/all-in-one:latest

Prometheus

Prometheus export is available in the go.opentelemetry.io/otel/exporters/prometheus package.

Please find more documentation on GitHub