Skip to content

Robin pilot logging #550

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

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

Robin-Van-de-Merghel
Copy link
Contributor

Updates to #511 , rebased and linked to #421

@Robin-Van-de-Merghel Robin-Van-de-Merghel marked this pull request as draft May 22, 2025 07:28
@Robin-Van-de-Merghel Robin-Van-de-Merghel force-pushed the robin-pilot-logging branch 2 times, most recently from 5218531 to 9d7e6b1 Compare May 23, 2025 15:00
@Robin-Van-de-Merghel Robin-Van-de-Merghel force-pushed the robin-pilot-logging branch 4 times, most recently from 87ffdf6 to 50e9ff3 Compare May 27, 2025 09:09
@Robin-Van-de-Merghel Robin-Van-de-Merghel marked this pull request as ready for review May 27, 2025 09:09
@Robin-Van-de-Merghel
Copy link
Contributor Author

To review this code, this is a summary of what's new compared to the pilot authentification:

  • diracx-routers/src/diracx/routers/pilots/logging.py: Upload messages
  • diracx-routers/src/diracx/routers/pilot_management/query.py: There's query_logs which helps querying logs with the same idea as job queries
  • diracx-logic/src/diracx/logic/pilots/logging.py: Tools to update and query logs
  • Modified diracx-testing/src/diracx/testing/mock_osdb.py and util.py to test OSDB with new types: date_nanos. Also added support for queries: returned total (for Content-Range).
  • diracx-core/src/diracx/core/models.py: Added logs
  • diracx-db/src/diracx/db/*.py: Added logs and updated debug (when we add logs)

@Robin-Van-de-Merghel Robin-Van-de-Merghel force-pushed the robin-pilot-logging branch 2 times, most recently from da97b8f to 7dc9b17 Compare June 17, 2025 07:15
@martynia
Copy link
Contributor

I'm wondering why you removed the original line number from the send_message when storing a document. You added a timestamp which is useful, but it might be problematic when sorting messages. The messages should be presented in the order they were emitted by a client.

@Robin-Van-de-Merghel
Copy link
Contributor Author

Robin-Van-de-Merghel commented Jun 19, 2025

I'm wondering why you removed the original line number from the send_message when storing a document. You added a timestamp which is useful, but it might be problematic when sorting messages. The messages should be presented in the order they were emitted by a client.

As timestamps are generated from the pilot itself (as logs are printed out), if we sort logs by timestamps, we could add the right numbering without losing space?

Sorting by timestamp would actually give logs in order they were caught by a pilot, which is what we want? If for whatever reason numbering is broken, we could have shuffled logs, whereas with timestamps we are assured order is kept.

@fstagni fstagni mentioned this pull request Jun 20, 2025
@martynia
Copy link
Contributor

To get the numberring it would be sufficient to define a class variable in the extended logger in the pilot and increment it every time a log statement is called.

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