Categorygo.opentelemetry.io/otel
modulepackage
0.20.0
Repository: https://github.com/open-telemetry/opentelemetry-go.git
Documentation: pkg.go.dev

# README

OpenTelemetry-Go

CI PkgGoDev Go Report Card Slack

The Go OpenTelemetry implementation.

Project Status

Warning: this project is currently in a pre-GA phase. Backwards incompatible changes may be introduced in subsequent minor version releases as we work to track the evolving OpenTelemetry specification and user feedback.

Our progress towards a GA release candidate is tracked in this project board. This release candidate will follow semantic versioning and will be released with a major version greater than zero.

Progress and status specific to this repository is tracked in our local project boards and milestones.

Project versioning information and stability guarantees can be found in the versioning documentation.

Compatibility

This project is tested on the following systems.

OSGo VersionArchitecture
Ubuntu1.15amd64
Ubuntu1.14amd64
Ubuntu1.15386
Ubuntu1.14386
MacOS1.15amd64
MacOS1.14amd64
Windows1.15amd64
Windows1.14amd64
Windows1.15386
Windows1.14386

While this project should work for other systems, no compatibility guarantees are made for those systems currently.

Getting Started

You can find a getting started guide on opentelemetry.io.

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.

Instrumentation

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 libraries.

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 go.opentelemetry.io/otel/api package. The included examples are a good way to see some practical uses of this process.

Export

Now that your application is instrumented to collect telemetry, it needs an export pipeline to send that telemetry to an observability platform.

You can find officially supported exporters here and in the companion contrib repository. Additionally, there are many vendor specific or 3rd party exporters for OpenTelemetry. These exporters are broken down by trace and metric support.

Contributing

See the contributing documentation.

# Packages

package attribute provides key and value attributes.
Package baggage provides functionality for storing and retrieving baggage items in Go context.
Package codes defines the canonical error codes used by OpenTelemetry.
No description provided by the author
Package propagation contains OpenTelemetry context propagators.
No description provided by the author
Copyright The OpenTelemetry Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
Package trace provides an implementation of the tracing part of the OpenTelemetry API.
Package unit provides units.

# Functions

GetErrorHandler returns the global ErrorHandler instance.
GetTextMapPropagator returns the global TextMapPropagator.
GetTracerProvider returns the registered global trace provider.
Handle is a convience function for ErrorHandler().Handle(err).
SetErrorHandler sets the global ErrorHandler to be h.
SetTextMapPropagator sets propagator as the global TextMapPropagator.
SetTracerProvider registers `tp` as the global trace provider.
Tracer creates a named tracer that implements Tracer interface.
Version is the current release version of OpenTelemetry in use.

# Interfaces

ErrorHandler handles irremediable events.