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

Telemetry: processing upon API request interception needs to happen asynchronously #28531

Closed
dsilvam opened this issue May 10, 2024 · 1 comment

Comments

@dsilvam
Copy link
Contributor

dsilvam commented May 10, 2024

Parent Issue

No response

Problem Statement

When API interception is enabled, the processing is happening in a synchronous way which makes the requests to take longer and may even fail to respond if an underlying error happens.

Steps to Reproduce

Issue: see how the breakpoint gets hit but the page doesn't get rendered until resuming.

Acceptance Criteria

The processing that happens on the interception of the API hits needs to happen asynchronously.

dotCMS Version

Telemetry plugin 24.05.2

Proposed Objective

Core Features

Proposed Priority

Priority 2 - Important

External Links... Slack Conversations, Support Tickets, Figma Designs, etc.

No response

Assumptions & Initiation Needs

No response

Quality Assurance Notes & Workarounds

No response

Sub-Tasks & Estimates

No response

@dsilvam dsilvam changed the title Telemetry: API request interception needs to happen asynchronously Telemetry: processing upon API request interception needs to happen asynchronously May 10, 2024
@freddyDOTCMS freddyDOTCMS self-assigned this May 31, 2024
@freddyDOTCMS
Copy link
Contributor

freddyDOTCMS commented May 31, 2024

No changes are needed because saving the hit to the database is already done asynchronously, as shown here:

https://github.com/dotCMS/com.dotcms.telemetry/blob/f3eb85d3911ae0f4ea7c6a7c072cf8357119ac88/src/main/java/com/dotcms/experience/collectors/api/ApiMetricFactorySubmitter.java#L48

We have some code that does not run on the request thread. This code selects the MetricType for the current request, which should not take much time. Additionally, if any exceptions are thrown in this code, the response will continue normally.

@freddyDOTCMS freddyDOTCMS removed their assignment Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

2 participants