From 1abd67f12ef40d4c66a69abc41437050997cce02 Mon Sep 17 00:00:00 2001 From: David Mueller Date: Tue, 26 Nov 2024 13:04:37 -0500 Subject: [PATCH] edits #7655 --- .../pages/custom-mptelemetry-metrics.adoc | 2 +- modules/ROOT/pages/fault-tolerance.adoc | 7 ++++- modules/ROOT/pages/telemetry-trace.adoc | 2 +- .../feature/mpTelemetry-2.0/description.adoc | 1 + .../feature/mpTelemetry-2.0/examples.adoc | 28 ++----------------- 5 files changed, 12 insertions(+), 28 deletions(-) create mode 100644 modules/reference/pages/feature/mpTelemetry-2.0/description.adoc diff --git a/modules/ROOT/pages/custom-mptelemetry-metrics.adoc b/modules/ROOT/pages/custom-mptelemetry-metrics.adoc index 0176592ad2..4e66189732 100644 --- a/modules/ROOT/pages/custom-mptelemetry-metrics.adoc +++ b/modules/ROOT/pages/custom-mptelemetry-metrics.adoc @@ -18,7 +18,7 @@ For more information about collecting and emitting metrics with MicroProfile Tel For more information about OpenTelemetry metrics, see the link:https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-api/1.39.0/io/opentelemetry/api/metrics/package-summary.html[OpenTelemetry metrics API documentation]. -Before you can use OpenTelemetry to define custom metrics metrics, you must make 3rd party APIs visible in your runtime environment by editing your runtime configuration. You must also add the OpenTelemetry API and annotations as a dependency on your build path. For more information, see link:/docs/latest/reference/feature/mpTelemetry-2.0.html#dev[Customize your application telemetry with the OpenTelemetry API]. +Before you can use OpenTelemetry to define custom metrics metrics, you must make 3rd party APIs visible in your runtime environment by editing your runtime configuration. For more information, see link:/docs/latest/reference/feature/mpTelemetry-2.0.html#dev[Customize your application telemetry with the OpenTelemetry API]. The following example defines a custom counter metric: diff --git a/modules/ROOT/pages/fault-tolerance.adoc b/modules/ROOT/pages/fault-tolerance.adoc index d6a5fd8fdb..b000f28751 100644 --- a/modules/ROOT/pages/fault-tolerance.adoc +++ b/modules/ROOT/pages/fault-tolerance.adoc @@ -17,10 +17,13 @@ You can build resilient microservices by including fault tolerance policies in y Microservice-based applications are resilient when they can continue operating if there is a failure or error in some part of the system. Fault tolerance helps applications fail fast and recover smoothly by guiding how and when certain requests occur and by providing fallback strategies to handle common errors. For example, in an airline ticket application, different microservices might support scheduling, purchasing, and customer preferences. If one service fails, fault tolerance policies help contain the error and keep it from taking down the whole application. + == MicroProfile Fault Tolerance The feature:mpFaultTolerance[display=MicroProfile Fault Tolerance] feature defines a standard API to implement a set of fault tolerance policies. The policies that you implement in your code guide how long requests run, when they retry after an error, and what they do to recover when certain requests fail. MicroProfile Fault Tolerance makes it easy to build resilient microservices that provide reliable function, even when errors occur. +When you enable both feature:mpFaultTolerance-4.1[display=MicroProfile Fault Tolerance 4.1] and feature:mpTelemetry-2.0[display=MicroProfile Telemetry 2.0], fault tolerance metrics are automatically collected and exported to the configured OpenTelemetry metrics exporter. For more information, see xref:microprofile-telemetry.adoc[Collect logs, metrics, and traces with OpenTelemetry] and xref:mptelemetry-metrics-list.adoc[MicroProfile Telemetry metrics reference list]. + MicroProfile Fault Tolerance supports the following policies: - <<#timeout,Timeouts>> @@ -210,5 +213,7 @@ Ready to start building more resilient microservices with MicroProfile Fault Tol * To learn how to use the Circuit Breaker and Fallback policies to prevent repeated failed calls to a service, see link:/guides/circuit-breaker.html[Preventing repeated failed calls to microservices]. == See also + +- xref:reference:diff/mp-61-70-diff.adoc#ft[Differences between MicroProfile Fault Tolerance 4.1 and 4.0] +- - xref:reference:diff/mp-33-40-diff.adoc#ft[Differences between MicroProfile Fault Tolerance 3.0 and 2.1] - xref:reference:diff/mp-22-30-diff.adoc#ft[Differences between MicroProfile Fault Tolerance 2.0 and 1.1] -- xref:reference:diff/mp-33-40-diff.adoc#ft[Differences between MicroProfile Fault Tolerance 3.0 and 2.1] diff --git a/modules/ROOT/pages/telemetry-trace.adoc b/modules/ROOT/pages/telemetry-trace.adoc index 456f67f8ee..e6a806c521 100644 --- a/modules/ROOT/pages/telemetry-trace.adoc +++ b/modules/ROOT/pages/telemetry-trace.adoc @@ -30,7 +30,7 @@ In Open Liberty version 23.0.0.11 and later, spans are automatically generated f Automatic instrumentation is available only for JAX-RS and Jakarta RESTful web service applications. To create spans for other operations, such as database calls, you can add manual instrumentation to the source code for those operations by using the https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-api/1.39.0/io/opentelemetry/api/trace/package-summary.html[OpenTelemetry API]. -However, before you manually instrument your code, you must make 3rd party APIs visible in your runtime environment by editing your runtime configuration. You must also add the OpenTelemetry API and annotations as a dependency on your build path. For more information, see link:/docs/latest/reference/feature/mpTelemetry-2.0.html#dev[Customize your application telemetry with the OpenTelemetry API]. +However, before you manually instrument your code, you must make 3rd party APIs visible in your runtime environment by editing your runtime configuration. For more information, see link:/docs/latest/reference/feature/mpTelemetry-2.0.html#dev[Customize your application telemetry with the OpenTelemetry API]. After you complete those prerequisites, you're ready to instrument your code. The following examples show configuration options with the OpenTelemetry API. diff --git a/modules/reference/pages/feature/mpTelemetry-2.0/description.adoc b/modules/reference/pages/feature/mpTelemetry-2.0/description.adoc new file mode 100644 index 0000000000..ceb7042f4c --- /dev/null +++ b/modules/reference/pages/feature/mpTelemetry-2.0/description.adoc @@ -0,0 +1 @@ +MicroProfile Telemetry 2.0 is compatible with multiple versions of the feature:microprofile[display=MicroProfile umbrella feature]. It is automatically enabled when you enable `microprofile-6.1` or `microprofile-7.0`. However, it also works with `microprofile-5.0`, `microprofile-4.1`, or `microprofile-1.4` if you separately enable it alongside any of those features. diff --git a/modules/reference/pages/feature/mpTelemetry-2.0/examples.adoc b/modules/reference/pages/feature/mpTelemetry-2.0/examples.adoc index 8d0df4d783..b59b3b4af6 100644 --- a/modules/reference/pages/feature/mpTelemetry-2.0/examples.adoc +++ b/modules/reference/pages/feature/mpTelemetry-2.0/examples.adoc @@ -15,7 +15,7 @@ When you enable the MicroProfile Telemetry feature and set this property, your s [#logs] === Collect logs from a specified source -To enable the MicroProfile Telemetry feature to collect logs from different sources in the Open Liberty runtime environment, configure the `source` attribute for the `mpTelemetry` element with a comma-separated list of comma-separated log sources. +To enable the MicroProfile Telemetry feature to collect logs from different sources in the Open Liberty runtime environment, configure the `source` attribute for the `mpTelemetry` element with a comma-separated list of log sources. [source,xml] ---- @@ -31,11 +31,9 @@ To enable the MicroProfile Telemetry feature to collect logs from different sour [#dev] === Customize your application telemetry with the OpenTelemetry API -Although OpenTelemetry automatically collects a default set of logs, metrics, and traces, if you need to xref:ROOT:telemetry-trace.adoc[manually instrument your code to collect traces] or xref:ROOT:custom-mptelemetry-metrics.adoc[define custom metrics], you must make the OpenTelemetry API and annotations available in your development environment. +Although OpenTelemetry automatically collects a default set of logs, metrics, and traces, if you need to xref:ROOT:telemetry-trace.adoc[manually instrument your code to collect traces] or xref:ROOT:custom-mptelemetry-metrics.adoc[define custom metrics], you must make the OpenTelemetry API visible in your development environment. -Complete the following prerequisites before you configure custom OpenTelemetry traces or metrics in your application code: - -* xref:ROOT:class-loader-library-config.adoc#3rd-party[Enable third-party APIs] for your application by adding the following code in your `server.xml` file: +xref:ROOT:class-loader-library-config.adoc#3rd-party[Enable third-party APIs] for your application by adding the following code in your `server.xml` file: + [source,xml] ---- @@ -43,23 +41,3 @@ Complete the following prerequisites before you configure custom OpenTelemetry t ---- - -* Add the `opentelemetry` API and OpenTelemetry instrumentation annotations as a provided dependency to your build path. For example, with Maven, add the following code to your `pom.xml` file. -+ -[source,xml] ----- - - io.opentelemetry - opentelemetry-api - 1.39.0 - provided - - - io.opentelemetry.instrumentation - opentelemetry-instrumentation-annotations - 1.39.0-alpha - provided - ----- - -Once you complete these prerequisites, you can use the OpenTelemetry API and annotations in your development environment to configure custom application telemetry.