Integrates OpenTelemetry tracing, metrics, and logging into iii workers. Use when setting up distributed tracing, Prometheus metrics, custom spans, or connecting to observability backends.
60
68%
Does it follow best practices?
Impact
—
No eval scenarios have been run
Passed
No known issues
Optimize this skill with Tessl
npx tessl skill review --optimize ./skills/iii-observability/SKILL.mdComparable to: Datadog, Grafana, Honeycomb, Jaeger
Use the concepts below when they fit the task. Not every worker needs custom spans or metrics.
iii worker add iii-observabilitytraceparent and baggage can be extracted/injected for outbound HTTP and external systemsregisterWorker() with otel config enables telemetry per workerwithSpan(name, opts, fn) wrap async work with trace context@opentelemetry/api in Node, opentelemetry in Python/Rust) create counters and histogramsThe worker SDK generates spans, metrics, and logs during function execution. These flow to the engine, which exports them via OTLP to a collector (Jaeger, Grafana, Datadog). The engine also exposes a Prometheus endpoint on port 9464 for scraping.
| Primitive | Purpose |
|---|---|
registerWorker(url, { otel }) | Connect worker with telemetry config |
Logger.info/warn/error/debug(message, data?) | Emit structured SDK logs |
withSpan(name, opts, fn) | Create a custom trace span |
currentTraceId() | Get active trace ID for correlation |
injectTraceparent() | Inject W3C trace context into outbound calls |
injectBaggage() / extractBaggage() | Propagate W3C baggage where supported |
onLog(callback, { level }) | Subscribe to log events |
shutdown_otel() | Graceful shutdown of telemetry pipeline |
See ../references/observability.js for the full working example — a worker with custom spans,
Also available in Python: ../references/observability.py
Also available in Rust: ../references/observability.rs metrics counters, trace propagation, and log subscriptions connected to an OTel collector.
Code using this pattern commonly includes, when relevant:
registerWorker('ws://localhost:49134', { otel: { enabled: true, serviceName: 'my-svc' } }) — enable telemetryregister_worker(address, InitOptions(otel=OtelConfig(enabled=True, service_name='my-svc'))) — enable telemetryregister_worker(address, InitOptions { otel: Some(OtelConfig { enabled: Some(true), service_name: Some("my-svc".into()), ..Default::default() }), ..Default::default() })new Logger().info('processing', { requestId }) / Logger().info(...) / Logger::new().info("processing", Some(json!({...}))) — structured logswithSpan('validate-order', {}, async (span) => { span.setAttribute('order.id', id); ... }) — custom spanmetrics.getMeter('my-svc').createCounter('orders.processed') — custom counter via @opentelemetry/apimetrics.getMeter('my-svc').createHistogram('request.duration') — custom histogram via @opentelemetry/apionLog((log) => { ... }, { level: 'warn' }) — subscribe to warnings and abovecurrentTraceId() — get active trace ID for correlation with external systemsinjectTraceparent() — propagate trace context to outbound HTTP callsregisterWorker(url, { otel: { enabled: false } }) or OTEL_ENABLED=falseUse the adaptations below when they apply to the task.
otel in registerWorker() config to start collecting traces automaticallyLogger for structured logs instead of console.log / print when logs should appear in iii observabilitycurrentTraceId() to correlate iii traces with external system logsiii-observability in iii-config.yaml for engine-side exporter, sampling ratio, and alertsInstall/enable iii-observability with iii worker add iii-observability; it must be configured in iii-config.yaml for engine-side traces, metrics, and logs. See ../references/iii-config.yaml for the full annotated config reference.
iii-engine-config.iii-functions-and-triggers.iii-error-handling.iii-observability when the primary problem is SDK-level telemetry: spans, metrics, logs, and trace propagation.iii-observability in the iii engine.a7ebbbb
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.