You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "bonsairobo (via GitHub)" <gi...@apache.org> on 2025/10/03 01:32:13 UTC
[I] new feature: Make `MetricsLayer` WASM compatible [opendal]
bonsairobo opened a new issue, #6619:
URL: https://github.com/apache/opendal/issues/6619
### Feature Description
`MetricsLayer` should not panic when used in WASM.
### Problem and Solution
Currently the `MetricsLayer` panics trying to access the `SystemTime`, which is not available in a browser.
The solution is to use a different API to get the current time when in the browser. See [web-time](https://crates.io/crates/web-time).
### Additional Context
_No response_
### Are you willing to contribute to the development of this feature?
- [x] Yes, I am willing to contribute to the development of this feature.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] new feature: Make `MetricsLayer` WASM compatible [opendal]
Posted by "0lai0 (via GitHub)" <gi...@apache.org>.
0lai0 commented on issue #6619:
URL: https://github.com/apache/opendal/issues/6619#issuecomment-3591656406
@tisonkun @Xuanwo If I want to fix it, I should first write a test and update the metrics crate to use web-time for WASM targets. Does this implementation look correct ? Thank you.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] new feature: Make `MetricsLayer` WASM compatible [opendal]
Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on issue #6619:
URL: https://github.com/apache/opendal/issues/6619#issuecomment-3567349732
After a closer look, I noticed that `SystemTime` is used inside `metrics` rather than from OpenDAL.
Perhaps this is an issue to `metrics`.
cc @Xuanwo @MrCroxx maybe you have more inputs on this point?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] new feature: Make `MetricsLayer` WASM compatible [opendal]
Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on issue #6619:
URL: https://github.com/apache/opendal/issues/6619#issuecomment-3594688366
@Xuanwo I'm considering close this issue with no planning unless `metrics` has any plan to support WASM target. It seems unlikely to happen nearly.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] new feature: Make `MetricsLayer` WASM compatible [opendal]
Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on issue #6619:
URL: https://github.com/apache/opendal/issues/6619#issuecomment-3596222192
See https://github.com/apache/opendal/pull/6852.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] new feature: Make `MetricsLayer` WASM compatible [opendal]
Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on issue #6619:
URL: https://github.com/apache/opendal/issues/6619#issuecomment-3596132553
I tried:
```
cargo build --target wasm32-unknown-unknown --no-default-features --features="layers-metrics" --locked
```
and it seems compiled. Perhaps you can try it with the latest OpenDAL version?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] new feature: Make `MetricsLayer` WASM compatible [opendal]
Posted by "bonsairobo (via GitHub)" <gi...@apache.org>.
bonsairobo commented on issue #6619:
URL: https://github.com/apache/opendal/issues/6619#issuecomment-3595232580
@tisonkun
> After a closer look, I noticed that SystemTime is used inside metrics rather than from OpenDAL.
Can you point me to what you're referring to? I've been using the `metrics` crate in WASM without issues for a while.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] new feature: Make `MetricsLayer` WASM compatible [opendal]
Posted by "0lai0 (via GitHub)" <gi...@apache.org>.
0lai0 commented on issue #6619:
URL: https://github.com/apache/opendal/issues/6619#issuecomment-3566859676
Hi, Is anyone currently working on this? If not, I'd like to give it a try. Thanks.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] new feature: Make `MetricsLayer` WASM compatible [opendal]
Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on issue #6619:
URL: https://github.com/apache/opendal/issues/6619#issuecomment-3596139583
Oops. The compile would pass but when accessing it, it would panic instead?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] new feature: Make `MetricsLayer` WASM compatible [opendal]
Posted by "0lai0 (via GitHub)" <gi...@apache.org>.
0lai0 commented on issue #6619:
URL: https://github.com/apache/opendal/issues/6619#issuecomment-3594674981
So this is an upstream issue that can't be fixed within OpenDAL, right?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] new feature: Make `MetricsLayer` WASM compatible [opendal]
Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on issue #6619:
URL: https://github.com/apache/opendal/issues/6619#issuecomment-3591664981
> [@tisonkun](https://github.com/tisonkun) [@Xuanwo](https://github.com/Xuanwo) If I want to fix it, I should first write a test and update the metrics crate to use web-time for WASM targets. Does this implementation look correct ? Thank you.
It's more like an upstream issue for https://github.com/metrics-rs/metrics
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] new feature: Make `MetricsLayer` WASM compatible [opendal]
Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on issue #6619:
URL: https://github.com/apache/opendal/issues/6619#issuecomment-3566867273
@0lai0 Feel free to pick it up and submit a PR. I think you'd first add a test to claim the failure and then fix it up.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] new feature: Make `MetricsLayer` WASM compatible [opendal]
Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on issue #6619:
URL: https://github.com/apache/opendal/issues/6619#issuecomment-3584998410
> After a closer look, I noticed that `SystemTime` is used inside `metrics` rather than from OpenDAL.
>
> Perhaps this is an issue to `metrics`.
>
> cc [@Xuanwo](https://github.com/Xuanwo) [@MrCroxx](https://github.com/MrCroxx) maybe you have more inputs on this point?
Yes, I think `metrics` should support WASM first before opendal can do it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] new feature: Make `MetricsLayer` WASM compatible [opendal]
Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on issue #6619:
URL: https://github.com/apache/opendal/issues/6619#issuecomment-3594684605
> So this is an upstream issue that can't be fixed within OpenDAL, right?
Yes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] new feature: Make `MetricsLayer` WASM compatible [opendal]
Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun closed issue #6619: new feature: Make `MetricsLayer` WASM compatible
URL: https://github.com/apache/opendal/issues/6619
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] new feature: Make `MetricsLayer` WASM compatible [opendal]
Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo closed issue #6619: new feature: Make `MetricsLayer` WASM compatible
URL: https://github.com/apache/opendal/issues/6619
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] new feature: Make `MetricsLayer` WASM compatible [opendal]
Posted by "bonsairobo (via GitHub)" <gi...@apache.org>.
bonsairobo commented on issue #6619:
URL: https://github.com/apache/opendal/issues/6619#issuecomment-3595285607
I should have been more specific in the original issue description. I believe the root cause of the panic on WASM is this call:
https://github.com/apache/opendal/blob/82553f9d450f6616680abd7a4d76b5881ee2b1ca/core/src/layers/observe/metrics.rs#L433
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] new feature: Make `MetricsLayer` WASM compatible [opendal]
Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on issue #6619:
URL: https://github.com/apache/opendal/issues/6619#issuecomment-3596050962
@bonsairobo Thanks for your information. Let me take another look.
Besides, do you have some command/code/demo to reproduce the compile error? I may need to find a way to verify any patch locally.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] new feature: Make `MetricsLayer` WASM compatible [opendal]
Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on issue #6619:
URL: https://github.com/apache/opendal/issues/6619#issuecomment-3596135281
I think `Instant` is aviable on wasm target now.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org