-
Notifications
You must be signed in to change notification settings - Fork 592
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
Provide a way to send Liberty logs to OpenTelemetry #27711
Comments
Design [DRAFT] :*** Subject to change *** High Level User Story: OpenTelemetry defines a Logs Bridge API for emitting LogRecords. OpenTelemetry provides a Logs Bridge API and SDK, which can be used together with existing logging libraries to automatically inject the trace context in the emitted logs, and provide an easy way to send the logs via OTLP. Instead of modifying each logging statement, log appenders use the API to bridge logs from existing logging libraries to the OpenTelemetry data model, where the SDK controls how the logs are processed and exported. The typical log SDK configuration installs a log record processor and exporter. The LogRecordProcessor from the Logs SDK allows us to process and decorate the LogRecord fields to map to OTel Log Data Model.
BatchLogRecordProcessor and SimpleLogRecordProcessor are paired with LogRecordExporter, which is responsible for sending telemetry data to a particular backend. Feature Design:In Open Liberty, Open Telemetry is initialized using the SDK autoconfiguration extension, instead of manually creating the OpenTelemetry instance by using the SDK builders directly in the code. This approach allows you to autoconfigure the OpenTelemetry SDK based on a standard set of supported environment variables and system properties. Hence, the logging providers can be configured using environment variables. Since, the mpTelemetry-2.0 OpenTelemetry instance is dependent on application thread context, it will be difficult to get the instance, when we are not apart of the application thread context, such as during server start up. Hence, we need to explicitly create a new server-level Open Telemetry instance, which would have its own server-specific OTel configuration. This will also work for the multi-app scenarios as well.
There will be server-level resource attributes configured for the server-level OpenTelemetry instance, as well. By default, the SimpleLogRecordProcessor will be enabled, where the records will be send immediately. However, if you want to send the records in batches, you can also configure the following logging specific Batch LogRecord Processor Environment variables to configure how often and how to export the logs over, and as well as log record limits for attributes.
Mapping Open Liberty Log Record to Open Telemetry Logs Data Model
Log Level Mapping to Open Telemetry Severity Text
|
High-level Implementation Design Details [DRAFT] :*** Subject to change ***
Below is a generic high-level code snippet on how to retrieve the OpenTelemetry LogProvider/builder, and to map generic JUL Log Record fields to Open Telemetry Log Data Model, and then to export it to the configured exporter. Snippet is from the Open Telemetry JUL Java agent instrumentation :
Note: OpenTelemetry have implemented Log Appenders Log4J and Logback. |
Hello.
This should work fine but there is one hidden gotcha to be aware off. In OpenTelemetryInfoFactory we have a check when an OpenTelemetryInfo is created |
Thanks @benjamin-confino ! Good point, will make sure that doesn't break for us. Right, |
Slack with Prashanth, David, Ram, me. Prashanth provided the necessary info in the following doc issue: OpenLiberty/docs#7459. I approved the feature. |
@pgunapal: WASWIN is good with the STE slides. STE approved. |
OL: Serviceability Approval Comment - Please answer the following questions for serviceability approval:
|
@clarkek123 will be handling the serviceability approval for this epic. |
Thanks for completing the FTS. The results of the mini-SOE look good so adding the FAT Focal approval. |
@clarkek123 I have filled out the template below, can you please review the Serviceability approval for this feature? Serviceability Approval Comment - Please answer the following questions for serviceability approval: UFO -- does the UFO identify the most likely problems customers will see and identify how the feature will enable them to diagnose and solve those problems without resorting to raising a PMR? Have these issues been addressed in the implementation? A: Yes. For the logging component of the
Test and Demo -- As part of the serviceability process we're asking feature teams to test and analyze common problem paths for serviceability and demo those problem paths to someone not involved in the development of the feature (eg. IBM Support, test team, or another development team). A: SVT -- SVT team is often the first team to try new features and often encounters problems setting up and using them. Note that we're not expecting SVT to do full serviceability testing -- just to sign-off on the serviceability of the problem paths they encountered. A: Which IBM Support / SME queues will handle PMRs for this feature? Ensure they are present in the contact reference file and in the queue contact summary, and that the respective IBM Support/SME teams know they are supporting it. Ask Don Bourne if you need links or more info. A: Does this feature add any new metrics or emit any new JSON events? If yes, have you updated the JMX metrics reference list / Metrics reference list / JSON log events reference list in the Open Liberty docs? A: |
Based on the information provided above for Serviceability showing common error paths testing with demo with approval from Local, SVT and Perfomance teams and SVT signoff on the paths included for serviceability, I have added the Serviceability approval for this feature. |
Closing, as this feature is complete, and delivered for 24.0.0.9. |
Description
We need a way for users to be able to direct their Liberty logs to OpenTelemetry.
Documents
When available, add links to required feature documents. Use "N/A" to mark particular documents which are not required by the feature.
Aha idea
Requested feature
Process Overview
General Instructions
The process steps occur roughly in the order as presented. Process steps occasionally overlap.
Each process step has a number of tasks which must be completed or must be marked as not applicable ("N/A").
Unless otherwise indicated, the tasks are the responsibility of the feature owner or a delegate of the feature owner.
If you need assistance, reach out to the OpenLiberty/release-architect.
Important: Labels are used to trigger particular steps and must be added as indicated.
Prioritization (Complete Before Development Starts)
The OpenLiberty/chief-architect and area leads are responsible for prioritizing the features and determining which features are being actively worked on.
Prioritization
Prioritization - Requested
Prioritization - Requested
label removed (OpenLiberty/project-manager or feature owner)Design (Complete Before Development Starts)
Design preliminaries determine whether a formal design, which will be provided by an Upcoming Feature Overview (UFO) document, must be created and reviewed. A formal design is required if the feature requires any of the following: UI, Serviceability, SVT, Performance testing, or non-trivial documentation/ID. Furthermore, each identified item places a blocking requirement on another team so it must be identified early in the process. The feature owner may check-off the item if they know it doesn't apply, but otherwise they should work with the focal point to determine what work, if any, will be necessary and make them aware of it.
Design Preliminaries
ID Required
, if non-trivial documentation needs to be created by the ID team.ID Required - Trivial
, if no design will be performed and only trivial ID updates are needed.Design
Design Review Request
Design Approval Request
Design Approved
No Design
No Design Approval Request
No Design Approved
Product Management Approval Request
and notifies OpenLiberty/product-managementProduct Management Approved
(OpenLiberty/product-management)FAT Documentation
Implementation
A feature must be prioritized before any implementation work may begin to be delivered (inaccessible/no-ship). However, a design focused approach should still be applied to features, and developers should think about the feature design prior to writing and delivering any code.
Besides being prioritized, a feature must also be socialized (or No Design Approved) before any beta code may be delivered. All new Liberty content must be inaccessible in our GA releases until it is Feature Complete by either marking it
kind=noship
or beta fencing it.Code may not GA until this feature has obtained the
Design Approved
orNo Design Approved
label, along with all other tasks outlined in the GA section.Feature Development Begins
In Progress
labelLegal and Translation
In order to avoid last minute blockers and significant disruptions to the feature, the legal items need to be done as early in the feature process as possible, either in design or as early into the development as possible. Similarly, translation is to be done concurrently with development. All items below MUST be completed before beta & GA is requested.
Innovation (Complete 1 week before Beta & GA Feature Complete Date)
Legal (Complete before Beta & GA Feature Complete Date)
Translation (Complete by Beta & GA Feature Complete Date)
Beta
In order to facilitate early feedback from users, all new features and functionality should first be released as part of a beta release.
Beta Code
kind=beta
,ibm:beta
,ProductInfo.getBetaEdition()
target:beta
and the appropriatetarget:YY00X-beta
(where YY00X is the targeted beta version).release:YY00X-beta
(where YY00X is the first beta version that included the functionality).Beta Blog (Complete by beta eGA)
GA
A feature is ready to GA after it is Feature Complete and has obtained all necessary Focal Point Approvals.
Feature Complete
Translation - Complete
orTranslation - Missing
labelrelease
branch, feature owner adds labelTranslation - Complete
.Translation - Missing
.Translation - Missing
label is replaced withTranslation - Complete
.Translation - Blocked
label.Translation - Blocked
may NOT proceed to GA until the label has been replaced with eitherTranslation - Missing
orTranslation - Complete
.target:ga
and the appropriatetarget:YY00X
(where YY00X is the targeted GA version).Focal Point Approvals (Complete by Feature Complete Date)
These occur only after GA of this feature is requested (by adding a
target:ga
label). GA of this feature may not occur until all approvals are obtained.All Features
focalApproved:externals
@OpenLiberty/demo-approvers Demo scheduled for EOI [Iteration Number]
to this issue.focalApproved:demo
.focalApproved:fat
.Design Approved Features
focalApproved:id
.focalApproved:instantOn
.focalApproved:performance
.focalApproved:sve
.focalApproved:ste
.focalApproved:svt
.Remove Beta Fencing (Complete by Feature Complete Date)
GA Blog (Complete by Friday after GM)
Post GM (Complete before GA)
Post GA
target:ga
andtarget:YY00X
labels, and add the appropriaterelease:YY00X
. (OpenLiberty/release-manager)Other Deliverables
The text was updated successfully, but these errors were encountered: