{"id":22862416,"url":"https://github.com/dylibso/wasm-practitioners-guide-to-observability","last_synced_at":"2026-02-08T02:07:14.242Z","repository":{"id":227832654,"uuid":"760865321","full_name":"dylibso/wasm-practitioners-guide-to-observability","owner":"dylibso","description":"Wasm Observability Workshop","archived":false,"fork":false,"pushed_at":"2024-08-12T16:32:55.000Z","size":7887,"stargazers_count":3,"open_issues_count":4,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-30T22:01:50.222Z","etag":null,"topics":["instrumentation","o11y","observability","opentelemetry","tracing","wasm"],"latest_commit_sha":null,"homepage":"https://dev.dylibso.com/docs/observe/overview","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dylibso.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-02-20T20:39:00.000Z","updated_at":"2024-04-02T17:14:15.000Z","dependencies_parsed_at":"2025-04-30T22:00:49.279Z","dependency_job_id":"178785af-13d1-4b4b-a0f7-01a3691f3bf4","html_url":"https://github.com/dylibso/wasm-practitioners-guide-to-observability","commit_stats":null,"previous_names":["dylibso/wasm-practitioners-guide-to-observability"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dylibso/wasm-practitioners-guide-to-observability","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dylibso%2Fwasm-practitioners-guide-to-observability","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dylibso%2Fwasm-practitioners-guide-to-observability/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dylibso%2Fwasm-practitioners-guide-to-observability/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dylibso%2Fwasm-practitioners-guide-to-observability/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dylibso","download_url":"https://codeload.github.com/dylibso/wasm-practitioners-guide-to-observability/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dylibso%2Fwasm-practitioners-guide-to-observability/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267808120,"owners_count":24147356,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["instrumentation","o11y","observability","opentelemetry","tracing","wasm"],"created_at":"2024-12-13T10:13:29.121Z","updated_at":"2026-02-08T02:07:09.210Z","avatar_url":"https://github.com/dylibso.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Wasm Practitioners Guide to Observability\n\n# Setup\n\nInstall these tools, and follow the slides if you'd like!\nhttps://docs.google.com/presentation/d/1-BxJFaSeOWVLu18Nr26zDX-vvc8yEK9QYTAHi5gne5k/edit?usp=sharing\n\n\n## 1. Install Jaeger (viewing OpenTelemetry data)\n\n```sh\ndocker run -d --rm --name jaeger \\\n  -e COLLECTOR_ZIPKIN_HOST_PORT=:9411 \\\n  -p 6831:6831/udp \\\n  -p 6832:6832/udp \\\n  -p 5778:5778 \\\n  -p 16686:16686 \\\n  -p 4317:4317 \\\n  -p 4318:4318 \\\n  -p 14250:14250 \\\n  -p 14268:14268 \\\n  -p 14269:14269 \\\n  -p 9411:9411 \\\n  jaegertracing/all-in-one:1.54\n```\n\nRun this at http://localhost:16686/ in your browser.\n\n\n## 2. Run the Go host service (executes Wasm code) \n\n```sh\ncd src/host/module-runner\n\ndocker build --tag workshop-host .\ndocker run --network host workshop-host\n# be sure to pass `--network host` here so that the Go application can reach Jaeger\n```\n\nThis will start a server running at http://localhost:3000\n\n## 3. Upload instrumented wasm code to the Go host service\n\n```sh\n# from the root of the repo\n\n# upload the Rust-based wasm module, name it `rust-manual`\ncurl -F wasm=@src/guest/rust/rust.wasm \"http://localhost:3000/upload?name=rust-manual\"\n\n# upload the Go-based wasm module, name it `go-manual`\ncurl -F wasm=@src/guest/go/main.wasm \"http://localhost:3000/upload?name=go-manual\"\n```\n\n## 4. Run instrumented wasm code on the Go host service\n\n```sh\n# run the Rust-based wasm module\ncurl -X POST \"http://localhost:3000/run?name=rust-manual\"\n\n# run the Go-based wasm module\ncurl -X POST \"http://localhost:3000/run?name=go-manual\"\n```\n\n## 5. Auto-instrument Wasm code using Dylibso's instrumenting compiler\n\n### 5.1 Get an API key from https://compiler-preview.dylibso.com/\n\n### 5.2 Instrument your module\n\nInstrument your module by sending it in a HTTP multipart/form-data POST request to the compiler:\n\n```sh\n# Update the paths to the wasm module to instrument to use pre-built ones, or bring your own! Be sure to also set or fill-in $API_KEY\ncurl --fail -F wasm=@code.wasm -H \"Authorization: Bearer $API_KEY\" \\\n  https://compiler-preview.dylibso.com/instrument \u003e code.instr.wasm\n```\n\nAlternatively you can try out the pre-instrumented modules instead for the next step:\n\n#### Go debug build instrumented\n\n`src/guest/modules/automatic/go/main.debug.instr.wasm`\n\n#### Rust debug build instrumented\n\n`src/guest/modules/automatic/rust/rust.debug.instr.wasm`\n\n### 5.3 Upload and run the auto-instrumented module\n\n`curl -F wasm=@src/guest/modules/automatic/go/main.debug.instr.wasm \"http://localhost:3000/upload?name=go-automatic\"`\n\n`curl -X POST \"http://localhost:3000/run?name=go-automatic\"`\n\nAs almost every function is instrumented, there should be much more output in Jaegar then we had from manual instrumentation.\n\n### 5.4 Instrument your module with configuration\nThe compiler can optionally take configuration to allow or disallow certain functions explicitly, \nwhich helps to get a fine-grained trace or ignore certain functions altogether. \n\nLet's also re-configure the adapter to change the SpanDuration and see how we can change the trace\nto better suit our needs when observing the behaviour of these programs.\n\nSee: https://dev.dylibso.com/docs/observe/instrumentation/automatic#configuring-the-automatic-instrumentation\n\n```sh\ncurl --fail -F wasm=@code.wasm  -F config=@config.json \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  https://compiler-preview.dylibso.com/instrument \u003e code.instr.wasm\n```\n\nor inline: \n\n```sh\ncurl --fail -F wasm=@code.wasm -F config='{\"allowed\": [\"foo\", \"bar\"]}' \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  https://compiler-preview.dylibso.com/instrument \u003e code.instr.wasm\n```\n\nAlternatively you can try out the pre-instrumented modules with config:\n\n#### Go\n\n`src/guest/modules/automatic/go/main.debug.config.instr.wasm`\n\n#### Rust\n\n`src/guest/modules/automatic/rust/rust.debug.config.instr.wasm`\n\nIf you upload and run your module, you'll see that the instrumentation output has been greatly reduced.\n\n## 6 Components\n\nThe Observe SDK can also run components.\n\n### 6.1 Install cargo-component 0.70\n\n`cargo install cargo-component@0.7.0`\n\n### 6.2 Build a component using the Observe API\n\n`cd src/guest/components/manual/rust/`\n\n`cargo component build`\n\nIt should build to `target/wasm32-wasi/debug/component-instr-command.wasm`\n\nAlternatively, the prebuilt component is available:\n\n`component-instr-command.wasm`\n\n### 6.3 Running the component\n\nOnly the Rust version of the Observe SDK currently has component support so we cannot use same host.\n\nNavigate to `src/host/component-runner`\n\nRun a prebuilt component:\n\n`cargo run ../../guest/components/manual/rust/component-instr-command.wasm`\n\nOr run the component you built:\n\n`cargo run ../../guest/components/manual/rust/target/wasm32-wasi/debug/component-instr-command.wasm`\n\nThe output from this host is outputted to stdout. The message printed is a little cryptic, but there is a span named `hello world`. The message is an Open Telemetry Protobuf message in Rust debug format. In the future we plan on improving the OTEL adapter to be able to send to a collector as the go host does.\n\nAutomatic instrumentation of components is in the works.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdylibso%2Fwasm-practitioners-guide-to-observability","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdylibso%2Fwasm-practitioners-guide-to-observability","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdylibso%2Fwasm-practitioners-guide-to-observability/lists"}