Skip to content

Commit

Permalink
edits per review
Browse files Browse the repository at this point in the history
  • Loading branch information
dmuelle committed Sep 5, 2024
1 parent 430bf05 commit c4fae5b
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 17 deletions.
21 changes: 11 additions & 10 deletions modules/ROOT/pages/introduction-monitoring-metrics.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,27 @@
//
:page-layout: general-reference
:page-type: general
:page-description: With Open Liberty, two types of metrics are available to monitor your applications, REST endpoint-style metrics that are provided by MicroProfile Metrics, and Java Management Extensions (JMX) metrics.
: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, two types of metrics are available to monitor your applications, 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

Two kinds of metrics are available to monitor your Open Liberty applications: REST endpoint-style metrics that are provided by 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. 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 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.

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.
For more information about adding these metrics to your applications, see xref:microservice-observability-metrics.adoc#add[Adding metrics to your applications] and the link:/guides/microprofile-metrics.html[Providing metrics from a microservice] guide. For a list of all REST endpoint-style metrics that are available for Open Liberty, see the xref:metrics-list.adoc[Metrics reference list].

[#mptel]
[#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[Enable observability 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].

[#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.
For more information about adding these metrics to your applications, see xref:microservice-observability-metrics.adoc#add[Adding metrics to your applications] and the link:/guides/microprofile-metrics.html[Providing metrics from a microservice] guide. For a list of all REST endpoint-style metrics that are available for Open Liberty, see the xref:metrics-list.adoc[Metrics reference list].

The MicroProfile Metrics feature provides a `/metrics` REST interface that conforms to the MicroProfile Metrics specification. You can access MicroProfile Metrics with Open Liberty by feature:mpMetrics[display=enabling the MicroProfile Metrics feature]. Real-time values of all metrics are available by calling the `/metrics` endpoint, which provides formatted metric data that can be consumed as time-series data by external monitoring tools.

When an application is running, you can view metric data from any browser by accessing the `/metrics` endpoint, for example, `\https://localhost:9443/metrics`, where `9443` is the port number for your application.
Expand All @@ -39,7 +40,7 @@ The format that each response uses depends on the HTTP accept header of the corr
Prometheus format is returned for requests with a `text/plain` accept header.
In MicroProfile metrics 4.0 and earlier, JSON format is returned for requests with an `application/json` accept header.

Metrics endpoints differ in syntax and output between MicroProfile Metrics 5.0 and MicroProfile Metrics 4.0 and earlier. MicroProfile Metrics 5.0 also xref:micrometer-metrics.adoc[uses embedded Micrometer metrics technology] to enable third-party monitoring systems. For more information, see xref:reference:diff/mp-50-60-diff.adoc#metrics[Differences between MicroProfile Metrics 5.0 and 4.0]
Metrics endpoints differ in syntax and output between MicroProfile Metrics 5.0 and MicroProfile Metrics 4.0 and earlier. MicroProfile Metrics 5.0 also xref:micrometer-metrics.adoc[uses embedded Micrometer metrics technology] to enable third-party monitoring systems. For more information, see xref:reference:diff/mp-50-60-diff.adoc#metrics[Differences between MicroProfile Metrics 5.0 and 4.0].

=== Metrics endpoints in MicroProfile Metrics 5.0

Expand Down
2 changes: 1 addition & 1 deletion modules/ROOT/pages/mptel-log-events-list.adoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2018 IBM Corporation and others.
// Copyright (c) 2024 IBM Corporation and others.
// Licensed under Creative Commons Attribution-NoDerivatives
// 4.0 International (CC BY-ND 4.0)
// https://creativecommons.org/licenses/by-nd/4.0/
Expand Down
19 changes: 19 additions & 0 deletions modules/ROOT/pages/mptelemetry-logging.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Copyright (c) 2024 IBM Corporation and others.
// Licensed under Creative Commons Attribution-NoDerivatives
// 4.0 International (CC BY-ND 4.0)
// https://creativecommons.org/licenses/by-nd/4.0/
//
// Contributors:
// IBM Corporation
//
:page-layout: general-reference
:page-type: general
:seo-title: Write logs with MicroProfile Telemetry logging- OpenLiberty.io
:seo-description: The MicroProfile Telemetry logging events that can be captured from the Open Liberty server runtime environment and applications.
= Write logs with MicroProfile Telemetry logging

You can use MicroProfile Telemetry to mange your logs, along with traces and metrics. When you enable the MicroProfile Telemetry 2.0 or later and the OpenTelemetry SDK, MicroProfile Telemetry automatically collects any logs that are sent to the `java.util.logging` API.

Any messages that are logged at a `java.util.logging.Level` log level of `INFO` and above are considered messages. Levels below `INFO` are considered trace. By default, MicroProfile Telemetry automatically collects messages, but you can configure the sources that it collects from in your `server.xml` file. For more information, see link:/docs/latest/reference/feature/mpTelemetry-2.0.html#_collect_logs_from_a_specified_source[Collect logs from a specified source].

For more information about configuring MicroProfile Telemetry to collect and emit logs, metrics, and trace, see xref:microprofile-telemetry.adoc[Enable observability with MicroProfile Telemetry].
11 changes: 5 additions & 6 deletions modules/ROOT/pages/mptelemetry-metrics-list.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ To enable only the monitoring components that are used by MicroProfile Telemetry

[source,xml]
----
<monitor filter="ConnectionPool,ThreadPool,RequestTiming,Session,WebContainer,REST,GrpcClient,GrpcServer"/>
<monitor filter="ConnectionPool,ThreadPool,RequestTiming,Session,HTTP"/>
----

To disable all vendor metrics, but to keep the `REST` base metrics configure the `server.xml`, as shown in the following example:
To disable all vendor metrics but keep the `Session` base metrics, add the following code to your `server.xml` file:

[source,xml]
----
<monitor filter="REST"/>
<monitor filter="Session"/>
----

To disable all monitoring components, add the following code to your `server.xml` file:
Expand All @@ -62,10 +62,9 @@ To disable all monitoring components, add the following code to your `server.xml

== MicroProfile Telemetry 2.0 and later metrics reference

When the MicroProfile Telemetry feature 2.0 and later is enabled, Open Liberty can sends metric data to compatible OpenTelemetry protocol (OTLP) receivers. For more information, see xref:microprofile-telemetry[Enable observability with MicroProfile Telemetry].
When the MicroProfile Telemetry feature 2.0 and later is enabled, Open Liberty can send metric data to compatible OpenTelemetry protocol (OTLP) receivers. For more information, see xref:microprofile-telemetry[Enable observability with MicroProfile Telemetry].

In the table, the Prometheus metric names are listed after each metric.
The tables also list the metric types, metric units, and descriptions of all metrics that are available for Open Liberty. For the vendor metrics, the associated monitoring component that you can use to filter the metric is also included.
The table lists the metric types, descriptions and attributes that are available for Open Liberty. Where applicable, the associated monitoring component that you can use to filter the metric is also included.
The **Features required** column of the table includes the feature or features that must be enabled to obtain that metric data.
The **Version introduced** column specifies the minimum version of the feature that you must enable to collect the metric.

Expand Down

0 comments on commit c4fae5b

Please sign in to comment.