Comments (27)
@juntao Can you please provide an example of logging and tracing calls in the WasmEdge codebase. I have got the idea that I have to replace logging and tracing statements with the OpenTelemetry agent. But I am unable to locate the statements.
Thanks
from wasmedge.
from wasmedge.
Run a WasmEdge app and you will see logs printed in the console. You can locate in the source code where they are. Thanks. Cheers Michael
On Fri, Aug 20, 2021 at 7:46 AM Ashutosh Sharma @.***> wrote: @juntao https://github.com/juntao Can you please provide an example of logging and tracing calls in the WasmEdge codebase. I have got the idea that I have to replace logging and tracing statements with the OpenTelemetry agent. But I am unable to locate the statements. Thanks — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#365 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAACUNVWLVS36LM67U3RWBLT5ZFDHANCNFSM5CPG5WLA .
-- Michael Yuan, PhD Fast, safe, portable and serverless Rust programs on Node.js, or as a FaaS http://SecondState.io http://cloud.secondstate.io
@juntao I have found that log statements are defined in log.cpp and we are using spdlog tag. I was running this simple command ./wasmedge --reactor examples/fibonacci.wasm fib 10 10. To find where are the log statements when FunctionType doesnot match located. I was able to find that the error tag is: MismatchCategory::FunctionType. But can you please point me to the file where the types are actuallly matched. I have used grep command as well and went through the returned files but it didn't work.
Thanks
from wasmedge.
@spider0061 This is a coding challenge. You are supposed to figure out how WasmEdge works with logging today. ;)
That said, you do not have to replace existing logging statements. You can use OpenTelemetry to demonstrate how to add new logging capabilities to this project.
from wasmedge.
Hi,
I have added some trace and logging stub to the interpreter code and maybe this would suffice for the challenge.
My repo link: https://github.com/CruxBox/WasmEdge
And the screenshot I took after I ran the example 'add.wasm' program:
As part of the challenege I had to build OpenTelemetry, build WasmEdge, link them so I could use the OTel library, and make appropriate changes in the interpreter code.
Note that the Tracer output is not very detailed but that could be changed.
Also, OTel has 3 types of logging: Errors, Debug, Info.
I chose to go with Debug but I have a screenshot of testing Error too if you'd like.
If there is anything you want me to add/modify let me know.
Thanks,
from wasmedge.
Hi,
I have compiled and installed open-telemetry and WasmEdge successfully today. I have done some code to experiment with the feasibility of embedding a C++ agent into WasmEdge.
Although the code is not perfect, Uphold the "Release early, release often" philosophy, the following is my GitHub link. There is a screenshot of the logging messages in the img folder.
https://github.com/William-Mou/WasmEdge/tree/mou/dev
I learned a lot from these two Cloud Native projects. Thank You!
from wasmedge.
Hi,
I think I understad the log system. The main file for log is log.cpp
and log.h
. They generate use overload to generate error message and then goto spdlog system. If I want hack, the easy way is to hack those files(What I have make). However, there are some sparate file use spdlog directly by string literal. For those may need directly hack spdlog code in original place.
But I have spand one entirely day to try install opentelemetry-cpp. I try use cmake's FetchContent_Declare to pull it as an git submodule, but it just error at benchmark.cmake generate(follow INSTALL.md. I finially install it success by off the cmake option about opentelemetry-cpp test(-DBUILD_TESTING=OFF). However, FetchContent_Declare work not as same as the spdlog I copied (I'm not familiar with cmake before). Finally I have to make install
it in docker and target link it to WasmEdge Common(Too inelegant) and compile it. And finally success run it.
Durning this try, I leran a lot knowledge about cmake. And also have a understand about WasmEdge's log system. I don't know if the apply time pass when I finish issue, but it's still a happy journey about learn.
repo : https://github.com/sonder-joker/WasmEdge/
from wasmedge.
Hi,
I guess the main task in this challenge is how to embed a tool/agent into WasmEdge.
So following the basic idea of log.h
and log.cc
, I add tracer.h
and tracer.cc
to embed a OpenTelemetry tracer with WasmEdge CLI. In this approach we can use OpenTelemetry to trace and log messages. To demonstrate, I just put a simple trace in the main function.
https://github.com/XingZYu/WasmEdge
Thanks,
from wasmedge.
Hi WasmEdge team,
I embedded an opentelemetry logging into wasmedger.cpp. Specifically inside the code path of reactor mode. Therefore, it will log whenever wasmedge CLI is called with reactor mode. It might not be the most elegant way to do it, but I managed to do the challenge with the minimum change to the code base.
github link: https://github.com/st9540808/WasmEdge
from wasmedge.
Hi,
I have added logging in Wasmedge using Open Telemetry. I have installed Open Telemetry in the docker image and have added Open Telemetry in cmake using this. I have added the logging commands in tools/wasmedge/wasmedger.cpp file. I hope this would be enough for the challenge. Happy to make any additional changes required.
The link to my repo: WasmedgeLogging
Attached is a picture showing the logging when add.wasm is executed:
from wasmedge.
Hi,
repo link - https://github.com/himanshutiwariji/WasmEdge.git
Thank you , Have a good day
from wasmedge.
No matter what I do , this is always present when linked against opentelemetry
tools/wasmedge/CMakeFiles/wasmedge.dir/build.make:83: *** target pattern contains no '%'. Stop.
make[1]: *** [CMakeFiles/Makefile2:2818: tools/wasmedge/CMakeFiles/wasmedge.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 91%] Linking CXX executable wasmedgeInterpreterCoreTests
[ 91%] Built target wasmedgeMemLimitTests
[ 91%] Built target wasmedgeASTTests
[ 91%] Built target wasmedgec
[ 91%] Built target wasmedgeExternrefTests
[ 91%] Built target wasmedgeInterpreterCoreTests
[ 91%] Built target wasmedgeAOTCoreTests
[ 91%] Built target wasmedge_c
make: *** [Makefile:163: all] Error 2
satacker@ubuntu:~/WasmEdge/build$
Complete Traceback
https://pastebin.com/sZ967jgd
Edit: The problem is in opentelemetry-cpp cmake pkg-config
tools/wasmedge/wasmedge: opentelemetry-cpp::version-NOTFOUND
tools/wasmedge/wasmedge: opentelemetry-cpp::common-NOTFOUND
tools/wasmedge/wasmedge: opentelemetry-cpp::trace-NOTFOUND
tools/wasmedge/wasmedge: opentelemetry-cpp::logs-NOTFOUND
tools/wasmedge/wasmedge: opentelemetry-cpp::ostream_log_exporter-NOTFOUND
tools/wasmedge/wasmedge: opentelemetry-cpp::ostream_span_exporter-NOTFOUND
tools/wasmedge/wasmedge: opentelemetry-cpp::zpages-NOTFOUND
from wasmedge.
No matter what I do , this is always present when linked against opentelemetry
tools/wasmedge/CMakeFiles/wasmedge.dir/build.make:83: *** target pattern contains no '%'. Stop. make[1]: *** [CMakeFiles/Makefile2:2818: tools/wasmedge/CMakeFiles/wasmedge.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... [ 91%] Linking CXX executable wasmedgeInterpreterCoreTests [ 91%] Built target wasmedgeMemLimitTests [ 91%] Built target wasmedgeASTTests [ 91%] Built target wasmedgec [ 91%] Built target wasmedgeExternrefTests [ 91%] Built target wasmedgeInterpreterCoreTests [ 91%] Built target wasmedgeAOTCoreTests [ 91%] Built target wasmedge_c make: *** [Makefile:163: all] Error 2 satacker@ubuntu:~/WasmEdge/build$
Complete Traceback
https://pastebin.com/sZ967jgdEdit: The problem is in opentelemetry-cpp cmake pkg-config
tools/wasmedge/wasmedge: opentelemetry-cpp::version-NOTFOUND tools/wasmedge/wasmedge: opentelemetry-cpp::common-NOTFOUND tools/wasmedge/wasmedge: opentelemetry-cpp::trace-NOTFOUND tools/wasmedge/wasmedge: opentelemetry-cpp::logs-NOTFOUND tools/wasmedge/wasmedge: opentelemetry-cpp::ostream_log_exporter-NOTFOUND tools/wasmedge/wasmedge: opentelemetry-cpp::ostream_span_exporter-NOTFOUND tools/wasmedge/wasmedge: opentelemetry-cpp::zpages-NOTFOUND
I have been facing the exact error since 5 days and it is not resolved yet. I have tried a lot of solutions but none of them worked.
from wasmedge.
No matter what I do , this is always present when linked against opentelemetry
tools/wasmedge/CMakeFiles/wasmedge.dir/build.make:83: *** target pattern contains no '%'. Stop. make[1]: *** [CMakeFiles/Makefile2:2818: tools/wasmedge/CMakeFiles/wasmedge.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... [ 91%] Linking CXX executable wasmedgeInterpreterCoreTests [ 91%] Built target wasmedgeMemLimitTests [ 91%] Built target wasmedgeASTTests [ 91%] Built target wasmedgec [ 91%] Built target wasmedgeExternrefTests [ 91%] Built target wasmedgeInterpreterCoreTests [ 91%] Built target wasmedgeAOTCoreTests [ 91%] Built target wasmedge_c make: *** [Makefile:163: all] Error 2 satacker@ubuntu:~/WasmEdge/build$
Complete Traceback
https://pastebin.com/sZ967jgd
Edit: The problem is in opentelemetry-cpp cmake pkg-configtools/wasmedge/wasmedge: opentelemetry-cpp::version-NOTFOUND tools/wasmedge/wasmedge: opentelemetry-cpp::common-NOTFOUND tools/wasmedge/wasmedge: opentelemetry-cpp::trace-NOTFOUND tools/wasmedge/wasmedge: opentelemetry-cpp::logs-NOTFOUND tools/wasmedge/wasmedge: opentelemetry-cpp::ostream_log_exporter-NOTFOUND tools/wasmedge/wasmedge: opentelemetry-cpp::ostream_span_exporter-NOTFOUND tools/wasmedge/wasmedge: opentelemetry-cpp::zpages-NOTFOUND
I have been facing the exact error since 5 days and it is not resolved yet. I have tried a lot of solutions but none of them worked.
Instead of using whatever is given in opentelemetry-cpp docs try the following after installing opentelemetry-cpp
find_package(opentelemetry-cpp CONFIG REQUIRED)
...
target_include_directories(wasmedge
PRIVATE
${OPENTELEMETRY_CPP_INCLUDE_DIRS}
${OPENTELEMETRY_CPP_LIBRARY_DIRS}
)
target_link_libraries(wasmedge
PRIVATE
wasmedgeVM
${OPENTELEMETRY_CPP_LIBRARY_DIRS}
)
from wasmedge.
To be more generic wasmedge
can be any CMake target variable
On a side note: Apologies for making this challenge discussion deviate from its main point but I wonder why docker users didn't face this.
from wasmedge.
Hello Mentors,
For the past few days I was facing error in linking opentelemetry with wasmedge. I even contacted the opentelemetry team regarding this as none of the other developers was facing the inevitable error 2. I was finally able to resolve it and here is the screenshot of the changes that I made:
In the beginning I thought that it was an easy challenge, indeed it was an easy challenge but I was not aware that I will fall into this much trouble while linking opentelemetry. I have learned about wasmedge and how it is used to run wasm progroms. I also got introduced to webassembly and how webassembly can be a revolutionary step in web development.
I have learned about host modules and functions and currently I am working on them only.
I would like to thank mentors and this challenge really taught me a lot of things and finally I was able to complete it.
Repository Link: https://github.com/spider0061/WasmEdge
Thanks and Regards
Ashutosh Sharma
from wasmedge.
hi here's the coding challenge solution on GitHub link: https://github.com/vaibhavarora102/WasmEdge
it was indeed very refreshing, and warming up the task. Looking forward to mentors' guidance in the LFX mentorship program.
from wasmedge.
Hi,
I've spent a few days in linking opentelemetry with wasmedge and building opentelemetry from source, a lot of problems occurred during compiling. I even started a issue in opentelemetry-cpp
about build errors, and found out the dependency benchmark should be compiled in PIC(Position Independent Code) mode. At least finally it worked. I embedded an opentelemetry logging into wasmedger.cpp, and learned a lot about wasm in this challenge. Hope I did not miss the deadline.
Repo: https://github.com/OliverShang/WasmEdge
Thanks,
from wasmedge.
Hi,
I spent some time learning the basics of c++ and cmake. After that, I tried to build wasmedge based on build.md on my mac, but there were various strange problems, often stuck at 73%. So I had to try it on my Ubuntu 20.04 cloud host. And I spent a lot of time to install opentelemetry-cpp during the build.
The first time I came into contact with c++ projects. Maybe because of my lack of experience ,I feel that package management and construction are very primitive, which directly caused a very unfriendly development experience!
There is a tip
If your github network is not very good, you can try the following command.
SET URL INSTEAD
git config --global url."https://github.com.cnpmjs.org/".insteadOf https://github.com
UNSET
git config --global --remove-section url."https://github.com.cnpmjs.org/"
My Repo
My ScreenShot
from wasmedge.
Hi,
I try several ways to embed OpenTelemetry like FetchContent_Declare. But it doesn't work well. Finally, I build and make opentelemetry-cpp, and set opentelemetry-cpp_DIR to the directory where contains config.cmake. Then build wasmedge in the docker. It prints log information successfully. By doing this challenge I learned a lot about cmake, especially "find_package". I enjoy solving the problem.
Thank you!Repository Link: https://github.com/Flpha0830/WasmEdge
Hi, could you tell me your name or email when you signed up for the LFX mentorship? I tried to search by your GitHub name and your university. However, I couldn't find you through the applications. Thanks.
from wasmedge.
In case Anyone is eager to help as the challenge seems to be over already here are my logs which tells me that I haven't installed protobuf,nlohmann-json,libcurl,grpc
However, I have installed those as we can see in
root@4b5d92daa3be:~/wasm_work/WasmEdge/build# l
s /usr/local/lib/cmake/
absl grpc protobuf
c-ares opentelemetry-cpp re2
root@4b5d92daa3be:~/wasm_work/WasmEdge/build#
ls /usr/lib/cmake/
clang-12 nlohmann_json
from wasmedge.
Hi,
After a lot of struggles, I myself compiled and build and make OpenTelemetry and then WasmEdge. In my screenshot, I have shown both pass and fail cases. I think I have learned a lot during this small coding Challenge.
This is my Repository Link:https://github.com/PratyushD35/WasmEdge
from wasmedge.
In case Anyone is eager to help as the challenge seems to be over already here are my logs which tells me that I haven't installed protobuf,nlohmann-json,libcurl,grpc
However, I have installed those as we can see inroot@4b5d92daa3be:~/wasm_work/WasmEdge/build# l s /usr/local/lib/cmake/ absl grpc protobuf c-ares opentelemetry-cpp re2 root@4b5d92daa3be:~/wasm_work/WasmEdge/build# ls /usr/lib/cmake/ clang-12 nlohmann_json
GitHub link - https://github.com/SAtacker/WasmEdge/tree/satacker
I have added open telemetry using examples from the docs inside the main function of wasmedge runtime
from wasmedge.
Finally, I succeeded in here
https://github.com/SAtacker/WasmEdge/tree/satacker
from wasmedge.
Hi,
After spending a lot of time I finally did it. There were lots of build issues , especially unmet dependencies. I installed openTelemetry depedencies using "ci" scripts and everything seems to work fine.
here is my git repository :- https://github.com/gautam-dev-maker/WasmEdge
Proof :-
from wasmedge.
Hello Mentors,
I am sorry for submitting at last moment but I have tried my best to do the challenge efficiently.
I have done the required changes as I installed Open Telemetry and done a few changes in wasmedger.cpp and CMakeList.cpp.
Link to my repository : https://github.com/chaytanyasinha/WasmEdge
I hope you like it!
from wasmedge.
I am closing this issue due to outdated.
from wasmedge.
Related Issues (20)
- feat: Enabling WasmEdge AOT mode execution in the proxy-wasm integration
- feat: Enabling LLM fine tuning in the WASI-NN PyTorch plugin HOT 2
- feat: Enabling LLM fine tuning in the WASI-NN ggml plugin HOT 3
- Can't install WasmEdge with wasmedge_rustls plugin (tested on Fedora and Ubuntu) HOT 5
- question: Possibility of simplifying running AI model-specific wasm Workloads with Embedded Configuration HOT 4
- feat: Crun + GGML plugin tracking issue HOT 9
- feat: Provide CUDA 11.3 pre-built ggml plugin HOT 1
- feat: Support `--main-gpu` in the ggml plugin
- feat: Support `--tensor-split` in the ggml plugin
- How can I run wasmedge on Windows11 with GGML plugin HOT 2
- Bug: (WASI) Failed to create directory with trailing backslash HOT 3
- bug: Can't install Rust TLS plugin on Mac OS HOT 11
- feat: Support auto-detect CUDA version for the ggml plugin in the installer
- bug: Remove `._*.*` files on macOS in the installer HOT 1
- Building WASM from source on android HOT 6
- bug: WasmEdge `0.14.0-alpha.2` doesn't work on macOS, at least due to a lack of `libprotobuf.25.1.0` and `libgrpc++.1.60.dylib`.
- WASI-NN with GPU on Jetson Orin Nano HOT 6
- LFX Workspace: Integrate burn.rs as a new WASI-NN backend HOT 4
- bug: LlamaEdge 0.4.0 installation on Mac Intel model, missing file ' WasmEdge-plugin-wasmedge_rustls-0.13.5-darwin_x86_64.tar.gz' HOT 3
- bug: Randomly fail of Windows or Windows-MSVC test for LLVM HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wasmedge.