OpenTelemetry-Go Documentation

repository·main·Indexed 27 days ago

https://github.com/open-telemetry/opentelemetry-go

Go implementation of the OpenTelemetry specification, providing APIs for collecting traces, metrics, and logs. Includes OTLP exporters for gRPC and HTTP, as well as bridges for OpenCensus and OpenTracing to facilitate migration and interoperability.

Tokens
60.5K
Snippets
91
Records
471
Agent score
88%

What's inside OpenTelemetry-Go

  1. Overview of the OpenTelemetry Log API

    main
    The otel/log package provides the experimental Log API for OpenTelemetry in Go. This API allows developers to instrument applications with structured logging that follows the OpenTelemetry specification, enabling unified observability alongside traces and metrics.
  2. Overview of OpenTelemetry Exporters

    main
    OpenTelemetry Exporters are used to send telemetry data (Logs, Metrics, and Traces) that has been created and processed by the OpenTelemetry SDK to a backend or destination. The opentelemetry-go repository provides several built-in exporter packages for different telemetry signals and protocols.
  3. Overview of the Trace API

    main
    The trace package is the core API for creating and managing traces in OpenTelemetry-Go. It provides the interfaces necessary to start spans, manage span contexts, and interact with a Tracer. This package is the primary entry point for manual instrumentation of Go applications to capture distributed tracing data.
  4. Overview of OpenTelemetry-Go

    main
    OpenTelemetry-Go is the Go implementation of the OpenTelemetry standard. It provides a set of APIs to directly measure the performance and behavior of your software and send this data to observability platforms. The project provides support for Traces and Metrics (Stable) and Logs (Beta).
  5. Understand Logs SDK experimental feature stability

    main

    Features in the sdk/log/internal/x package are experimental and have not yet stabilized in the OpenTelemetry specification.

    Important considerations:

    • These features may change in backwards incompatible ways.
    • They may be removed or modified in any version release, including patch versions.
    • They do not follow the standard OpenTelemetry Go versioning and stability policy.
    • When an experimental feature becomes stable, a migration path will be provided in the changelog.
  6. Design principles of the OpenTelemetry Logs API

    main

    The OpenTelemetry Logs API is designed to be independent of other logging libraries like slog. It follows the OpenTelemetry Logs API specification to ensure compliance and interoperability. Key design decisions include:

    • Decoupling from slog: Interoperability with slog is achieved via a log bridge rather than direct coupling.
    • Record as a struct: The Record type is a value object implemented as a struct to improve performance by reducing indirect calls and heap allocations.
    • Performance-oriented Emit: The Logger.Emit method accepts a Record directly rather than using variadic options to minimize heap allocations.
    • Unified Value Model: To avoid duplication and facilitate easier bridge implementation, log records use attribute.Value for body values and attribute.KeyValue for attributes, aligning with the common attribute model used across other OpenTelemetry signals.
  7. Understand experimental feature stability in otlpmetrichttp

    main

    Features in the otlpmetrichttp exporter marked as experimental are not covered by the standard OpenTelemetry Go versioning and stability policy.

    Key stability considerations:

    • Experimental features may undergo backwards incompatible changes.
    • Features may be removed or modified in any release, including patch versions.
    • When an experimental feature becomes stable, a migration path will be provided in the changelog.
    • Environment variable feature flags (like OTEL_GO_X_OBSERVABILITY) may not be supported in stable versions, or may be deprecated.