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

Add tracing support #41

Open
jetuk opened this issue Sep 1, 2023 · 2 comments
Open

Add tracing support #41

jetuk opened this issue Sep 1, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@jetuk
Copy link
Member

jetuk commented Sep 1, 2023

Using the tracing crate would be a good way to add some effective debugging & logging support to Pywr. I think it'll be more powerful than simple logging. E.g. we can trace each Parameter calculation for debugging purposes.

https://github.com/tokio-rs/tracing

I am not sure how well this would integrate with Python's logging system.

@jetuk jetuk added the enhancement New feature or request label Sep 1, 2023
@jetuk
Copy link
Member Author

jetuk commented Sep 20, 2023

Swapped out log for tracing in #48. Now instrumentation needs to be added.

All parameter calculations could be instrumented at the "trace" level for low-level debugging. Each time-step at the "debug" level. These will be helpful if they can include the model's state in the span, but that might be a lot of data to include.

@jetuk
Copy link
Member Author

jetuk commented Sep 25, 2023

#52 added a subscriber to the Rust and Python CLI. Long-term I think this will need to be slightly refactored:

jetuk added a commit that referenced this issue Feb 18, 2024
Move the setup_tracing function to the CLI crate. Addresses
part of isssue #41.
jetuk added a commit that referenced this issue Feb 19, 2024
Move the setup_tracing function to the CLI crate. Addresses
part of isssue #41.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant