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

add event tables #7474

Merged
merged 1 commit into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
147 changes: 147 additions & 0 deletions modules/ROOT/pages/mptel-log-events-list.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
// Copyright (c) 2018 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: MicroProfile Telemetry logging events - OpenLiberty.io
:seo-description: The MicroProfile Telemetry logging events that can be captured from the Open Liberty server runtime environment and applications.
= MicroProfile Telemetry log events reference list

MicroProfile Telemetry can collect logging events from the server runtime and applications. You can use these events to gather and analyze data that can help to better understand the behavior of applications.

MicroProfile Telemetry can collect the following types of events:

* <<Message events, Message events>>
* <<Trace events, Trace events>>
* <<FFDC events, FFDC events>>

== Message events
The following table provides the fields for message events and a description for each field:

.Message event fields
[options="header"]
|=======================
| Liberty message event fields | Description | Maps to OTel Logs Data Model | OTel Java Agent JUL Mapping
| type | A string that identifies the type of event. | Attributes[`io.openliberty.type`] | N/A
| host | Host name of the server that is the source of the event. | Resource[`host.name`] | Resource[`host.name`]
| message | The message from the log record, starting with the message ID. | Body | body
| ibm_threadId | Thread ID in the log line, for example, 00000015. | Attributes[`thread.id`] | N/A
| ibm_datetime | Time at which the event occurred. | TimeStamp | TimeStamp
| ibm_messageId | Message ID in the log line. | Attributes[`io.openliberty.message_id`] | N/A
| module | Logger name from the log record. | Attributes[`io.openliberty.module`] | N/A
| loglevel | Severity indicator | SeverityText | SeverityText
| ibm_methodName | Method name from the log record. | Attributes[`io.openliberty.method_name`] | N/A
| ibm_className | Class name from the log record. | Attributes[`io.openliberty.class_name`] | N/A
| ibm_sequence | Sequence number of the event,. | Attributes[`io.openliberty.sequence`] | N/A
| ext_thread | Name of the thread that is the source of the event. | Attributes[`thread.name`] | N/A
| ext_appName | Name of the application that logged the message. | Attributes[`io.openliberty.ext.app_name`] | N/A
|=======================

The following example shows the OpenTelemetry Collector output for a message event from an application:

----
timeUnixNano="1717512929163000000"
observeTimeUnixNano="1717512929602000000"
severityNumber="13"
severityText="W"
body=" BADAP0001W: Test Warning."
traceId="a4fa4f34167d2bcbcfb94588d37b332"
spanId="63522117c3492d42"
Attributes:
io.openliberty.type="liberty_message"
io.openliberty.message_id="BADAP0001W"
io.openliberty.sequence="1717512929163_0000000000012
io.openliberty.module="com.ibm.ws.lumberjack.badness.Angry"
thread.id="65"
thread.name="Default Executor-thread-2"
io.openliberty.ext.app_name="badapp"
----

== Trace events
The following table provides the fields for trace events and a description for each field:

.Trace event fields
[options="header"]
|=======================
| Liberty trace event fields | Description | Maps to OTel Logs Data Model | OTel Java Agent JUL Mapping
| type | A string that identifies the type of event. | Attributes[`io.openliberty.type`] | N/A
| host | Host name of the server that is the source of the event. | Resource[`host.name`] | Resource[`host.name`]
| message | The message from the log record, starting with the message ID. | Body | body
| ibm_threadId | Thread ID in the log line, for example, 00000015. | Attributes[`thread.id`] | N/A
| ibm_datetime | Time at which the event occurred. | TimeStamp | TimeStamp
| ibm_messageId | Message ID in the log line. | Attributes[`io.openliberty.message_id`] | N/A
| module | Logger name from the log record. | Attributes[`io.openliberty.module`] | N/A
| loglevel | Severity indicator | SeverityText | SeverityText
| ibm_methodName | Method name from the log record. | Attributes[`io.openliberty.method_name`] | N/A
| ibm_className | Class name from the log record. | Attributes[`io.openliberty.class_name`] | N/A
| ibm_sequence | Sequence number of the event,. | Attributes[`io.openliberty.sequence`] | N/A
| ext_thread | Name of the thread that is the source of the event. | Attributes[`thread.name`] | N/A
| ext_appName | Name of the application that logged the message. | Attributes[`io.openliberty.ext.app_name`] | N/A
|=======================

