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 optional support for tokio-console #318

Merged
merged 1 commit into from Apr 26, 2024

Conversation

Benjamin-L
Copy link
Contributor

@girlbossceo you may want to copy my tracing branch into your github account to match the other git dependencies. The tracing change that we need is tokio-rs/tracing#2956. I made this PR against the master branch, and don't know how likely it is that it will be backported to the 0.1.x branch by upstream tracing. If not, we might be maintaining the fork for a long time. If we don't want to do this, there are alternative ways to get the LogLevelReloadHandles wrapper to work, but they are ugly.

The refactor of how the reload handle works also enables fixing the current behavior where enabling allow_jaeger or tracing_flame will disable the normal (and sentry) logging, but I'd like to make that change in a separate PR.

@Benjamin-L
Copy link
Contributor Author

Fixed the first CI failure by downgrading the compile error when you try to combine the tokio_console and release_max_log_level features to a runtime log message. This is a bit unfortunate, but IMO being able to make --all-features builds is useful.

The second CI failure is on dev, and is fixed by #319. If that PR is merged, I'll rebase this branch.

@Benjamin-L
Copy link
Contributor Author

Huh... I did not expect CI to pass on this branch. The error that I get locally looks like this:

 security::cargo-audit │O│ Crate:     zeroize
 security::cargo-audit │O│ Version:   1.8.0
 security::cargo-audit │O│ Warning:   yanked
 security::cargo-audit │O│ Dependency tree:
 security::cargo-audit │O│ zeroize 1.8.0
 security::cargo-audit │O│ ├── rustls 0.22.4
 security::cargo-audit │O│ │   ├── ureq 2.9.6
 security::cargo-audit │O│ │   │   └── sentry 0.32.3
 security::cargo-audit │O│ │   │       └── conduit 0.3.0
 security::cargo-audit │O│ │   ├── tokio-rustls 0.25.0
 security::cargo-audit │O│ │   │   ├── reqwest 0.12.4
 security::cargo-audit │O│ │   │   │   ├── sentry 0.32.3
 security::cargo-audit │O│ │   │   │   └── conduit 0.3.0
 security::cargo-audit │O│ │   │   └── hyper-rustls 0.26.0
 security::cargo-audit │O│ │   │       └── reqwest 0.12.4
 security::cargo-audit │O│ │   ├── reqwest 0.12.4
 security::cargo-audit │O│ │   └── hyper-rustls 0.26.0
 security::cargo-audit │O│ ├── ed25519-dalek 2.1.1
 security::cargo-audit │O│ │   └── ruma-signatures 0.14.0
 security::cargo-audit │O│ │       └── ruma 0.9.4
 security::cargo-audit │O│ │           └── conduit 0.3.0
 security::cargo-audit │O│ ├── der 0.7.9
 security::cargo-audit │O│ │   ├── spki 0.7.3
 security::cargo-audit │O│ │   │   └── pkcs8 0.10.2
 security::cargo-audit │O│ │   │       ├── ruma-signatures 0.14.0
 security::cargo-audit │O│ │   │       └── ed25519 2.2.3
 security::cargo-audit │O│ │   │           └── ed25519-dalek 2.1.1
 security::cargo-audit │O│ │   └── pkcs8 0.10.2
 security::cargo-audit │O│ └── curve25519-dalek 4.1.2
 security::cargo-audit │O│     └── ed25519-dalek 2.1.1
 security::cargo-audit │O│
 security::cargo-audit │E│ error: 1 denied warning found!

This turned out to be quite hairy, mostly because we need to apply the
config's log level filter to the actual logs (stdout and, optionally
sentry), but do not want to filter out the tokio tracing events needed by
the console_subscriber. I hit several edge cases in tracing getting
this to work, and we now depend on a git version of tracing with a
backported patch :(
@Benjamin-L
Copy link
Contributor Author

Rebased on current dev which has the zeroize fix.

Copy link
Owner

@girlbossceo girlbossceo left a comment

Choose a reason for hiding this comment

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

If we find ourselves maintaining the tracing fork in a month now, we'll look into alternatives

@girlbossceo girlbossceo merged commit 470de4e into girlbossceo:dev Apr 26, 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.

None yet

2 participants