Categorygo.opentelemetry.io/auto

# README

OpenTelemetry Go Automatic Instrumentation

PkgGoDev

This repository provides OpenTelemetry tracing instrumentation for Go libraries using eBPF.

:construction: This project is currently work in progress.

Compatibility

OpenTelemetry Go Automatic Instrumentation is compatible with all current supported versions of the Go language.

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.

For versions of Go that are no longer supported upstream, this repository will stop ensuring compatibility with these versions in the following manner:

  • A minor release will be made to add support for the new supported release of Go.
  • The following minor release will remove compatibility testing for the oldest (now archived upstream) version of Go. This, and future, releases may include features only supported by the currently supported versions of Go.

Currently, OpenTelemetry Go Automatic Instrumentation is tested for the following environments.

OSGo VersionArchitecture
Ubuntu1.23amd64
Ubuntu1.22amd64

Automatic instrumentation should work on any Linux kernel above 4.4.

OpenTelemetry Go Automatic Instrumentation supports the arm64 architecture. However, there is no automated testing for this platform. Be sure to validate support on your own ARM based system.

Users of non-Linux operating systems can use the Docker images or create a virtual machine to compile and run OpenTelemetry Go Automatic Instrumentation.

See COMPATIBILITY.md for information about what Go packages this project provides instrumentation for.

Get started

See Getting started for setup, deployment, and configuration steps.

You can also try the Tutorial for a guide on setting up a sample Emojivoto application.

For technical and design info, see How it works.

Configuration

See the configuration documentation.

Contributing

See the contributing documentation.

License

OpenTelemetry Go Automatic Instrumentation is licensed under the terms of the Apache Software License version 2.0. See the license file for more details.

Third-party licenses and copyright notices can be found in the LICENSES directory.

# Packages

No description provided by the author

# Functions

DefaultSampler returns a ParentBased sampler with the following defaults: - Root: AlwaysOn - RemoteSampled: AlwaysOn - RemoteNotSampled: AlwaysOff - LocalSampled: AlwaysOn - LocalNotSampled: AlwaysOff.
NewInstrumentation returns a new [Instrumentation] configured with the provided opts.
Version is the current release version of OpenTelemetry Go auto-instrumentation in use.
WithConfigProvider returns an [InstrumentationOption] that will configure an [Instrumentation] to use the provided ConfigProvider.
WithEnv returns an [InstrumentationOption] that will configure [Instrumentation] using the values defined by the following environment variables: - OTEL_GO_AUTO_TARGET_EXE: sets the target binary - OTEL_SERVICE_NAME (or OTEL_RESOURCE_ATTRIBUTES): sets the service name - OTEL_TRACES_EXPORTER: sets the trace exporter - OTEL_GO_AUTO_GLOBAL: enables the OpenTelemetry global implementation - OTEL_LOG_LEVEL: sets the default logger's minimum logging level - OTEL_TRACES_SAMPLER: sets the trace sampler - OTEL_TRACES_SAMPLER_ARG: optionally sets the trace sampler argument This option may conflict with [WithTarget], [WithPID], [WithTraceExporter], [WithServiceName], [WithGlobal], and [WithSampler] if their respective environment variable is defined.
WithGlobal returns an [InstrumentationOption] that will configure an [Instrumentation] to record telemetry from the [OpenTelemetry default global implementation].
WithLoadedIndicator returns an [InstrumentationOption] that will configure an [Instrumentation] to close the provided indicator channel when the target process has been instrumented (i.e.
WithLogger returns an [InstrumentationOption] that will configure an [Instrumentation] to use the provided logger.
WithPID returns an [InstrumentationOption] defining the target binary for [Instrumentation] that is being run with the provided PID.
WithResourceAttributes returns an [InstrumentationOption] that will configure an [Instrumentation] to add the provided attributes to the OpenTelemetry resource.
WithSampler returns an [InstrumentationOption] that will configure an [Instrumentation] to use the provided sampler to sample OpenTelemetry traces.
WithServiceName returns an [InstrumentationOption] defining the name of the service running.
WithTarget returns an [InstrumentationOption] defining the target binary for [Instrumentation] that is being executed at the provided path.
WithTraceExporter returns an [InstrumentationOption] that will configure an [Instrumentation] to use the provided exp to export OpenTelemetry tracing telemetry.

# Structs

AlwaysOffSampler returns a Sampler that samples no traces.
AlwaysOnSampler is a Sampler that samples every trace.
Instrumentation manages and controls all OpenTelemetry Go auto-instrumentation.
InstrumentationConfig is used to configure instrumentation.
InstrumentationLibrary is used to configure instrumentation for a specific library.
InstrumentationLibraryID is used to identify an instrumentation library.
ParentBasedSampler is a [Sampler] which behaves differently, based on the parent of the span.
TraceIDRatioSampler samples a given fraction of traces.

# Interfaces

ConfigProvider provides the initial configuration and updates to the instrumentation configuration.
InstrumentationOption applies a configuration option to [Instrumentation].
Sampler decides whether a trace should be sampled and exported.