loongsuite-go is a free, open source monitoring & observability project written in Go and released under Apache-2.0. It has 907 GitHub stars, 131 forks and 30 open issues, and was last pushed 15 days ago. On this registry it ranks #235 of 270 tracked projects in Monitoring & Observability, with 5 head-to-head comparisons available. It gained 4 stars over the last 30 tracked days.

What is loongsuite-go?

loongsuite-go is an Apache-2.0 licensed compile-time instrumentation agent that adds OpenTelemetry tracing and metrics to Go applications without requiring any source-code changes, and it is built for Go teams that need observability across services they would rather not modify by hand.

What it is

Loongsuite Go Agent ships as a command-line tool named otel, maintained in the alibaba/loongsuite-go repository, with documentation hosted at https://alibaba.github.io/loongsuite-go/. Instrumentation happens at compile time rather than at runtime: prefixing an ordinary build command with otel produces a binary that is already wired for OpenTelemetry. The tool pins OpenTelemetry v1.45.0 and injects those OpenTelemetry modules into the application it instruments, which is why both the tool and the target application require Go 1.25 or newer — the OTel modules declare go 1.25.0 from v1.42.0 onward. It is catalogued under Infrastructure & Operations / Monitoring & Observability, and its topics are apm, go, instrumentation, metrics, observability, opentelemetry, and tracing.

The concrete problem it solves is hand-written instrumentation in the Go ecosystem. Normally, giving a Go service OpenTelemetry traces and metrics means adding SDK bootstrap code to the application and wiring per-library hooks into every HTTP handler, database client, message consumer, and logger. loongsuite-go replaces that manual, code-level OpenTelemetry instrumentation with a build step: go build becomes otel go build, and the resulting binary emits telemetry without anyone editing the repository.

Key capabilities

  • Compile-time auto-instrumentation through the otel prefix, including otel go build, otel go build -o app cmd/app, and otel go build -gcflags="-m" cmd/app, so ordinary build flags pass through unchanged.
  • Injection of pinned OpenTelemetry v1.45.0 modules into the instrumented application, covering tracing and metrics.
  • A supported-library matrix with explicit minimum and maximum versions per library, including entries for google.golang.org/adk from v0.2.0 and github.com/rabbitmq/amqp091.
  • Auto-instrumentation for github.com/uber-go/zap logging, demonstrated in example/log.
  • HTTP request and response monitoring through the nethttp example, plus Kafka consumer message monitoring through the kafka-demo example.
  • Integration with the Kratos framework, shown in example/kratos-demo.
  • Custom code injection, demonstrated in example/sqlinject for SQL injection detection, alongside a benchmark example for overhead measurement.

Who uses it and how

  • Go services that must be observed but cannot easily be edited, such as vendored dependencies, generated code, and applications where a rebuild is cheaper than a refactor.
  • Teams already standardized on OpenTelemetry that want consistent traces and metrics across services without hand-writing SDK setup in each one.
  • HTTP services that need request and response instrumentation on ingress and egress paths, following the nethttp example.
  • Kafka consumer pipelines and microservices built on the Kratos framework, both of which have dedicated end-to-end examples in the repository.
  • Applications built on google.golang.org/adk, where the tool covers agent-style Go workloads from v0.2.0 onward.

Getting started

Prebuilt binaries are the recommended installation path, with downloads for Linux AMD64, Linux ARM64, MacOS AMD64, MacOS ARM64, and Windows AMD64 as otel-linux-amd64, otel-linux-arm64, otel-darwin-amd64, otel-darwin-arm64, and otel-windows-amd64.exe. Alternatively, a bash installer places otel in /usr/local/bin/otel, and building from source uses make or make install; verify the tool with otel version, then build the project with otel go build.

How it compares

The facts do not list paid products that loongsuite-go replaces. It sits inside the OpenTelemetry ecosystem as an implementation of that standard rather than an alternative to it, pinning OpenTelemetry v1.45.0 and emitting the same traces and metrics any OpenTelemetry backend can consume, while the README separately links a commercial version hosted on Alibaba Cloud ARMS. No other compile-time Go instrumentation tool is named in the registry facts, so it is presented here without a direct peer for comparison.

When to use it — and when not to

