-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Follow up from #100
We would also like to allow configuring the tracing to dump to other formats than stdout.
One of the most interesting outputs is jaeger (or other opentracing server), which involves adding spans in places. This also means tracking spans not just in one place in the pipeline, but following the action from trigger pickup to dispatcher to wasm engine to submission of the result on the chain.
This will probably be a lot more work than nice text logging, so pulled into another milestone to give time to do it right. You can look at https://github.com/lay3rlabs/layer-sdk for another example of doing this with jaeger
Layer SDK docker references:
- You can use this image (or a newer version) in docker-compose to handle everything. This is good for local: https://github.com/Lay3rLabs/layer-sdk/blob/main/localnode/docker-compose.yml#L59-L67
- If you want something for long-lived testnet (several million events) with persistence and memory limits, you can look at https://github.com/Lay3rLabs/layer-sdk/blob/main/localnode/jaeger-elastic-compose.yml but that should be out of scope of this issue
- We pass in a config line to redirect to the jaeger host for dumping events (mind the port numbers, they can be tricky here) https://github.com/Lay3rLabs/layer-sdk/blob/main/localnode/abci/config/slay3r.toml#L2
Layer SDK code references:
The tracing setup code is here: https://github.com/Lay3rLabs/layer-sdk/blob/main/app/slay3rd/src/main.rs#L78-L109 please not the following points:
- It uses
config.filterto filter events. Which is basically this filter from WAVS - important to keep that - Current WAVS setup only uses stdout to log tracing, you probably want to support both options - either stdout or jaeger like the layer-sdk setup. You should compare the two approaches to building the fmt subscriber and define what works best for you.
- You can try copying the tracing-jaeger setup from layer-sdk, but it is deprecated and you are supposed to use otlp-tracer now instead. I did try this with layer-sdk some months ago, but I couldn't get it to work. Check out my PR to see my (lack of) progress, which may be a good learning experience, not a template.
- One idea I had was a minimal test case to see if this works at all, and then when you get a Rust binary writing to the Jaeger docker image, you can then port it over to WAVS with a lot more confidence and a quicker testing cycle. This article gives such a sample app. I'd try this out and connect to jaeger docker (and expose some ports as needed) and then take those learnings to implement this PR properly