effect-observability

Implement structured logging, distributed tracing, and metrics in Effect TypeScript applications.

1|Updated Aug 24, 2026
One-click install
npx skills add https://github.com/lambdasolver2/opencode-effect-harness --skill effect-observability-lambdasolver2
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: effect-observability
Source: https://github.com/lambdasolver2/opencode-effect-harness/tree/main/packages/module-typescript/assets/skills/effect-observability
Command: npx skills add https://github.com/lambdasolver2/opencode-effect-harness --skill effect-observability-lambdasolver2

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Effect applications need production-grade observability, but wiring loggers, spans, metrics, and OTLP exporters correctly involves many APIs and subtle configuration rules. This Skill provides verified patterns for the full observability stack so telemetry is captured and exported correctly the first time. ## Core Features & Use Cases - Structured Logging: Configure built-in loggers (JSON, pretty, logfmt), log annotations, log spans, level filtering via References.MinimumLogLevel, batched and file logging. - Tracing & Metrics: Create spans with Effect.withSpan and Effect.fn auto-spans, annotate spans, and use all five metric types (counter, gauge, histogram, summary, frequency) with attributes. - OTLP & Prometheus Export: Set up all-in-one Otlp.layerJson or individual OtlpTracer/OtlpLogger/OtlpMetrics exporters, plus Prometheus /metrics endpoints. - Use Case: You are deploying an Effect service to production and need JSON logs, OpenTelemetry traces sent to a collector, and a Prometheus scrape endpoint — this Skill gives you the complete layer composition. ## Quick Start Use the effect-observability skill to add structured JSON logging, tracing spans, and OTLP export to my Effect service.

Frequently Asked Questions about effect-observability

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add structured logging to an Effect application?

Use Effect.log, Effect.logInfo, and related functions for log calls, then install a logger with Logger.layer, such as Logger.consoleJson for production. Attach queryable metadata with Effect.annotateLogs and control the minimum level via References.MinimumLogLevel.

How do I export Effect traces and metrics to OpenTelemetry?

Use Otlp.layerJson from effect/unstable/observability with a baseUrl and resource attributes, providing FetchHttpClient.layer. It exports traces, logs, and metrics to standard OTLP endpoints without an external OpenTelemetry SDK.

Does Effect support Prometheus metrics export?

Yes. The PrometheusMetrics module in effect/unstable/observability formats metrics in Prometheus exposition format, and PrometheusMetrics.layerHttp registers a /metrics endpoint on your existing HttpRouter with optional path and prefix options.

What is the difference between Effect.withSpan and Effect.fn for tracing?

Effect.withSpan wraps any effect in a named span, while Effect.fn with a string name automatically creates a span around the entire function body. Effect.fn is preferred for service methods since it combines definition and instrumentation.

Why are my Effect logs not appearing after installing a custom logger?

Logger.layer replaces existing loggers by default, which can remove expected outputs. Pass { mergeWithExisting: true } to add loggers without replacing, and check that References.MinimumLogLevel is not filtering out your log level.

When should I use delta vs cumulative temporality for OTLP metrics?

Use delta temporality for backends like Datadog or Dynatrace that expect per-interval values. Use the default cumulative temporality for Prometheus-style backends where values accumulate over the metric's lifetime.