Adoption is gated by Go 1.25 or newer for both the tool and every application it instruments, so teams running older toolchains cannot use it at all. Because instrumentation is injected during compilation, a project that builds cleanly with go build may fail under otel go build; the README states that such failures should be filed as bugs, which means build-time coupling is a real operational consideration rather than a theoretical one. Library coverage is bounded by the published minimum and maximum versions, and the project carries 30 open issues, so anyone needing instrumentation for a library absent from that matrix should not expect it to work. The tool has no described server component, but operators still need an OpenTelemetry-compatible destination for the traces and metrics their instrumented binaries emit.

project readme (upstream, from github) — read inline

   

Loongsuite Go Agent provides an automatic solution for Golang applications that want to leverage OpenTelemetry to enable effective observability. No code changes are required in the target application, the instrumentation is done at compile time. Simply adding otel prefix to go build to get started :rocket:

Installation

[!IMPORTANT] Requires Go 1.25 or newer. loongsuite-go pins OpenTelemetry v1.45.0, and the OTel modules declare go 1.25.0 from v1.42.0 onward. Since the tool injects those modules into the application it instruments, both the tool and the instrumented application need Go 1.25+. See compatibility.

Prebuilt Binaries

  • Download
  • Download
  • Download
  • Download
  • Download

This is the recommended way to install the tool.

Install via Bash

For Linux and MacOS users, the following script will install otel in /usr/local/bin/otel by default:

$ sudo curl -fsSL https://cdn.jsdelivr.net/gh/alibaba/loongsuite-go@main/install.sh | sudo bash

Build from Source

$ make         # build only
$ make install # build and install

Getting Started

Make sure the tool is installed:

$ # You may use "otel-linux-amd64" instead of "otel"
$ otel version

Just adding otel prefix to go build to build your project:

$ otel go build
$ otel go build -o app cmd/app
$ otel go build -gcflags="-m" cmd/app

That's the whole process! The tool will automatically instrument your code with OpenTelemetry, and you can start to observe your application. :telescope:

The detailed usage of otel tool can be found in Usage.

[!NOTE] If you find any compilation failures while go build works, it's likely a bug. Please feel free to file a bug at GitHub Issues to help us enhance this project.

Examples

  • demo - End-to-end example with OpenTelemetry tracing and metrics
  • zap logging - Auto-instrumentation for github.com/uber-go/zap logging
  • benchmark - Performance testing and overhead measurement
  • sql injection - Custom code injection for SQL injection detection
  • nethttp - HTTP monitoring with request/response instrumentation
  • kratos-demo - Integration with the Kratos framework
  • kafka-demo - Kafka Consumer Message monitoring

Supported Libraries

