# Go OpenTelemetry APM

Complete these tasks to properly integrate OpenTelemetry APM in Go:

- [Install](https://docs.kloudfuse.com/platform/3.5.0/agent-otel-migrate-go/#install)
- [Set Up Instrumentation](https://docs.kloudfuse.com/platform/3.5.0/agent-otel-migrate-go/#set-up)
- [Instrumentation Libraries](https://docs.kloudfuse.com/platform/3.5.0/agent-otel-migrate-go/#libraries)
- [Examples](https://docs.kloudfuse.com/platform/3.5.0/agent-otel-migrate-go/#examples)

## Install

Run these install commands to install Go packages:

```console
go get go.opentelemetry.io/otel \
  go.opentelemetry.io/otel/trace \
  go.opentelemetry.io/otel/sdk \
```

## Set Up Instrumentation

To set up the instrumentation, follow these steps from the see OpenTelemetry’s documentation of [Instrumentation Setup](https://opentelemetry.io/docs/languages/go/instrumentation/#setup).

For creating spans using the OpenTelemetry Go, use the following OpenTelemetry documentation: [Creating Spans](https://opentelemetry.io/docs/languages/go/instrumentation/#creating-spans).

To use auto-instrumentation instead of manually creating spans for your functions, explore the [Instrumentation Libraries](https://docs.kloudfuse.com/platform/3.5.0/agent-otel-migrate-go/#libraries).

## Instrumentation Libraries

OpenTelemetry Go can automatically instrument and support a number of libraries, frameworks, and application servers, as separate third-party NPN packages. We recommend that you review the available OpenTelemetry [Registry for Go](https://opentelemetry.io/ecosystem/registry/?language=go&component=instrumentation).

To install any of the packages in the instrumentation library, run the following command:

```console
go get go.opentelemetry.io/contrib/instrumentation/{import-path}/otel{package-name}
```

## Examples

You can use a set of fully-functional, working examples of OpenTelemetry for Go from [OpenTelemetry Go](https://github.com/open-telemetry/opentelemetry-go).
