Skip to content

Commit 84d02c0

Browse files
ysolomchenkopellareddmathieu
authored
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 <[email protected]> Co-authored-by: Damien Mathieu <[email protected]>
1 parent d6d9966 commit 84d02c0

File tree

5 files changed

+27
-18
lines changed

5 files changed

+27
-18
lines changed

log/doc.go

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,19 @@
44
/*
55
Package log provides the OpenTelemetry Logs API.
66
7-
This package is intended to be used by bridges between existing logging
8-
libraries and OpenTelemetry. Users should not directly use this package as a
9-
logging library. Instead, install one of the bridges listed in the
10-
[registry], and use the associated logging library.
7+
This API is separate from its implementation so the instrumentation built from
8+
it is reusable. See [go.opentelemetry.io/otel/sdk/log] for the official
9+
OpenTelemetry implementation of this API.
10+
11+
The log package provides the OpenTelemetry Logs API, which serves as a standard
12+
interface for generating and managing log records within the OpenTelemetry ecosystem.
13+
This package allows users to emit LogRecords, enabling structured, context-rich logging
14+
that can be easily integrated with observability tools. It ensures that log data is captured
15+
in a way that is consistent with OpenTelemetry's data model.
16+
17+
This package can be used to create bridges between existing logging libraries and OpenTelemetry.
18+
Log bridges allow integrating the existing logging setups with OpenTelemetry.
19+
Log bridges can be found in the [registry].
1120
1221
# API Implementations
1322

log/embedded/embedded.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,33 @@
44
// Package embedded provides interfaces embedded within the [OpenTelemetry Logs
55
// Bridge API].
66
//
7-
// Implementers of the [OpenTelemetry Logs Bridge API] can embed the relevant
7+
// Implementers of the [OpenTelemetry Logs API] can embed the relevant
88
// type from this package into their implementation directly. Doing so will
99
// result in a compilation error for users when the [OpenTelemetry Logs Bridge
1010
// API] is extended (which is something that can happen without a major version
1111
// bump of the API package).
1212
//
13-
// [OpenTelemetry Logs Bridge API]: https://pkg.go.dev/go.opentelemetry.io/otel/log
13+
// [OpenTelemetry Logs API]: https://pkg.go.dev/go.opentelemetry.io/otel/log
1414
package embedded // import "go.opentelemetry.io/otel/log/embedded"
1515

16-
// LoggerProvider is embedded in the [Logs Bridge API LoggerProvider].
16+
// LoggerProvider is embedded in the [Logs API LoggerProvider].
1717
//
18-
// Embed this interface in your implementation of the [Logs Bridge API
18+
// Embed this interface in your implementation of the [Logs API
1919
// LoggerProvider] if you want users to experience a compilation error,
2020
// signaling they need to update to your latest implementation, when the [Logs
2121
// Bridge API LoggerProvider] interface is extended (which is something that
2222
// can happen without a major version bump of the API package).
2323
//
24-
// [Logs Bridge API LoggerProvider]: https://pkg.go.dev/go.opentelemetry.io/otel/log#LoggerProvider
24+
// [Logs API LoggerProvider]: https://pkg.go.dev/go.opentelemetry.io/otel/log#LoggerProvider
2525
type LoggerProvider interface{ loggerProvider() }
2626

27-
// Logger is embedded in [Logs Bridge API Logger].
27+
// Logger is embedded in [Logs API Logger].
2828
//
29-
// Embed this interface in your implementation of the [Logs Bridge API Logger]
29+
// Embed this interface in your implementation of the [Logs API Logger]
3030
// if you want users to experience a compilation error, signaling they need to
31-
// update to your latest implementation, when the [Logs Bridge API Logger]
31+
// update to your latest implementation, when the [Logs API Logger]
3232
// interface is extended (which is something that can happen without a major
3333
// version bump of the API package).
3434
//
35-
// [Logs Bridge API Logger]: https://pkg.go.dev/go.opentelemetry.io/otel/log#Logger
35+
// [Logs API Logger]: https://pkg.go.dev/go.opentelemetry.io/otel/log#Logger
3636
type Logger interface{ logger() }

log/global/log.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
/*
55
Package global provides access to a global implementation of the OpenTelemetry
6-
Logs Bridge API.
6+
Logs API.
77
88
This package is experimental. It will be deprecated and removed when the [log]
99
package becomes stable. Its functionality will be migrated to

log/noop/noop.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
// Package noop provides an implementation of the [OpenTelemetry Logs Bridge
55
// API] that produces no telemetry and minimizes used computation resources.
66
//
7-
// Using this package to implement the [OpenTelemetry Logs Bridge API] will
7+
// Using this package to implement the [OpenTelemetry Logs API] will
88
// effectively disable OpenTelemetry.
99
//
1010
// This implementation can be embedded in other implementations of the
11-
// [OpenTelemetry Logs Bridge API]. Doing so will mean the implementation
11+
// [OpenTelemetry Logs API]. Doing so will mean the implementation
1212
// defaults to no operation for methods it does not implement.
1313
//
14-
// [OpenTelemetry Logs Bridge API]: https://pkg.go.dev/go.opentelemetry.io/otel/log
14+
// [OpenTelemetry Logs API]: https://pkg.go.dev/go.opentelemetry.io/otel/log
1515
package noop // import "go.opentelemetry.io/otel/log/noop"
1616

1717
import (

sdk/log/doc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ is being run on. That way when multiple instances of the code are collected
3131
at a single endpoint their origin is decipherable.
3232
3333
See [go.opentelemetry.io/otel/log] for more information about
34-
the OpenTelemetry Logs Bridge API.
34+
the OpenTelemetry Logs API.
3535
*/
3636
package log // import "go.opentelemetry.io/otel/sdk/log"

0 commit comments

Comments
 (0)