List of Supported Libraries
Library Repository Url Min Version Max Version
adk-go https://pkg.go.dev/google.golang.org/adk v0.2.0 -
amqp091 https://github.com/rabbitmq/amqp091-go v1.10.0 -
ants https://github.com/panjf2000/ants v1.1.0 -
anthropic-sdk-go https://github.com/anthropics/anthropic-sdk-go v1.25.0 -
asynq https://github.com/hibiken/asynq v0.23.0 v0.26.0
aws-sdk-go https://github.com/aws/aws-sdk-go v1.55.5 -
clickhouse/v2 https://github.com/ClickHouse/clickhouse-go/v2 v2.13.0 -
cron https://github.com/robfig/cron/v3 v3.0.0 -
database/sql https://pkg.go.dev/database/sql - -
deepseek https://github.com/cohesion-org/deepseek-go v1.3.0 -
dubbo-go https://github.com/apache/dubbo-go v3.3.0 -
echo https://github.com/labstack/echo v4.0.0 -
elasticsearch https://github.com/elastic/go-elasticsearch v8.4.0 v8.15.1
eino https://github.com/cloudwego/eino v0.3.51 -
fasthttp https://github.com/valyala/fasthttp v1.45.0 -
fiber https://github.com/gofiber/fiber v2.43.0 v2.52.13
fiber/v3 https://github.com/gofiber/fiber/v3 v3.0.0 -
franz-go https://github.com/twmb/franz-go v1.18.0 -
gin https://github.com/gin-gonic/gin v1.7.0 v1.10.2
go-kit/log https://github.com/go-kit/log v0.1.0 v0.2.2
go-micro https://github.com/micro/go-micro v5.0.0 v5.3.1
go-openai https://github.com/sashabaranov/go-openai v1.30.0 -
gocql https://github.com/gocql/gocql v1.3.0 v1.7.1
google-genai https://pkg.go.dev/google.golang.org/genai v1.30.0 -
gopg https://github.com/go-pg/pg v10.10.0 v10.14.1
gorestful/v3 https://github.com/emicklei/go-restful/v3 v3.7.0 v3.12.2
gorm https://github.com/go-gorm/gorm v1.22.0 v1.25.10
gorilla/mux https://github.com/gorilla/mux v1.3.0 v1.8.2
grpc https://google.golang.org/grpc v1.44.0 v1.63.0
hertz https://github.com/cloudwego/hertz v0.8.0 -
ibm-sarama https://github.com/IBM/sarama v1.40.0 -
iris https://github.com/kataras/iris v12.2.0 v12.2.12
k8s client-go https://github.com/kubernetes/client-go v0.33.3 -
kitex https://github.com/cloudwego/kitex v0.5.1 -
kratos https://github.com/go-kratos/kratos v2.6.3 -
kratos/v3 https://github.com/go-kratos/kratos/v3 v3.0.0 -
langchaingo https://github.com/tmc/langchaingo v0.1.13 -
log https://pkg.go.dev/log - -
logrus https://github.com/sirupsen/logrus v1.5.0 -
mcp https://github.com/mark3labs/mcp-go v0.20.0 v0.20.2
mcp go-sdk https://github.com/modelcontextprotocol/go-sdk v0.7.0 -
meguminnnnnnnnn/go-openai https://github.com/meguminnnnnnnnn/go-openai - -
mongodb https://github.com/mongodb/mongo-go-driver v1.11.1 v1.15.2
mqtt https://github.com/mochi-mqtt/server v2.6.4 -
neo4j https://github.com/neo4j/neo4j-go-driver v6.0.0 v6.2.0
nacos https://github.com/nacos-group/nacos-sdk-go/v2 v2.0.0 v2.3.0
net/http https://pkg.go.dev/net/http - -
new-api https://github.com/QuantumNous/new-api - -
ollama https://github.com/ollama/ollama v0.3.14 -
openai-go https://github.com/openai/openai-go v1.5.0 -
redigo https://github.com/gomodule/redigo v1.9.0 -
redis (go-redis) https://github.com/redis/go-redis v9.0.5 -
redis v8 https://github.com/go-redis/redis/v8 v8.11.0 v8.11.6
rocketmq https://github.com/apache/rocketmq-client-go/v2 v2.0.0 -
rpcx https://github.com/smallnest/rpcx v1.6.2 -
rueidis https://github.com/redis/rueidis v1.0.30 -
segmentio/kafka-go https://github.com/segmentio/kafka-go v0.4.0 -
sentinel https://github.com/alibaba/sentinel-golang v1.0.4 -
shopify-sarama https://github.com/Shopify/sarama v1.22.0 -
slog https://pkg.go.dev/log/slog - -
sqlx https://github.com/jmoiron/sqlx v1.3.0 v1.4.1
streadway-amqp https://github.com/streadway/amqp v1.0.0 -
trpc-agent-go https://github.com/trpc-group/trpc-agent-go v0.1.0 -
trpc-go https://github.com/trpc-group/trpc-go v1.0.0 -
zap https://github.com/uber-go/zap v1.20.0 v1.27.1
zerolog https://github.com/rs/zerolog v1.10.0 v1.34.1

We are progressively open-sourcing the libraries we have supported, and your contributions are Very Welcome

[!IMPORTANT] The framework you expected is not in the list? Don't worry, you can easily inject your code into any frameworks/libraries that are not officially supported.

Please refer to this document to get started.

Community

We are looking forward to your feedback and suggestions. You can join our DingTalk group or scan the QR code below to engage with us.

LoongCollector SIG LoongSuite Python SIG
LoongCollector Go SIG LoongSuite Java SIG

Star History

Frequently asked questions

Is loongsuite-go free to use?

loongsuite-go is open source under the Apache-2.0 licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does loongsuite-go do?

OpenTelemetry Compile-Time Instrumentation for Golang

What is loongsuite-go written in?

loongsuite-go is primarily written in Go. Its source is publicly available at https://github.com/alibaba/loongsuite-go, and it has 907 GitHub stars.