feat(telemetry): OpenTelemetry export across all runtimes via Effect's OTLP exporters - #860
Open
sam-goodwin wants to merge 6 commits into
Open
feat(telemetry): OpenTelemetry export across all runtimes via Effect's OTLP exporters#860sam-goodwin wants to merge 6 commits into
sam-goodwin wants to merge 6 commits into
Conversation
…s OTLP exporters Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
|
Install the packages built from this commit: alchemy bun add alchemy@https://pkg.ing/alchemy/c7b38f1@alchemy.run/better-auth bun add @alchemy.run/better-auth@https://pkg.ing/@alchemy.run/better-auth/c7b38f1@alchemy.run/pr-package bun add @alchemy.run/pr-package@https://pkg.ing/@alchemy.run/pr-package/c7b38f1 |
…metry concepts page, per-signal OTEL env support + Axiom.otlpHeaders Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Telemetry.otlp is now a binding layer (Input/Output props bound onto the host at deploy time); Axiom.Telemetry binds datasets + ingest token; removed Telemetry.disabled and the env-var-first docs framing. Single Effect.provide with Layer.mergeAll everywhere. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ently in observability guides Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Merged Telemetry.otlp/Axiom.Telemetry layers accumulate into a single bound destination list; the runtime serializes telemetry once and fans each signal out to every destination via a tee HttpClient, keeping trace/span ids consistent. Telemetry.layer custom layers now compose with the OTLP destinations instead of replacing them. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Telemetry.otlp/Telemetry.layer were methods on an Object.assign'd reference, defeating tree-shaking. Now flat exports from alchemy/Telemetry (layerOtlp, layer, the Telemetry reference), namespaced at the barrel via export * as Telemetry. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
|
Sick, love this 👌 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add OpenTelemetry export for deployed apps, built on Effect's OTLP exporters (
effect/unstable/observability) and wired into every runtime: Worker, Durable Object, Workflow, Lambda (per-event), and Cloudflare Containers, ECS Task, EC2 hosted, Lambda microVM (per-process).Telemetry is configured like everything else in alchemy — a Layer, wired to resources through the binding infrastructure and composed into the Function/Worker's single
Effect.provide. Everything is exported functions fromalchemy/Telemetry(tree-shakeable), namespaced at the barrel:Axiom.Telemetryis sugar over the genericAlchemy.Telemetry.layerOtlpbinding layer (any OTLP backend), and exporters compose — merge several and every destination receives the telemetry:How it works
Telemetry.layerOtlpis a binding layer: url/header values accept resource Outputs; each layer build appends its destination to a single bound destination list (Redactedvalues through the secret channel), and the runtime exporter reads the list back. No telemetry layer provided → no export; Effect's no-op tracer keeps instrumentation free.HttpClient, so trace/span ids agree across destinations; a failing destination is skipped and logged while a healthy one keeps the exporter alive.Telemetry.layercustom layers compose too (loggers/metrics merge; a customTracerreplaces the built-in one).ctx.waitUntilon Workers, settled inline on Lambda.provideProcessTelemetryin their entry templates: built once into the root scope, standard export intervals, final flush at graceful shutdown.http.serverroot span with incomingtraceparentcontinuation — Workers already hadHttpMiddleware.tracerviaHttpEffect.toHandled; Lambda's HTTP handler now applies it too.ConfigProvider, loggers) resolve identically at request time.OtlpExportersplices its buffer before posting, so an interval export in flight when the scope closes is interrupted and silently dropped. Lambda invocations regularly outlive the logger's 1-second default interval, which is how this surfaced. The scope-close flush delivers everything instead; the process default keeps standard intervals.Docs
cloudflare/tutorial/part-6) — datasets, ingest token, and theAxiom.Telemetrybinding layer, plus custom spans and per-request flush semantics. (Cloudflare's own OTel tracing has no OTLP ingest endpoint — runtime spans only — so Axiom is the worked example.)/infrastructure-as-effects/telemetry— binding layers, per-event vs per-process flushing, custom exporters./testing/observability,/cloudflare/observability/axiom-observability, and/axiom/data/ingestwiring sections for the binding layer (no hand-rolledOtlpTracer.layer).Tests
Live e2e for Workers, Lambda, and Axiom (
test/Cloudflare/Workers/Telemetry.test.ts,test/AWS/Lambda/Telemetry.test.ts,test/Axiom/Telemetry.test.ts): a Durable-Object-backed OTLP collector worker receives exports from a traced worker (Telemetry.layerOtlpbinding + customTelemetry.layer) and a traced Lambda (mixed AWS+Cloudflare providers), and a Worker bound withAxiom.Telemetryexports to real Axiom datasets, verified out-of-band via an APL query. Server-runtime templates are covered by type-check and entry-bundle validation.🤖 Generated with Claude Code