Skip to main content

Manual Instrumentation

The Observe API provides another approch to instrumenting your code, by using our libraries directly in your source code before it's compiled to Wasm.

Currently, manual instrumentation using the Observe APIs is the only way to get logs and metrics in addition to traces from Wasm.

NOTE: you can use both automatic and manual instrumentation in the same code.

API

Expect changes

This is an early version of this API and is subject to change. The current state of the libraries work well, but as we implement the API in more languages, we may find it necessary to alter signatures, or add/remove functions. If you're considering these APIs for production use, please reach out to support@dylibso.com so we can ensure you have the latest information.

The Observe API is a set of host functions that will be supported by each of our Adapters, but currently is only implemented in the Rust Adapters. Please contact us if you're interested in using these from your WebAssembly modules run in other host languages.

This acts as the contract between the host and the guest layer. All data flows in one direction, from the guest to the host. Most of these APIs are simply ways to pass observability data as strings to the host layer.

  • dylibso_observe.metric(i32, i64, i32)
  • dylibso_observe.log(i32, i64, i32)
  • dylibso_observe.span_enter(i64, i32)
  • dylibso_observe.span_exit()
  • dylibso_observe.span_tags(i64, i32)

Ideally, you will not call this API layer directly but instead use language specific bindings to call them. And for end users, eventually, open source observability clients will export data to this layer.

Language Bindings

We currently provide these language bindings to this API:

Library SourceExample Usage
Rust(Link to code)
C(Link to code)

More languages will come soon as well as tools built on top of these bindings. If you are planning on building your own tooling we suggest using or contributing one of these language specific bindings.

Support

If you're looking for additional help or would like hands-on support, we're happy to be of service. We also are able to provide you with your own offline or self-hosted version of our automatic instrumentation tools so you can run everything in your own network.

Please reach out to support@dylibso.com for more information.

Additionally, visit the GitHub Discussion page for general Q&A about the Observe SDK and related products.