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

MicroProfile Telemetry 240012 edits #7758

Merged
merged 31 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
7403e57
Update microprofile-telemetry.adoc
dmuelle Nov 6, 2024
f018476
new drafts
dmuelle Nov 6, 2024
dcec7c6
edits
dmuelle Nov 8, 2024
aaa85d3
edits
dmuelle Nov 8, 2024
7a03f48
edits 2
dmuelle Nov 8, 2024
c8e2974
edits
dmuelle Nov 11, 2024
36ce7c1
Update microprofile-config-properties.adoc
dmuelle Nov 11, 2024
a57f3fa
edits
dmuelle Nov 15, 2024
b6f620c
edits
dmuelle Nov 15, 2024
81d5350
Update custom-mptelemetry-metrics.adoc
dmuelle Nov 15, 2024
e9e51a2
Update custom-mptelemetry-metrics.adoc
dmuelle Nov 15, 2024
cdb4bdf
edits
dmuelle Nov 18, 2024
861fb6c
Update microprofile-telemetry.adoc
dmuelle Nov 18, 2024
cf6c057
Update telemetry-troubleshooting.adoc
dmuelle Nov 18, 2024
9d69575
edits
dmuelle Nov 18, 2024
20d8f82
Update telemetry-troubleshooting.adoc
dmuelle Nov 18, 2024
710507a
edits
dmuelle Nov 19, 2024
3fec68d
edits
dmuelle Nov 19, 2024
eac894c
Update telemetry-troubleshooting.adoc
dmuelle Nov 19, 2024
b468526
Update examples.adoc
dmuelle Nov 19, 2024
4c1fe68
edits
dmuelle Nov 19, 2024
0f1c4ab
Edits per dons review
dmuelle Nov 19, 2024
c9f81e8
Update microprofile-config-properties.adoc
dmuelle Nov 19, 2024
4a6e61d
edits per lauras review
dmuelle Nov 21, 2024
17a1cba
Update microprofile-telemetry.adoc
dmuelle Nov 21, 2024
24c44b3
Update microprofile-telemetry.adoc
dmuelle Nov 21, 2024
d9f1735
edits for dev prereqs
dmuelle Nov 22, 2024
1abd67f
edits
dmuelle Nov 26, 2024
2ba63f9
edits
dmuelle Nov 26, 2024
948f664
Update microprofile-telemetry.adoc
dmuelle Nov 27, 2024
9dc8967
editys
dmuelle Nov 27, 2024
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
8 changes: 4 additions & 4 deletions modules/ROOT/pages/custom-mptelemetry-metrics.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@

You can use the OpenTelemetry metrics API to define custom metrics in your application code. When you enable the MicroProfile Telemetry feature 2.0 or later, you can then collect and emit these metrics to customize the observability of your application.

For more information about collecting and emitting metrics with MicroProfile Telemetry, see xref:microprofile-telemetry.adoc#metrics[Configuring Open Liberty to use MicroProfile Telemetry to collect metrics].
For more information about collecting and emitting metrics with MicroProfile Telemetry, see xref:microprofile-telemetry.adoc[Collect logs, metrics, and traces with OpenTelemetry].

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 MicroProfile Telemetry to define custom metrics metrics, you must enable MicroProfile Telemetry in your development 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 xref:prepare-mptelemetry.adoc[Prepare your development environment for MicroProfile Telemetry].
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:

Expand Down Expand Up @@ -49,3 +47,5 @@ class WithCounter {
In this example, `Meter` is used to define an instrument, in this case a Counter. Application code then can record measurement values along with other attributes. Measurement aggregations are computed separately for each unique combination of attributes.

For a full list of available metrics, see link:https://opentelemetry.io/docs/specs/otel/metrics/api/#meter-operations[Meter operations] in the OpenTelemetry documentation.

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].
7 changes: 6 additions & 1 deletion modules/ROOT/pages/fault-tolerance.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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>>
Expand Down Expand Up @@ -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]
12 changes: 5 additions & 7 deletions modules/ROOT/pages/introduction-monitoring-metrics.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,18 @@
:page-type: general
:page-description: With Open Liberty, three types of metrics are available to monitor your applications: OpenTelemetry metrics provided by MicroProfile Telemetry, REST endpoint-style metrics that are provided by MicroProfile Metrics, and Java Management Extensions (JMX) metrics.
:seo-title: Monitoring with metrics - OpenLiberty.io
:seo-description: With Open Liberty, three types of metrics are available to monitor your applications: OpenTelemetry metrics provided by MicroProfile Telemetry, REST endpoint-style metrics that are provided by MicroProfile Metrics, and Java Management Extensions (JMX) metrics..
:seo-description: With Open Liberty, three types of metrics are available to monitor your applications: OpenTelemetry metrics provided by MicroProfile Telemetry, REST endpoint-style metrics that are provided by MicroProfile Metrics, and Java Management Extensions (JMX) metrics..\
= Monitoring with metrics

Three kinds of metrics are available to monitor your Open Liberty applications: OpenTelemetry metrics from MicroProfile Telemetry, REST endpoint-style metrics from MicroProfile Metrics, and Java Management Extensions (JMX) metrics. MicroProfile Metrics and JMX metrics can be used separately or in conjunction to improve the observability of your application systems.
Three kinds of metrics are available to monitor your Open Liberty applications: OpenTelemetry metrics from MicroProfile Telemetry, REST endpoint-style metrics from MicroProfile Metrics, and Java Management Extensions (JMX) metrics. OpenTelemetry provides a standardized solution to manage metrics, logs, and traces.MicroProfile Metrics and JMX metrics can be used separately or in conjunction to improve the observability of your application systems.


MicroProfile Telemetry 2.0 and later exports metrics to OTLP or another configured OpenTelemetry metrics exporter. You might prefer this option if you also use MicroProfile Telemetry to manage your logs and traces.
MicroProfile Telemetry 2.0 and later exports metrics to the configured OpenTelemetry metrics exporter, which can send metrics to the backend service of your choice. You might prefer this option if you also use MicroProfile Telemetry to manage your logs and traces. The following information pertains to MicroProfile Metrics and JMX Metrics. For information about using OpenTelemetry and MicroProfile Telemetry to collect and export metrics, see xref:microprofile-telemetry.adoc[OpenTelemetry].

MicroProfile Metrics can be accessed by monitoring tools, such as Prometheus, or by any client that can make REST requests.
<<#jmx,JMX metrics>> are suitable for use by Java-based monitoring tools that can communicate with JMX servers, or by custom JMX clients.

[#mptelem]
== Collect and export metrics with MicroProfile Telemetry
When you enable the MicroProfile Telemetry feature version 2.0 and later, you can manage your logs, metrics, and traces in a standardized way with the OpenTelemetry protocol. For more information, see xref:microprofile-telemetry.adoc[Enable observability with MicroProfile Telemetry].

the
[#endpoint]
== MicroProfile Metrics and the metrics endpoint
Open Liberty uses MicroProfile Metrics to expose metrics that describe the internal state of many Open Liberty components. Developers can also use the MicroProfile Metrics API to expose metrics from their applications.
Expand Down
Loading