diff --git a/modules/ROOT/pages/introduction-monitoring-metrics.adoc b/modules/ROOT/pages/introduction-monitoring-metrics.adoc index 7b69c970d..cd61c8b0c 100644 --- a/modules/ROOT/pages/introduction-monitoring-metrics.adoc +++ b/modules/ROOT/pages/introduction-monitoring-metrics.adoc @@ -22,14 +22,18 @@ Open Liberty uses MicroProfile Metrics to expose metrics that describe the inter 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] +== 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]. + [#endpoint] == MicroProfile Metrics and the metrics endpoint -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. +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. You can narrow the scope of the metrics by using the `scope` query parameter with the `/metrics` endpoint to specify the metric registry scope. For example, to view the metric data for the `base` metric registry, use the `/metrics?scope=base` endpoint. This pattern is used to access all runtime-provided scopes (`base`, `application`, and `vendor`) and any xref:microservice-observability-metrics.adoc#customscope[user-defined metric registry scopes]. For MicroProfile Metrics 4.0 and earlier, only runtime-provided scopes are available and path parameters are used to narrow down metric data. The endpoints are `/metrics/base`, `/metrics/application`, and `/metrics/vendor`. -By default, MicroProfile Metrics provides metrics data in Prometheus format. Prometheus format is a representation of the metrics that is compatible with the https://prometheus.io/[Prometheus monitoring tool], which is an open source metrics scraper, data store, and basic visualization tool. In MicroProfile metrics 4.0 and earlier, JSON format is also available. +By default, MicroProfile Metrics provides metrics data in Prometheus format. Prometheus format is a representation of the metrics that is compatible with the https://prometheus.io/[Prometheus monitoring tool], which is an open source metrics scraper, data store, and basic visualization tool. In MicroProfile metrics 4.0 and earlier, JSON format is also available. The format that each response uses depends on the HTTP accept header of the corresponding request. Prometheus format is returned for requests with a `text/plain` accept header. @@ -37,9 +41,9 @@ In MicroProfile metrics 4.0 and earlier, JSON format is returned for requests wi 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 +=== Metrics endpoints in MicroProfile Metrics 5.0 -MicroProfile Metrics 5.0 does not support JSON-formatted output. Furthermore, syntax for the endpoints URLs uses query string parameters for the scope and metric name values. +MicroProfile Metrics 5.0 does not support JSON-formatted output. Furthermore, syntax for the endpoints URLs uses query string parameters for the scope and metric name values. The following table displays the different endpoints that can be accessed with a `GET` request in MicroProfile Metrics 5.0 to provide metrics in Prometheus format. @@ -64,7 +68,7 @@ The following table displays the different endpoints that can be accessed with a |Returns metrics that match the metric name for the specified scope. |=== -=== Metrics endpoints in MicroProfile Metrics 4.0 and earlier +=== Metrics endpoints in MicroProfile Metrics 4.0 and earlier The following table displays the different endpoints that can be accessed with a GET request in MicroProfile Metrics 4.0 and earlier to provide metrics in Prometheus or JSON format. diff --git a/modules/ROOT/pages/log-management.adoc b/modules/ROOT/pages/log-management.adoc index e1ed71d56..5f5de87e4 100644 --- a/modules/ROOT/pages/log-management.adoc +++ b/modules/ROOT/pages/log-management.adoc @@ -14,6 +14,8 @@ Logs are a record of events that occur during the operation of your servers. You can use logs to diagnose problems and understand the behavior of applications. +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]. + Open Liberty servers and applications produce various logs that can be used for different forms of analysis. These logs include the message logs, trace logs, first failure data capture (FFDC) logs, xref:audit-logs.adoc[audit logs], and access logs: .Descriptions of logs @@ -27,7 +29,7 @@ Open Liberty servers and applications produce various logs that can be used for |Access logs |Record every HTTP request that is made to the server. These logs are useful for traffic analysis. |=== -For more information, see xref:json-log-events-list.adoc[JSON log events reference list]. +For more information, see xref:json-log-events-list.adoc[JSON log events reference list] and xref:mptel-log-events-list.adoc#[MicroProfile Telemetry log events reference list]. You can aggregate logs from all servers with log analysis tools so that the logs can be easily searched and analyzed. When logs are aggregated, you can use log analysis tools to determine which events occur in proximity to each other, which servers encounter the same problems, and when problems first occur. diff --git a/modules/ROOT/pages/log-trace-configuration.adoc b/modules/ROOT/pages/log-trace-configuration.adoc index ea98bed52..c85e21d9e 100644 --- a/modules/ROOT/pages/log-trace-configuration.adoc +++ b/modules/ROOT/pages/log-trace-configuration.adoc @@ -33,6 +33,7 @@ You can use the `user.timezone` JVM property to set the time zone for your appli The following sections provide more information about configuring your Open Liberty logs: +* <<#mptel,Logging with MicroProfile Telemetry>> * <<#configuaration,Logging configuration>> * <<#storage,Log file storage management>> * <<#log_formats,Log formats>> @@ -46,6 +47,11 @@ The following sections provide more information about configuring your Open Libe * <<#settings,Configuration settings by source>> * <<#log_details,Trace log detail levels>> +[#mptel] +== Logging 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]. + [#configuaration] == Logging configuration The logging component can be controlled through the server configuration. The logging component can be fully configured in your `server.xml` file by the `logging` element. However, logging is initialized before the `server.xml` file is processed so configuring logging through the `server.xml` file can result in early log entries that use a different log configuration from later ones. To avoid this problem, you can provide much of the logging configuration in the `boostrap.properties` file and in some cases by using environment variables. Avoid specifying different values for the same configuration property in both the bootstrap.properties and the server.xml file. For more information about logging configuration settings, see the <<#settings,Configuration settings by source>> table. diff --git a/modules/ROOT/pages/microprofile-telemetry.adoc b/modules/ROOT/pages/microprofile-telemetry.adoc index b36d59aaa..3225b6add 100644 --- a/modules/ROOT/pages/microprofile-telemetry.adoc +++ b/modules/ROOT/pages/microprofile-telemetry.adoc @@ -184,9 +184,6 @@ In this example, `Meter` is used to define an instrument, in this case a Counter 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. - - - [#trouble] == Troubleshooting MicroProfile Telemetry The following information can help you determine the cause of common problems and error messages.