-
Notifications
You must be signed in to change notification settings - Fork 8.5k
feat: workflow logs with console output support #229937
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
Conversation
- Created full WorkflowEventLoggerService with ES search capabilities - Restored getExecutionLogs and getStepLogs with actual ES queries - Fixed workflows management service to use proper logger service - Maintained console logging functionality while adding back log search
- Remove imports from workflows_management to workflows_execution_engine - Implement direct ES log search in management service - Keep simple console logging without complex service layer - Clean plugin separation with no circular dependencies
- Fix data structure access: log['@timestamp'] instead of log.source['@timestamp'] - Add defensive filtering to remove undefined/null log entries - Improve error handling in both service and API layers - Handle ES responses that may have missing _source data
…argl/kibana into feature/workflow-logs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the workflow logging system to introduce console output support and simplify the logging architecture. The changes migrate from a complex WorkflowEventLoggerService to a simpler SimpleWorkflowLogger with optional console logging, while adding new methods for searching workflow execution logs directly.
- Replaces complex WorkflowEventLoggerService with a simplified SimpleWorkflowLogger that supports console output
- Adds direct Elasticsearch query methods for retrieving workflow, execution, and step logs
- Introduces console logging configuration options in both workflow management and execution engine plugins
Reviewed Changes
Copilot reviewed 16 out of 17 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| workflows_management_service.ts | Replaces WorkflowEventLoggerService with SimpleWorkflowLogger and adds direct ES log search methods |
| workflows_management_api.ts | Updates log transformation to handle new log structure and field mappings |
| workflow_logger.ts | New simple logger implementation with console logging support |
| workflow_event_logger_service.ts | Removes complex logging service (deleted file) |
| config.ts | Adds console logging configuration option for both plugins |
| plugin.ts | Integrates console logging configuration into plugin initialization |
| workflow_event_logger_service.ts (execution engine) | Adds comprehensive logging service for execution engine with console support |
| workflow_context_manager.ts | Re-enables workflow logging functionality with console output support |
Comments suppressed due to low confidence (2)
src/platform/plugins/shared/workflows_management/server/workflows_management/workflows_management_service.ts:57
- [nitpick] The parameter name 'enableConsoleLogging' is inconsistent with the config property name 'logging.console'. Consider renaming to 'consoleLogging' or 'enableConsole' to match the configuration structure.
enableConsoleLogging: boolean = false
src/platform/plugins/shared/workflows_management/server/workflows_management/workflows_management_service.ts:80
- The property 'workflowEventLoggerService' name is misleading since it now holds a SimpleWorkflowLogger instance, not a service. Consider renaming to 'workflowLogger' or 'simpleWorkflowLogger'.
this.workflowEventLoggerService = new SimpleWorkflowLogger(this.logger, enableConsoleLogging);
...gins/shared/workflows_management/server/workflows_management/workflows_management_service.ts
Show resolved
Hide resolved
...tform/plugins/shared/workflows_management/server/workflows_management/lib/workflow_logger.ts
Show resolved
Hide resolved
.../plugins/shared/workflows_management/server/workflows_management/workflows_management_api.ts
Show resolved
Hide resolved
| typeof response.hits.total === 'number' | ||
| ? response.hits.total | ||
| : response.hits.total?.value || 0, | ||
| logs: response.hits.hits.map((hit: any) => hit._source), |
Copilot
AI
Jul 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using 'any' type for Elasticsearch hits loses type safety. Consider defining a proper interface for the hit structure or at least the _source field to improve type safety.
| logs: response.hits.hits.map((hit: any) => hit._source), | |
| logs: response.hits.hits.map((hit) => (hit._source as WorkflowLogSource)), |
...flows_execution_engine/server/workflow_context_manager/workflow_execution_runtime_manager.ts
Show resolved
Hide resolved
💚 Build Succeeded
Metrics [docs]
History
|
## Summary Summarize your PR. If it involves visual changes include a screenshot or gif. ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [ ] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels. ### Identify risks Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss. Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging. - [ ] [See some risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) - [ ] ... --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Summary
Summarize your PR. If it involves visual changes include a screenshot or gif.
Checklist
Check the PR satisfies following conditions.
Reviewers should verify this PR satisfies this list as well.
release_note:breakinglabel should be applied in these situations.release_note:*label is applied per the guidelinesbackport:*labels.Identify risks
Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss.
Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging.