-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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 logging of the long GraphQL queries for future debug #1250
Conversation
I left a TODO on the actual logging because I wasn't sure if there was more details we wanted to include. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, will wait for removal of todo
to approve
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice if you tried to test it locally and put a screenshot with the output=)
You can start a node in debug mode and put a breakpoint somewhere in the endpoint to simulate long query=)
It might be good to log this all in one line. Otherwise if there are a lot of concurrent requests the logs linking the query args could be out of order. |
Need to rename |
Readable looks nice and definitely is simpler to find in the terminal, but for elastic search, I think it is better to compact=) |
469a437
to
8b6e9fe
Compare
@@ -161,6 +162,7 @@ pub fn new_service( | |||
txpool: TxPool, | |||
producer: BlockProducer, | |||
consensus_module: ConsensusModule, | |||
log_threshold_ms: Duration, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
log_threshold_ms: Duration, | |
_log_threshold_ms: Duration, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this syntax for vars that are unused? I'm missing why I'd change it here.
@@ -173,7 +175,7 @@ pub fn new_service( | |||
let builder = builder.extension(async_graphql::extensions::Tracing); | |||
|
|||
#[cfg(feature = "metrics")] | |||
let builder = builder.extension(PrometheusExtension {}); | |||
let builder = builder.extension(MetricsExtension::new(log_threshold_ms)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let builder = builder.extension(MetricsExtension::new(log_threshold_ms)); | |
let builder = builder.extension(MetricsExtension::new(_log_threshold_ms)); |
## Release v0.20.0 The release brings a couple of new breaking changes from the [`fuel-vm 0.35.0`](https://github.com/FuelLabs/fuel-vm/releases/tag/v0.35.0) with bugfixes. Check the description of the VM release for more details. The `fuel-core` release mostly improved the internal codebase but also brought some breaking changes: - Removed `Trigger::Hybrid` PoA block trigger mode. Only `Trigger::Instante` and `Trigger::Interval` are available for block production now. The main mode for testnets and mainnet will be `Interval`. - Removed support for `OpaqueReceipt` and the `Receipt` type doesn't have the `raw_payload` field anymore. - A `Receipt` type got two new variants: `Mint` and `Burn`. The corresponding opcodes emit these new events. - The `AssetId` is derived from `ContractId` and additional nonce. So the `ContractId` and `AssetId` can't be the same anymore. ## What's Changed * bump rocksdb to enable compiling with GCC 13 by @segfault-magnet in #1219 * setting peer reputation params by @leviathanbeak in #1202 * Take into account the actually used gas by the transactions and fetch more transaction by @xgreenx in #1223 * Use production configuration for `fuel-core` during benches by @xgreenx in #1227 * Speedup and stabilize unit and integration tests by @xgreenx in #1231 * test: State benchmarks by @bvrooman in #1226 * Remove hybrid PoA block trigger mode by @Dentosal in #1232 * test: Benchmark contract state insertions with DB vs. DB transactions by @bvrooman in #1230 * multiplatform docker builds by @Voxelot in #1233 * Fix typo in architecture.md by @eltociear in #1241 * Expose gas cost in chain info by @MitchTurner in #1244 * Reuse calculated tx id in executor by @MitchTurner in #1248 * Fix multi-platform images by @Voxelot in #1251 * Add logging of the long GraphQL queries for future debug by @MitchTurner in #1250 * Reused `CheckedTransaction` from transaction pool in the executor by @xgreenx in #1249 * Bump `fuel-vm` to `0.35.0` version by @xgreenx in #1256 ## New Contributors * @segfault-magnet made their first contribution in #1219 * @eltociear made their first contribution in #1241 * @MitchTurner made their first contribution in #1244 **Full Changelog**: v0.19.1...v0.20.0
## Release v0.20.0 The release brings a couple of new breaking changes from the [`fuel-vm 0.35.0`](https://github.com/FuelLabs/fuel-vm/releases/tag/v0.35.0) with bugfixes. Check the description of the VM release for more details. The `fuel-core` release mostly improved the internal codebase but also brought some breaking changes: - Removed `Trigger::Hybrid` PoA block trigger mode. Only `Trigger::Instante` and `Trigger::Interval` are available for block production now. The main mode for testnets and mainnet will be `Interval`. - Removed support for `OpaqueReceipt` and the `Receipt` type doesn't have the `raw_payload` field anymore. - A `Receipt` type got two new variants: `Mint` and `Burn`. The corresponding opcodes emit these new events. - The `AssetId` is derived from `ContractId` and additional nonce. So the `ContractId` and `AssetId` can't be the same anymore. ## What's Changed * bump rocksdb to enable compiling with GCC 13 by @segfault-magnet in FuelLabs/fuel-core#1219 * setting peer reputation params by @leviathanbeak in FuelLabs/fuel-core#1202 * Take into account the actually used gas by the transactions and fetch more transaction by @xgreenx in FuelLabs/fuel-core#1223 * Use production configuration for `fuel-core` during benches by @xgreenx in FuelLabs/fuel-core#1227 * Speedup and stabilize unit and integration tests by @xgreenx in FuelLabs/fuel-core#1231 * test: State benchmarks by @bvrooman in FuelLabs/fuel-core#1226 * Remove hybrid PoA block trigger mode by @Dentosal in FuelLabs/fuel-core#1232 * test: Benchmark contract state insertions with DB vs. DB transactions by @bvrooman in FuelLabs/fuel-core#1230 * multiplatform docker builds by @Voxelot in FuelLabs/fuel-core#1233 * Fix typo in architecture.md by @eltociear in FuelLabs/fuel-core#1241 * Expose gas cost in chain info by @MitchTurner in FuelLabs/fuel-core#1244 * Reuse calculated tx id in executor by @MitchTurner in FuelLabs/fuel-core#1248 * Fix multi-platform images by @Voxelot in FuelLabs/fuel-core#1251 * Add logging of the long GraphQL queries for future debug by @MitchTurner in FuelLabs/fuel-core#1250 * Reused `CheckedTransaction` from transaction pool in the executor by @xgreenx in FuelLabs/fuel-core#1249 * Bump `fuel-vm` to `0.35.0` version by @xgreenx in FuelLabs/fuel-core#1256 ## New Contributors * @segfault-magnet made their first contribution in FuelLabs/fuel-core#1219 * @eltociear made their first contribution in FuelLabs/fuel-core#1241 * @MitchTurner made their first contribution in FuelLabs/fuel-core#1244 **Full Changelog**: FuelLabs/fuel-core@v0.19.1...v0.20.0
#1186
This PR:
new_service
to customize thelog_threshold_ms
for how long a query must take for it to get logged