Skip to content

[18.0][IMP] rest_log: add profiling - #589

Open
grindtildeath wants to merge 8 commits into
OCA:18.0from
camptocamp:18.0-imp-server_logs_and_profiling
Open

[18.0][IMP] rest_log: add profiling#589
grindtildeath wants to merge 8 commits into
OCA:18.0from
camptocamp:18.0-imp-server_logs_and_profiling

Conversation

@grindtildeath

@grindtildeath grindtildeath commented Feb 10, 2026

Copy link
Copy Markdown
Contributor

[REF] rest_log: Add hooks to read configuration from system params

This allows to use the same syntax than the existing one from
rest.log.active to define other config parameters.

[IMP] rest_log: Allow to profile requests through rest services

Leverage ir.profile machinery to track what happens when a user
calls some rest services.

Since profiling can be done only for a single user at a time the
system parameter rest.log.profiling.uid has to be defined with
the ID from res.users whose calls need to be profiled.

Moreover, system parameter rest.log.profiling.conf can be defined
using the syntax from rest.log.active to fine tune which requests
will trigger the profiling for the user defined by the previous
parameter.

To note, once a request is identified to start the profiling, all
incoming requests from the user will be profiled until the timeout
duration defined by rest.log.profiling.duration is reached.

@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hi @simahawk,
some modules you are maintaining are being modified, check this out!

@simahawk simahawk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

early review, to be tested.

Comment thread rest_log/components/service.py Outdated
Comment thread rest_log/components/service.py Outdated
Comment thread rest_log/components/service.py Outdated
@simahawk

simahawk commented Feb 11, 2026

Copy link
Copy Markdown
Contributor

I've reworked it and simplified a bit. How it works:

  1. set rest.log.profiling.uid to enable the given user id(s) (CSV list of ids)
  2. set rest.log.profiling.conf to enable the conf for a specific app/collection (eg: shopfloor.app)

base.profiling_enabled_until is needed only to view the speedscope.

UPDATED: 12/02

Comment thread rest_log/components/service.py
@mmequignon
mmequignon force-pushed the 18.0-imp-server_logs_and_profiling branch from 66f3662 to 524d239 Compare February 11, 2026 10:28
@simahawk
simahawk force-pushed the 18.0-imp-server_logs_and_profiling branch from 524d239 to 582e759 Compare February 12, 2026 12:38
@simahawk simahawk changed the title [18.0][IMP] server logs and profiling [18.0][IMP] rest_log: add profiling Feb 12, 2026
Comment thread rest_log/components/service.py Outdated
@simahawk
simahawk force-pushed the 18.0-imp-server_logs_and_profiling branch from 179fdd3 to c3258c6 Compare May 5, 2026 14:47
@simahawk
simahawk marked this pull request as ready for review May 5, 2026 14:47
@simahawk

simahawk commented May 5, 2026

Copy link
Copy Markdown
Contributor

using it live since a while: works fine :)

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions Bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Sep 6, 2026

@simahawk simahawk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Live on prod since months 🟢

@simahawk simahawk removed the stale PR/Issue without recent activity, it'll be soon closed automatically. label Sep 7, 2026
@simahawk

simahawk commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

/ocabot merge nobump

@OCA-git-bot

Copy link
Copy Markdown
Contributor

On my way to merge this fine PR!
Prepared branch 18.0-ocabot-merge-pr-589-by-simahawk-bump-nobump, awaiting test results.

@OCA-git-bot

Copy link
Copy Markdown
Contributor

@simahawk your merge command was aborted due to failed check(s), which you can inspect on this commit of 18.0-ocabot-merge-pr-589-by-simahawk-bump-nobump.

After fixing the problem, you can re-issue a merge command. Please refrain from merging manually as it will most probably make the target branch red.

@simahawk

simahawk commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Unrelated build issue #637

grindtildeath and others added 6 commits September 8, 2026 09:45
This allows to use the same syntax than the existing one from
rest.log.active to define other config parameters.
Leverage ir.profile machinery to track what happens when a user
calls some rest services.

Since profiling can be done only for a single user at a time the
system parameter rest.log.profiling.uid has to be defined with
the ID from res.users whose calls need to be profiled.

Moreover, system parameter rest.log.profiling.conf can be defined
using the syntax from rest.log.active to fine tune which requests
will trigger the profiling for the user defined by the previous
parameter.

To note, once a request is identified to start the profiling, all
incoming requests from the user will be profiled until the timeout
duration defined by rest.log.profiling.duration is reached.
Gives better control on how to profile.
@simahawk
simahawk force-pushed the 18.0-imp-server_logs_and_profiling branch from c3258c6 to d17e2ae Compare September 8, 2026 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants