Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add log appender / bridge to glossary #3335

Merged
merged 7 commits into from
Mar 28, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ release.
([#3334](https://github.com/open-telemetry/opentelemetry-specification/pull/3334))
- Break out compatibility document on recording trace context in non-OTLP Log Format
([#3331](https://github.com/open-telemetry/opentelemetry-specification/pull/3331))
- Add log appender / bridge to glossary.
([#3335](https://github.com/open-telemetry/opentelemetry-specification/pull/3335))

### Resource

Expand Down
9 changes: 9 additions & 0 deletions specification/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Some other fundamental terms are documented in the [overview document](overview.
* [Log Attributes](#log-attributes)
* [Structured Logs](#structured-logs)
* [Flat File Logs](#flat-file-logs)
* [Log Appender / Bridge](#log-appender--bridge)

<!-- tocstop -->

Expand Down Expand Up @@ -234,3 +235,11 @@ records are possible too). There is no common industry agreement whether
logs written to text files in more structured formats (e.g. JSON files)
are considered Flat File Logs or not. Where such distinction is important it is
recommended to call it out specifically.

### Log Appender / Bridge

A log appender or bridge is a component which bridges logs from an existing log
API into OpenTelemetry using the [Log Bridge API](./logs/bridge-api.md). The
terms "log bridge" and "log appender" are used interchangeably, reflecting that
these components bridge data into OpenTelemetry, but are often called appenders
in the logging domain.
12 changes: 6 additions & 6 deletions specification/logs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ Given the above state of the logging space we took the following approach:
- OpenTelemetry defines a Logs Bridge API
for [emitting LogRecords](./bridge-api.md#emit-logrecord). Application developers are
NOT encouraged to call this API directly. It is provided for library authors
to build [Appenders](./bridge-api.md#how-to-create-log4j-style-appender), which use
to build [log appender](../glossary.md#log-appender--bridge), which use
the API to bridge between existing logging libraries and the OpenTelemetry log
data model. Existing logging libraries generally provide a much richer set of
features than what is defined in OpenTelemetry. It is NOT a goal of
Expand Down Expand Up @@ -292,8 +292,8 @@ collected from all applications that can be instrumented in this manner.

Some logging libraries are designed to be extended in this manner relatively
easily. There is no need to actually modify the libraries, instead we can
implement "appender" or "exporter" components for such libraries and implement
the additional LogRecord enrichment in these components.
implement "log appender" or "log bridge" components for such libraries and
implement the additional LogRecord enrichment in these components.

There are typically 2 ways to collect logs from these applications.

Expand Down Expand Up @@ -358,7 +358,7 @@ To facilitate both approaches described above OpenTelemetry provides
a [Bridge API](./bridge-api.md) and [SDK](./sdk.md), which can be used together with existing
logging libraries to automatically inject the trace context in the emitted logs,
and provide an easy way to send the logs via OTLP. Instead of
modifying each logging statement, [Appenders](./bridge-api.md#how-to-create-log4j-style-appender)
modifying each logging statement, [log appenders](../glossary.md#log-appender--bridge)
use the API to bridge logs from existing logging libraries to the OpenTelemetry
data model, where the SDK controls how the logs are processed and exported.
Application developers only need to configure the Appender and SDK at
Expand All @@ -369,8 +369,8 @@ application startup.
These are greenfield developments. OpenTelemetry provides recommendations and
best practices about how to emit logs (along with traces and metrics) from these
applications. For applicable languages and frameworks the auto-instrumentation
or simple configuration of a logging library to use an OpenTelemetry appender or
extension will still be the easiest way to emit context-enriched logs. As
or simple configuration of a logging library to use an OpenTelemetry log appender
will still be the easiest way to emit context-enriched logs. As
already described earlier we provide extensions to some popular logging
libraries languages to support the manual instrumentation cases. The extensions
will support the inclusion of the trace context in the logs and allow to send
Expand Down
13 changes: 7 additions & 6 deletions specification/logs/bridge-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
+ [Emit LogRecord](#emit-logrecord)
- [LogRecord](#logrecord)
- [Usage](#usage)
* [How to Create Log4J Style Appender](#how-to-create-log4j-style-appender)
* [How to Create Log4J Log Appender](#how-to-create-log4j-log-appender)
jack-berg marked this conversation as resolved.
Show resolved Hide resolved
* [Implicit Context Injection](#implicit-context-injection)
* [Explicit Context Injection](#explicit-context-injection)

Expand All @@ -27,7 +27,7 @@

<b>Note: this document defines a log *backend* API. The API is not intended to be called
by application developers directly. It is provided for logging library authors
to build [Appenders](#how-to-create-log4j-style-appender), which use
to build [log appenders](#how-to-create-log4j-log-appender), which use
jack-berg marked this conversation as resolved.
Show resolved Hide resolved
this API to bridge between existing logging libraries and the OpenTelemetry log
data model.</b>

Expand Down Expand Up @@ -164,15 +164,16 @@ fields:

## Usage

### How to Create Log4J Style Appender
### How to Create Log4J Log Appender
jack-berg marked this conversation as resolved.
Show resolved Hide resolved

An Appender implementation can be used to allow emitting logs via
A [log appender](../glossary.md#log-appender--bridge) implementation can be used
to allow emitting logs via
OpenTelemetry [LogRecordExporters](sdk.md#logrecordexporter). This approach is
typically used for applications which are fine with changing the log transport
and is [one of the supported](README.md#direct-to-collector) log collection
approaches.

The Appender implementation will typically acquire a [Logger](#logger) from the
The log appender implementation will typically acquire a [Logger](#logger) from the
global [LoggerProvider](#loggerprovider) at startup time, then construct
`LogRecord`s for each log received from the application, and then call
[Emit LogRecord](#emit-logrecord).
Expand All @@ -190,7 +191,7 @@ This same approach can be also used for example for:
there is no implicit Context in Go it is not possible to get and use the
active Span.

Appenders can be created in OpenTelemetry language libraries by OpenTelemetry
Log appenders can be created in OpenTelemetry language libraries by OpenTelemetry
maintainers, or by 3rd parties for any logging library that supports a similar
extension mechanism. This specification recommends each OpenTelemetry language
library to include out-of-the-box Appender implementation for at least one
Expand Down