Skip to content

Rebuild Loongsuite Go Agent based on opentelemetry-go-compile-instrumentation, starting from v2.0.0 #708

Description

@NameHaibinZhang

Background

Loongsuite Go Agent (github.com/alibaba/loongsuite-go) is currently the most comprehensive compile-time OpenTelemetry auto-instrumentation tool for Go, supporting over 72 instrumentation rules covering 57+ mainstream Go libraries across HTTP/RPC frameworks, databases, message queues, logging, AI/GenAI SDKs, and more.

The OpenTelemetry community's official compile-time instrumentation project, opentelemetry-go-compile-instrumentation (github.com/open-telemetry/opentelemetry-go-compile-instrumentation), is under active development. Its latest release is v0.5.0 (May 2026), and it has not yet reached the 1.0.0 stable milestone. The project README explicitly states: "This is a work in progress and not ready for production use."

Currently, the upstream project supports approximately 10 instrumentation categories (database, gin, gRPC, MongoDB, OTel SDK, net/http, k8s client-go, log/slog, logrus, runtime, redis, kafka, openai), while Loongsuite Go Agent supports 72+ rules — making Loongsuite Go Agent a significant superset of the upstream project.

Motivation

As the upstream project matures toward a 1.0.0 release, it makes strategic sense to rebuild Loongsuite Go Agent on top of the official OpenTelemetry framework rather than maintaining a fully independent codebase. This alignment will:

  1. Reduce maintenance burden: By sharing the core framework with the upstream community, we avoid duplicating foundational work.
  2. Accelerate community adoption: Building on the official project increases trust and visibility.
  3. Contribute back to the community: Loongsuite Go Agent's extensive plugin ecosystem can be gradually contributed upstream, enriching the OpenTelemetry ecosystem.

Goals

  1. Rebuild on upstream: After opentelemetry-go-compile-instrumentation releases its first 1.0.0 version branch, rebuild Loongsuite Go Agent as an extension built on top of the upstream framework.
  2. Version alignment: Loongsuite Go Agent version numbering starts from v2.0.0 (with upstream v1.0.0 as the baseline), maintaining a version number consistently above the upstream baseline.
  3. Maximize upstream contribution: Push as many plugins as possible from Loongsuite Go Agent upstream to the opentelemetry-go-compile-instrumentation community.

Work Plan

Phase 1: Preparation (Current — Pre-1.0.0)

  • Continuously track upstream project development progress
  • Audit the gap between Loongsuite Go Agent's 72+ existing plugins and the upstream's current instrumentation coverage
  • Create a prioritized plugin migration and upstream contribution checklist
  • Engage with the upstream community to align on architecture and contribution guidelines

Phase 2: Rebuild (Triggered by upstream 1.0.0 release)

  • Fork the upstream 1.0.0 release branch as the baseline for Loongsuite Go Agent v2.0.0
  • Adjust module paths and project structure while preserving the Loongsuite Go Agent brand and CLI tool compatibility
  • Migrate Loongsuite Go Agent's unique plugins to the new architecture
  • Ensure backward compatibility for existing users
  • Update documentation, CI/CD, and release tooling

Phase 3: Upstream Contribution (Ongoing)

  • Gradually contribute mature plugins to the upstream community via PRs
  • Prioritize plugins with broad applicability and high community demand
  • Collaborate with upstream maintainers, following upstream code standards and contribution processes
  • Track contribution status and coordinate with upstream release cadence

Loongsuite Go Agent Plugin Inventory

The following is the full list of Loongsuite Go Agent's current instrumentation rules:

AI / GenAI (14): adk-go, anthropic-sdk-go, deepseek, eino, google-genai, langchain, meguminnnnnnnnn-openai, newapi, ollama, openai-go, openai-go-v2, openai-go-v3, go-openai, trpc-agent-go

HTTP / Web Frameworks (17): echo, fasthttp, fiberv2, fiberv3, gin, gorestful, hertz, http (net/http), iris, mux, kratos, kitex, dubbo, gomicro, rpcx, grpc, trpc

Database / ORM (7): databasesql, gorm, gopg, sqlx, clickhousev2, gocql, mongo

Redis / Cache (4): goredis, goredisv8, redigo, rueidisgo

Message Queue (10): amqp091, streadway-amqp, franz-go, ibm-sarama, shopify-sarama, segmentio-kafka-go, rocketmq, mqtt, asynq, asynq_v0_26_0

Logging (6): zap, zerolog, logrus, go-kit-log, golog, goslog

Search / Middleware (9): elasticsearch, nacos, nacos2_1_0, nacos2_1_1, sentinel, cron, mcp, mcp-official, mcp0_20_0

Concurrency (2): goants-v1, goants-v2

Infrastructure (5): k8s-client-go, otel-context, otel-sdk, runtime

Upstream Contribution Candidates

The upstream project currently includes: database, gin, gRPC, MongoDB, OTel SDK, net/http, k8s client-go, log/slog, logrus, runtime, redis, kafka, openai.

The following Loongsuite Go Agent plugins are not yet in upstream and are candidates for contribution:

High Priority (broad applicability, high community demand):

  • Web frameworks: echo, fasthttp, fiber (v2/v3), gorestful, mux, iris
  • ORM: gorm, sqlx, gopg
  • Logging: zap, zerolog
  • Search: elasticsearch
  • Message queues: rocketmq, amqp091

Medium Priority:

  • RPC frameworks: kratos, kitex, hertz, dubbo
  • Redis clients: redigo, rueidis
  • Task queues: asynq, mqtt
  • Middleware: sentinel, nacos
  • Scheduling: cron
  • Concurrency: goants

AI/GenAI Specialized:

  • anthropic, deepseek, ollama, langchain, eino, google-genai, trpc-agent-go, adk-go

Timeline

  • Now: Phase 1 preparation — auditing plugins, engaging with upstream community
  • Upstream 1.0.0 release: Trigger Phase 2 rebuild
  • Post v2.0.0 release: Begin Phase 3 systematic upstream contribution

Additional Context

  • Module path: github.com/alibaba/loongsuite-go (current) → will be rebuilt on github.com/open-telemetry/opentelemetry-go-compile-instrumentation baseline
  • CLI tool: otel (may need alignment with upstream's otelc)
  • Go version: currently 1.24.0, upstream requires 1.25.0+

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions