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

Fix tracing-flame bugs and add some config options #320

Merged
merged 5 commits into from
Apr 27, 2024

Conversation

olivia-fl
Copy link
Contributor

Bugs fixed:

  • enabling tracing-flame would disable normal logging
  • tracing-flame IO buffers were not flushed on exit
  • when tracing-flame was enabled, changing the log level at runtime with the admin interface would modify the tracing-flame filter instead of the log level (which didn't exist because it wasn't logging anything on stdout)

I also added a couple options to make tracing_flame that were necessary to use tracing-flame on our HS.

The refactoring that fixed the first bug (stdout logging being disabled) also fixed a similar bug for jaeger. Even after this fix, jaeger is still not working because we're initializing it outside of the tokio context. If you try to run conduwuit with allow_jaeger = true, it will panic. We discussed removing jaeger support instead of fixing it in the matrix room, but I'm going to save that for a later PR. I might try making a janky patch to get jaeger working and see if it's useful for debugging problems on our HS first.

Previously, enabling the `tracing_flame` or `allow_jaeger` options would
prevent any logs from being written to stdout. In addition, enabling the
`allow_jaeger` option would inhibit the `tracing_flame` option.

Now that we have a way to use separate tracing filters with different
layers, we can enable all three at the same time without issues.

This commit also prevents the `debug log_level` command from modifying
the `tracing-flame` filter. This was supported previously, but I don't
think it's something that you would ever want to do intentionally. Now
that we have both the normal log filter and the `tracing-flame` filter
enabled at the same time, we want to `debug log_level` to only modify the
normal filter.
The previous hardcoded filter `trace,h2=off` isn't appropriate in all
cases, it's better to have this be configurable.
Previously we were dropping the flush guard early, possibly causing
samples to be lost on exit.
Hardcoding the output path to something in CWD is a pain if you're running
conduwuit through systemd or similar. Also made the error message when
it's unable to create the output file a little more friendly.
@girlbossceo girlbossceo merged commit cc77d47 into girlbossceo:dev Apr 27, 2024
5 checks passed
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