1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-08-10 22:31:50 +02:00

Do not discourage direct usage of Logs API (#6675)

Fixes #6572

## What

- Update documentation in `log/doc.go`.
- Fix naming of the Logs API in several documentation files `(Logs
Bridge API -> Logs API)`.

---------

Co-authored-by: Robert Pająk <pellared@hotmail.com>
Co-authored-by: Damien Mathieu <42@dmathieu.com>
This commit is contained in:
Yevhenii Solomchenko
2025-04-22 11:00:19 +02:00
committed by GitHub
parent d6d9966f9e
commit 84d02c0f39
5 changed files with 27 additions and 18 deletions

View File

@@ -4,10 +4,19 @@
/* /*
Package log provides the OpenTelemetry Logs API. Package log provides the OpenTelemetry Logs API.
This package is intended to be used by bridges between existing logging This API is separate from its implementation so the instrumentation built from
libraries and OpenTelemetry. Users should not directly use this package as a it is reusable. See [go.opentelemetry.io/otel/sdk/log] for the official
logging library. Instead, install one of the bridges listed in the OpenTelemetry implementation of this API.
[registry], and use the associated logging library.
The log package provides the OpenTelemetry Logs API, which serves as a standard
interface for generating and managing log records within the OpenTelemetry ecosystem.
This package allows users to emit LogRecords, enabling structured, context-rich logging
that can be easily integrated with observability tools. It ensures that log data is captured
in a way that is consistent with OpenTelemetry's data model.
This package can be used to create bridges between existing logging libraries and OpenTelemetry.
Log bridges allow integrating the existing logging setups with OpenTelemetry.
Log bridges can be found in the [registry].
# API Implementations # API Implementations

View File

@@ -4,33 +4,33 @@
// Package embedded provides interfaces embedded within the [OpenTelemetry Logs // Package embedded provides interfaces embedded within the [OpenTelemetry Logs
// Bridge API]. // Bridge API].
// //
// Implementers of the [OpenTelemetry Logs Bridge API] can embed the relevant // Implementers of the [OpenTelemetry Logs API] can embed the relevant
// type from this package into their implementation directly. Doing so will // type from this package into their implementation directly. Doing so will
// result in a compilation error for users when the [OpenTelemetry Logs Bridge // result in a compilation error for users when the [OpenTelemetry Logs Bridge
// API] is extended (which is something that can happen without a major version // API] is extended (which is something that can happen without a major version
// bump of the API package). // bump of the API package).
// //
// [OpenTelemetry Logs Bridge API]: https://pkg.go.dev/go.opentelemetry.io/otel/log // [OpenTelemetry Logs API]: https://pkg.go.dev/go.opentelemetry.io/otel/log
package embedded // import "go.opentelemetry.io/otel/log/embedded" package embedded // import "go.opentelemetry.io/otel/log/embedded"
// LoggerProvider is embedded in the [Logs Bridge API LoggerProvider]. // LoggerProvider is embedded in the [Logs API LoggerProvider].
// //
// Embed this interface in your implementation of the [Logs Bridge API // Embed this interface in your implementation of the [Logs API
// LoggerProvider] if you want users to experience a compilation error, // LoggerProvider] if you want users to experience a compilation error,
// signaling they need to update to your latest implementation, when the [Logs // signaling they need to update to your latest implementation, when the [Logs
// Bridge API LoggerProvider] interface is extended (which is something that // Bridge API LoggerProvider] interface is extended (which is something that
// can happen without a major version bump of the API package). // can happen without a major version bump of the API package).
// //
// [Logs Bridge API LoggerProvider]: https://pkg.go.dev/go.opentelemetry.io/otel/log#LoggerProvider // [Logs API LoggerProvider]: https://pkg.go.dev/go.opentelemetry.io/otel/log#LoggerProvider
type LoggerProvider interface{ loggerProvider() } type LoggerProvider interface{ loggerProvider() }
// Logger is embedded in [Logs Bridge API Logger]. // Logger is embedded in [Logs API Logger].
// //
// Embed this interface in your implementation of the [Logs Bridge API Logger] // Embed this interface in your implementation of the [Logs API Logger]
// if you want users to experience a compilation error, signaling they need to // if you want users to experience a compilation error, signaling they need to
// update to your latest implementation, when the [Logs Bridge API Logger] // update to your latest implementation, when the [Logs API Logger]
// interface is extended (which is something that can happen without a major // interface is extended (which is something that can happen without a major
// version bump of the API package). // version bump of the API package).
// //
// [Logs Bridge API Logger]: https://pkg.go.dev/go.opentelemetry.io/otel/log#Logger // [Logs API Logger]: https://pkg.go.dev/go.opentelemetry.io/otel/log#Logger
type Logger interface{ logger() } type Logger interface{ logger() }

View File

@@ -3,7 +3,7 @@
/* /*
Package global provides access to a global implementation of the OpenTelemetry Package global provides access to a global implementation of the OpenTelemetry
Logs Bridge API. Logs API.
This package is experimental. It will be deprecated and removed when the [log] This package is experimental. It will be deprecated and removed when the [log]
package becomes stable. Its functionality will be migrated to package becomes stable. Its functionality will be migrated to

View File

@@ -4,14 +4,14 @@
// Package noop provides an implementation of the [OpenTelemetry Logs Bridge // Package noop provides an implementation of the [OpenTelemetry Logs Bridge
// API] that produces no telemetry and minimizes used computation resources. // API] that produces no telemetry and minimizes used computation resources.
// //
// Using this package to implement the [OpenTelemetry Logs Bridge API] will // Using this package to implement the [OpenTelemetry Logs API] will
// effectively disable OpenTelemetry. // effectively disable OpenTelemetry.
// //
// This implementation can be embedded in other implementations of the // This implementation can be embedded in other implementations of the
// [OpenTelemetry Logs Bridge API]. Doing so will mean the implementation // [OpenTelemetry Logs API]. Doing so will mean the implementation
// defaults to no operation for methods it does not implement. // defaults to no operation for methods it does not implement.
// //
// [OpenTelemetry Logs Bridge API]: https://pkg.go.dev/go.opentelemetry.io/otel/log // [OpenTelemetry Logs API]: https://pkg.go.dev/go.opentelemetry.io/otel/log
package noop // import "go.opentelemetry.io/otel/log/noop" package noop // import "go.opentelemetry.io/otel/log/noop"
import ( import (

View File

@@ -31,6 +31,6 @@ is being run on. That way when multiple instances of the code are collected
at a single endpoint their origin is decipherable. at a single endpoint their origin is decipherable.
See [go.opentelemetry.io/otel/log] for more information about See [go.opentelemetry.io/otel/log] for more information about
the OpenTelemetry Logs Bridge API. the OpenTelemetry Logs API.
*/ */
package log // import "go.opentelemetry.io/otel/sdk/log" package log // import "go.opentelemetry.io/otel/sdk/log"