Skip to content

Improve-observability#8762

Open
Joao-vi wants to merge 31 commits intoproductionfrom
improve-observability
Open

Improve-observability#8762
Joao-vi wants to merge 31 commits intoproductionfrom
improve-observability

Conversation

@Joao-vi
Copy link
Collaborator

@Joao-vi Joao-vi commented Jan 28, 2026

fixes #

PR checklist:

  • Update READ.me ?
  • Update API documentation ?

QA checklist:

  • Smoke test the functionality described in the issue
  • Test for side effects
  • UI responsiveness
  • Cross browser testing
  • Code review

Copilot AI review requested due to automatic review settings January 28, 2026 18:59
Copy link
Contributor

Copilot AI left a 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 adds observability infrastructure to improve request tracing and performance monitoring. It introduces a telemetry collection system with middleware and decorators to track request durations and method execution times, along with Babel decorator support.

Changes:

  • Added Babel decorators plugin support to enable TypeScript decorator syntax
  • Implemented telemetry collection infrastructure with TelemetryCollector class and TimedMethod decorator
  • Integrated observability middleware into the request pipeline to track HTTP requests and method execution times
  • Enabled v2CreateEntity feature flag

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
yarn.lock Added dependencies for @babel/plugin-proposal-decorators and related Babel packages
package.json Added @babel/plugin-proposal-decorators dependency
babel.config.json Configured decorators plugin with legacy mode
app/server.js Added observabilityMiddleware to middleware chain
app/api/utils/requestIdMiddleware.ts Refactored to store requestId in a variable before setting in context
app/api/utils/observabilityMiddleware.ts New middleware to initialize telemetry collector and log request metrics
app/api/utils/languageMiddleware.ts Added timing instrumentation for language detection
app/api/utils/AppContext.ts Added methods to get/set TelemetryCollector in context
app/api/entities.v2/database/MongoMultiLanguageEntityDataSource.ts Added @TimedMethod decorator to create method
app/api/core/libs/logger/TimedMethodDecorator.ts New decorator to automatically track method execution time
app/api/core/libs/logger/TelemetryCollector.ts New class to collect and aggregate telemetry data
app/api/core/infrastructure/mongodb/thesauri/MongoThesauriDataSourceV2.ts Added @TimedMethod decorators to create and exists methods
app/api/core/infrastructure/express/thesaurus/UpdateThesaurusController.ts Added @TimedMethod decorator to handle method
app/api/core/infrastructure/express/thesaurus/CreateThesaurusController.ts Added @TimedMethod decorator to handle method
app/api/core/infrastructure/express/template/GetTemplatesController.ts Added @TimedMethod decorator to handle method
app/api/core/infrastructure/express/template/CountTemplatesByThesaurusController.ts Added @TimedMethod decorator to handle method
app/api/core/infrastructure/express/entity/BulkDeleteEntityController.ts Added @TimedMethod decorator to handle method
app/api/core/application/thesaurusTranslationService/ThesaurusTranslationService.ts Added @TimedMethod decorator to create method
app/api/config.ts Enabled v2CreateEntity feature flag
Comments suppressed due to low confidence (1)

app/api/utils/languageMiddleware.ts:37

  • If an exception occurs in the try block before timeEnd is called, the timer will remain in an incomplete state. Consider wrapping the telemetryCollector.timeEnd call in a finally block or adding it to the catch block as well to ensure timers are always ended even when errors occur.
    telemetryCollector.timeEnd('language_middleware');
    next();
  } catch (e) {
    next(e);
  }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 13 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 20 out of 21 changed files in this pull request and generated 9 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants