diff --git a/spec/src/main/asciidoc/logs.adoc b/spec/src/main/asciidoc/logs.adoc new file mode 100644 index 00000000..0b855ca7 --- /dev/null +++ b/spec/src/main/asciidoc/logs.adoc @@ -0,0 +1,43 @@ +// +// Copyright (c) 2024 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +[[logs]] +== Logs +The OpenTelemetry Logs bridge API exists to enable bridging logs from other log frameworks (e.g. SLF4J, Log4j, JUL, Logback, etc) into OpenTelemetry. It does not define new Log APIs. The following shows the entry points. + +[source,java] +---- +LoggerProvider (provider.loggerBuilder(instrumentationScopeName) + -> LoggerBuilder (loggerBuilder.build()) + ->Logger (logger.logRecordBuilder) + ->LogRecordBuilder +---- + +=== Access to the OpenTelemetry Logs API +An implementation of MicroProfile Telemetry Logs MUST provide the following CDI beans for supporting contextual instance injection: + +* `io.opentelemetry.api.logs.LoggerProvider` + +[source,java] +---- +@Inject LoggerProvider provider; +---- + + + diff --git a/spec/src/main/asciidoc/microprofile-telemetry-spec.asciidoc b/spec/src/main/asciidoc/microprofile-telemetry-spec.asciidoc index 1e5237bc..9b28e581 100644 --- a/spec/src/main/asciidoc/microprofile-telemetry-spec.asciidoc +++ b/spec/src/main/asciidoc/microprofile-telemetry-spec.asciidoc @@ -44,6 +44,7 @@ include::introduction.adoc[] include::integration.adoc[] include::tracing.adoc[] include::metrics.adoc[] +include::logs.adoc[] include::configuration.adoc[] include::opentelemetry-apis.adoc[] include::release-notes.adoc[] diff --git a/spec/src/main/asciidoc/opentelemetry-apis.adoc b/spec/src/main/asciidoc/opentelemetry-apis.adoc index fe51b1cb..09b2e67c 100644 --- a/spec/src/main/asciidoc/opentelemetry-apis.adoc +++ b/spec/src/main/asciidoc/opentelemetry-apis.adoc @@ -35,12 +35,8 @@ Baggage API:: * https://www.javadoc.io/static/io.opentelemetry/opentelemetry-api/{otel-java-version}/io/opentelemetry/api/baggage/propagation/package-summary.html[io.opentelemetry.api.baggage.propagation] Metrics API:: * https://www.javadoc.io/static/io.opentelemetry/opentelemetry-api/{otel-java-version}/io/opentelemetry/api/metrics/package-summary.html[io.opentelemetry.api.metrics] - - -[NOTE] -===== -`io.opentelemetry.api` does depend on https://www.javadoc.io/static/io.opentelemetry/opentelemetry-api/{otel-java-version}/io/opentelemetry/api/logs/package-summary.html[io.opentelemetry.api.logs], though this specification only supports the parts that relate to Tracing and Metrics. -===== +Logs API:: +* https://www.javadoc.io/static/io.opentelemetry/opentelemetry-api/{otel-java-version}/io/opentelemetry/api/logs/package-summary.html[io.opentelemetry.api.logs] === Context API