The following example shows the OpenTelemetry Collector output for a trace event from an application:

----
timeUnixNano="11234512231363000000"
observeTimeUnixNano="17123512929602000000"
severityNumber="1"
severityText="3"
body="finest trace"
traceId="3fced7fbfbc062349c66a8c1a37c31b2"
spanId="4be39c323e375d9e"
Attributes:
io.openliberty.type="liberty_trace"
io.openliberty.sequence="12312363_0000000000021"
io.openliberty.module="com.test.app"
thread.id="79"
thread.name="Default Executor-thread-12"
io.openliberty.ext.app_name="testapp"
----

== FFDC events
The following table provides the fields for the first failure data capture (FFDC) events and a description for each field:

.FFDC event fields
|=======================
| Liberty FFDC event fields | Description | Maps to OTel Logs Data Model
| type | A string that identifies the type of event. | Attributes[`io.openliberty.type`]
| host | Host name of the server that is the source of the event. | Resource[`host.name`]
| ibm_datetime | Time at which the event occurred. | TimeStamp
| message | The message from the exception that triggered the event. | body and Attributes[`exception.message`]
| ibm_className | The class that emitted the FFDC event. | Attributes[`io.openliberty.class_name`]
| ibm_exceptionName | The exception that is reported in the FFDC event. | Attributes[`exception.type`]
| ibm_probeID | The unique identifier of the FFDC point within the class. | Attributes[`io.openliberty.probe_id`]
| ibm_threadId | The thread ID of the FFDC event. | Attributes[`thread.id`]
| ibm_stackTrace | The stack trace of the FFDC event. | Attributes[`exception.stacktrace`]
| ibm_objectDetails | The incident details for the FFDC event. | Attributes[`io.openliberty.object_details`]
| ibm_sequence | Sequence number of the event, which is useful for sorting records with the same timestamp. | Attributes[`io.openliberty.sequence`]
|=======================

The following example shows the OpenTelemetry Collector output for an FFDC event from an application:

----
timeUnixNano=“1232335231363000000”
observeTimeUnixNano=“123455512929602000000”
severityNumber=“13”
body="Cannot invoke "java.lang.String.toString()" because "myString" is null"
traceId=“3fced7fbfbc062349c66a8c1a37c31b2”
spanId=“4be39c323e375d9e”
Attributes:
io.openliberty.type="liberty_ffdc"
exception.message="Cannot invoke "java.lang.String.toString()" because "myString" is null"
exception.stacktrace="java.lang.NullPointerException: Cannot invoke "java.lang.String.toString()" because "myString" is null\n\tat io.openliberty.microprofile.telemetry.logging.internal.container.fat.MpTelemetryLogApp.MpTelemetryServlet.doGet(MpTelemetryServlet.java:53) ..."
exception.type= "java.lang.NullPointerException"
io.openliberty.class_name="io.openliberty.microprofile.telemetry.logging.internal.container.fat.MpTelemetryLogApp"
io.openliberty.object_details="Object type = io.openliberty.microprofile.telemetry.logging.internal.container.fat.MpTelemetryLogApp\n tc = class com.ibm.websphere.ras.TraceComponent@7baa4ff8 ...
io.openliberty.probe_id="62"
io.openliberty.sequence=“1723140654466_00000000000011"
thread.id=“92”
thread.name=“Default Executor-thread-12”
----

// assisted by watsonx latest with latest GenAI contribution: llama-3-70b-instruct
6 changes: 3 additions & 3 deletions modules/reference/pages/feature/mpTelemetry/examples.adoc
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
== Examples

=== Collect logs from a specified source
=== Collect logs from specified 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 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 config:mpTelemetry element with a comma-separated list of log sources.

[source,xml]
----
<mpTelemetry source="message, trace, ffdc"/>
----

* The `mpTelemetry` configuration element is optional. If you do not specify ity or the `source` attribute, the default configuration source is `message`.
* The `mpTelemetry` configuration element is optional. If you do not specify it, or if you do not include the `source` attribute, the default configuration source is `message`.

* If the source attribute is empty (`source=“”`), no sources are collected, and nothing is routed to the configured OpenTelemetry logs exporter.

Expand Down