Introduction to OpenTelemetry-Go
OpenTelemetry-Go is the official Go programming language implementation of OpenTelemetry, a project designed to help developers monitor the performance and behavior of their software. By providing a set of APIs, it allows developers to capture and export traces, metrics, and logs from their applications to various monitoring platforms.
Project Status
OpenTelemetry-Go currently has stable support for capturing and exporting traces and metrics, while its logging capabilities are in beta.
You can track the project's progress and status on its project boards and milestones. Detailed versioning and stability information is available in the versioning documentation.
Compatibility
OpenTelemetry-Go maintains compatibility with the versions of the Go programming language that are currently supported upstream. The project supports various operating systems and architectures, including Ubuntu, Linux, macOS, and Windows, across Go versions 1.22 and 1.23. Each supported operating system is compatible with specific system architectures such as amd64, 386, and arm64.
While compatibility is ensured for the listed systems, there are no guarantees made for other systems at this time.
Getting Started
A comprehensive guide to getting started with OpenTelemetry-Go can be found on opentelemetry.io. The main purpose of OpenTelemetry is to provide unified APIs to capture distributed traces and metrics from applications, enabling developers to send this data to monitoring platforms. The process involves two key steps: Instrumenting your application and setting up an exporter.
Instrumentation
To capture distributed traces and metrics, your application must first be instrumented. This can be easily achieved by using official instrumentation libraries. If you wish to create custom instrumentation or extend the capabilities of existing libraries, you can utilize the Go otel package, with practical examples available here.
Export
Once your application is instrumented, you need an export pipeline to send the telemetry data to an observability platform. OpenTelemetry-Go supports several official exporters, each facilitating the export of telemetry data such as logs, metrics, and traces:
- OTLP: Supports logs, metrics, and traces.
- Prometheus: Supports metrics.
- stdout: Supports logs, metrics, and traces.
- Zipkin: Supports traces.
For implementation details on these exporters, visit the exporters directory.
Contributing
To contribute to the OpenTelemetry-Go project, refer to the contributing documentation for guidelines and processes. Contributions from the community are welcome and encouraged, supporting ongoing development and improvement of the project.