Instrument a Resource with OpenTelemetry
This tutorial sends structured OpenTelemetry (OTLP) logs from a Resource to the
reserved telemetry Door. You will emit
severity-tagged log records (from Rust with the nanocar guest library or
from JavaScript with an OTLP/HTTP exporter), deploy, and read the structured
severity badges in the Logs tab. It takes about fifteen minutes.
Every Resource can push OTLP logs to the telemetry Door with no network
configuration; the Door is host-provided. Raw stdout and stderr capture always
works alongside it. See Telemetry for the
reference.
Prerequisites
- A deployed Resource. This tutorial uses
acmewith anapiResource. - The
hyjalCLI installed and logged in. - The toolchain for your lane: Rust with
cargo component, or Node.js for the JS lane.
1. Emit structured logs
Pick the lane that matches your Resource.
Rust with nanocar
Add the nanocar guest library and initialize it once at the top of your
handler. It routes OTLP log records to the telemetry Door. Emit records with
a severity and message.
Each record carries a severity (Info, Warn, Error, and so on) and
optional key-value attributes. The severity is what renders as a badge in the
Logs table.
JavaScript with an OTLP exporter
On the JS lane, point any OTLP/HTTP logs exporter at the telemetry Door. The
Door endpoint is available to the instance as HYJAL_TELEMETRY_ENDPOINT.
The exporter posts OTLP over HTTP to the Door; the severity number maps to the badge shown in the Logs table.
2. Deploy
Deploy the Resource. No egress allowlist entry is needed for the telemetry
Door: it is a host-provided capability, not an external host.
3. Generate traffic
Send a few requests so the instance emits records.
4. Read severity badges in the Logs
Open the Logs tab in the Console, or stream from the
CLI. Structured OTLP records render with a severity badge (INFO, WARN,
ERROR) while raw output keeps honest STDOUT and STDERR badges.
Each structured record is correlated with the request that produced it. Filter the table by method in the Console to isolate the requests you care about; the severity badges make error records scannable at a glance.
What you built
- A Resource that emits structured OTLP logs to the
telemetryDoor, from Rust withnanocaror from JavaScript with an OTLP exporter. - Severity-tagged records rendered as badges in the Logs table.
- Structured telemetry alongside honest stdout and stderr capture, with no egress configuration.
Next steps
- Telemetry: the OTLP contract and the
telemetryDoor. - Logs: the request timeline, search, and filters.
- Stats and metering: request counts, compute time, and peak memory.