2019-08-05 22:58:24 +02:00
|
|
|
# OpenTelemetry-Go
|
|
|
|
|
2021-02-04 21:13:25 +02:00
|
|
|
[![CI](https://github.com/open-telemetry/opentelemetry-go/workflows/ci/badge.svg)](https://github.com/open-telemetry/opentelemetry-go/actions?query=workflow%3Aci+branch%3Amain)
|
2021-05-24 18:27:43 +02:00
|
|
|
[![codecov.io](https://codecov.io/gh/open-telemetry/opentelemetry-go/coverage.svg?branch=main)](https://app.codecov.io/gh/open-telemetry/opentelemetry-go?branch=main)
|
2020-11-12 17:33:04 +02:00
|
|
|
[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel)](https://pkg.go.dev/go.opentelemetry.io/otel)
|
2019-11-01 20:40:29 +02:00
|
|
|
[![Go Report Card](https://goreportcard.com/badge/go.opentelemetry.io/otel)](https://goreportcard.com/report/go.opentelemetry.io/otel)
|
2021-02-22 18:38:12 +02:00
|
|
|
[![Slack](https://img.shields.io/badge/slack-@cncf/otel--go-brightgreen.svg?logo=slack)](https://cloud-native.slack.com/archives/C01NPAXACKT)
|
|
|
|
|
2021-05-03 20:42:32 +02:00
|
|
|
OpenTelemetry-Go is the [Go](https://golang.org/) implementation of [OpenTelemetry](https://opentelemetry.io/).
|
|
|
|
It provides a set of APIs to directly measure performance and behavior of your software and send this data to observability platforms.
|
2019-06-14 20:37:05 +02:00
|
|
|
|
2020-10-29 18:23:13 +02:00
|
|
|
## Project Status
|
|
|
|
|
2024-02-14 01:39:09 +02:00
|
|
|
| Signal | Status |
|
|
|
|
|---------|--------------------|
|
|
|
|
| Traces | Stable |
|
|
|
|
| Metrics | Stable |
|
|
|
|
| Logs | In development[^1] |
|
2020-10-29 18:23:13 +02:00
|
|
|
|
2024-02-17 14:36:41 +02:00
|
|
|
Progress and status specific to this repository is tracked in our
|
2020-10-29 18:23:13 +02:00
|
|
|
[project boards](https://github.com/open-telemetry/opentelemetry-go/projects)
|
|
|
|
and
|
|
|
|
[milestones](https://github.com/open-telemetry/opentelemetry-go/milestones).
|
|
|
|
|
2020-12-29 20:34:46 +02:00
|
|
|
Project versioning information and stability guarantees can be found in the
|
2023-06-01 16:30:39 +02:00
|
|
|
[versioning documentation](VERSIONING.md).
|
2020-12-29 20:34:46 +02:00
|
|
|
|
2024-02-14 01:39:09 +02:00
|
|
|
[^1]: https://github.com/orgs/open-telemetry/projects/43
|
|
|
|
|
2021-03-01 18:38:23 +02:00
|
|
|
### Compatibility
|
|
|
|
|
2022-08-10 17:57:01 +02:00
|
|
|
OpenTelemetry-Go ensures compatibility with the current supported versions of
|
|
|
|
the [Go language](https://golang.org/doc/devel/release#policy):
|
2021-11-22 18:09:42 +02:00
|
|
|
|
2022-08-10 17:57:01 +02:00
|
|
|
> Each major Go release is supported until there are two newer major releases.
|
|
|
|
> For example, Go 1.5 was supported until the Go 1.7 release, and Go 1.6 was supported until the Go 1.8 release.
|
2021-11-22 18:09:42 +02:00
|
|
|
|
2022-08-10 17:57:01 +02:00
|
|
|
For versions of Go that are no longer supported upstream, opentelemetry-go will
|
|
|
|
stop ensuring compatibility with these versions in the following manner:
|
|
|
|
|
|
|
|
- A minor release of opentelemetry-go will be made to add support for the new
|
|
|
|
supported release of Go.
|
|
|
|
- The following minor release of opentelemetry-go will remove compatibility
|
|
|
|
testing for the oldest (now archived upstream) version of Go. This, and
|
|
|
|
future, releases of opentelemetry-go may include features only supported by
|
|
|
|
the currently supported versions of Go.
|
|
|
|
|
|
|
|
Currently, this project supports the following environments.
|
2021-03-01 18:38:23 +02:00
|
|
|
|
|
|
|
| OS | Go Version | Architecture |
|
2023-06-01 16:30:39 +02:00
|
|
|
|---------|------------|--------------|
|
2024-02-08 10:44:35 +02:00
|
|
|
| Ubuntu | 1.22 | amd64 |
|
2023-08-27 16:18:34 +02:00
|
|
|
| Ubuntu | 1.21 | amd64 |
|
2024-02-08 10:44:35 +02:00
|
|
|
| Ubuntu | 1.22 | 386 |
|
2023-08-27 16:18:34 +02:00
|
|
|
| Ubuntu | 1.21 | 386 |
|
2024-02-08 10:44:35 +02:00
|
|
|
| MacOS | 1.22 | amd64 |
|
2023-08-27 16:18:34 +02:00
|
|
|
| MacOS | 1.21 | amd64 |
|
2024-02-08 10:44:35 +02:00
|
|
|
| Windows | 1.22 | amd64 |
|
2023-08-27 16:18:34 +02:00
|
|
|
| Windows | 1.21 | amd64 |
|
2024-02-08 10:44:35 +02:00
|
|
|
| Windows | 1.22 | 386 |
|
2023-08-27 16:18:34 +02:00
|
|
|
| Windows | 1.21 | 386 |
|
2021-03-01 18:38:23 +02:00
|
|
|
|
|
|
|
While this project should work for other systems, no compatibility guarantees
|
|
|
|
are made for those systems currently.
|
|
|
|
|
2020-08-27 21:14:37 +02:00
|
|
|
## Getting Started
|
2019-10-02 07:43:06 +02:00
|
|
|
|
2024-01-16 15:06:37 +02:00
|
|
|
You can find a getting started guide on [opentelemetry.io](https://opentelemetry.io/docs/languages/go/getting-started/).
|
2020-12-17 20:00:34 +02:00
|
|
|
|
2020-08-27 21:14:37 +02:00
|
|
|
OpenTelemetry's goal is to provide a single set of APIs to capture distributed
|
|
|
|
traces and metrics from your application and send them to an observability
|
|
|
|
platform. This project allows you to do just that for applications written in
|
|
|
|
Go. There are two steps to this process: instrument your application, and
|
|
|
|
configure an exporter.
|
2019-10-02 07:43:06 +02:00
|
|
|
|
2020-08-27 21:14:37 +02:00
|
|
|
### Instrumentation
|
2019-10-02 07:43:06 +02:00
|
|
|
|
2020-08-27 21:14:37 +02:00
|
|
|
To start capturing distributed traces and metric events from your application
|
|
|
|
it first needs to be instrumented. The easiest way to do this is by using an
|
|
|
|
instrumentation library for your code. Be sure to check out [the officially
|
|
|
|
supported instrumentation
|
2021-02-04 21:13:25 +02:00
|
|
|
libraries](https://github.com/open-telemetry/opentelemetry-go-contrib/tree/main/instrumentation).
|
2019-10-02 07:43:06 +02:00
|
|
|
|
2020-08-27 21:14:37 +02:00
|
|
|
If you need to extend the telemetry an instrumentation library provides or want
|
|
|
|
to build your own instrumentation for your application directly you will need
|
|
|
|
to use the
|
2022-03-25 19:49:48 +02:00
|
|
|
[Go otel](https://pkg.go.dev/go.opentelemetry.io/otel)
|
2020-08-27 21:14:37 +02:00
|
|
|
package. The included [examples](./example/) are a good way to see some
|
|
|
|
practical uses of this process.
|
2020-03-12 18:52:12 +02:00
|
|
|
|
2020-08-27 21:14:37 +02:00
|
|
|
### Export
|
2019-10-02 07:43:06 +02:00
|
|
|
|
2020-08-27 21:14:37 +02:00
|
|
|
Now that your application is instrumented to collect telemetry, it needs an
|
|
|
|
export pipeline to send that telemetry to an observability platform.
|
2019-10-02 07:43:06 +02:00
|
|
|
|
2021-06-12 20:39:22 +02:00
|
|
|
All officially supported exporters for the OpenTelemetry project are contained in the [exporters directory](./exporters).
|
|
|
|
|
|
|
|
| Exporter | Metrics | Traces |
|
2023-06-01 16:30:39 +02:00
|
|
|
|---------------------------------------|:-------:|:------:|
|
|
|
|
| [OTLP](./exporters/otlp/) | ✓ | ✓ |
|
|
|
|
| [Prometheus](./exporters/prometheus/) | ✓ | |
|
|
|
|
| [stdout](./exporters/stdout/) | ✓ | ✓ |
|
|
|
|
| [Zipkin](./exporters/zipkin/) | | ✓ |
|
2021-06-12 20:39:22 +02:00
|
|
|
|
2019-10-01 18:16:45 +02:00
|
|
|
## Contributing
|
|
|
|
|
2020-08-27 21:14:37 +02:00
|
|
|
See the [contributing documentation](CONTRIBUTING.md).
|