Telemetry for Spin Apps with the OTel Plugin
Andrew Steurer
otel
tracing
metrics
spin
jaeger
grafana
prometheus
spin
plugin
We are excited to announce the Spin OTel plugin for the Spin CLI! If you have ever found yourself wanting to view traces and metrics for your Spin applications, the OTel plugin makes this very easy to do.
Included with the plugin are three open-source UIs: Jaeger, Grafana, and Prometheus. If you don’t know how to use any of them, please visit the relevant service’s documentation page linked below:
- Jaeger (for viewing trace data)
- Grafana (for viewing metrics and logs)
- Prometheus (for querying and viewing metrics data)
If you encounter bugs, would like to see new features, or would like to examine the source code, feel free to visit the repository on GitHub.
Let us know what you think about the plugin on our Discord.
What is Spin?
Spin is an open-source framework for building WebAssembly applications, which has a ton of amazing features, including portability (a single binary can run on many architectures), and sub-millisecond cold-start times. See the Spin Project Docs for more details.
What is a Plugin?
Spin plugins add new functionality or subcommands to Spin without modifying the Spin codebase. Plugins can be added to the Spin plugins repository and then listed and installed using the spin plugins command. Since plugins have their own versioning system, they can be developed and released independently of Spin, with updates being applied by running spin plugins update && spin plugins upgrade <plugin-name>
How to use the plugin
If you already have a Spin app you want to test, navigate in your terminal to the directory of the relevant spin.toml
file. If you don’t, you can run spin new
and select a sample template to run.
Once you have navigated to your Spin app in your terminal, you can run the following commands:
Install the plugin
spin plugins update
spin plugins install otel
Set up the dashboards
spin otel setup
Run a Spin app that exports telemetry data
spin otel up
Any flags that work with the spin up
command, will work with the spin otel up command.
spin otel up -- --help
Open the dashboards in the default browser
spin otel open grafana
spin otel open jaeger
spin otel open prometheus
Terminate the dashboards
spin otel cleanup
See the plugin in action
Watch the livestream we did demonstrating the features of the OTel plugin: