overengineeringstudio / overengineeringstudio/effect-utils
Add OTel file exporter for offline trace debugging
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 82
- Forks
- 2
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 121
Description
Goal
Provide an easy way to capture OpenTelemetry traces/spans to a file for offline debugging and analysis, without needing to run a collector or backend.
Use Cases
- Debugging Effect programs - Capture the execution trace of an Effect across IO boundaries
- Post-mortem analysis - Save traces to a file for later inspection
- Development - Quick trace capture without infrastructure setup
- Testing - Assert on trace structure in tests
Proposed API
import { OtelFileExporter } from '@overeng/utils/node'
// Option 1: Layer that writes spans to a JSON Lines file
const TracingLayer = OtelFileExporter.layer({ path: '/tmp/traces.jsonl' })
// Option 2: Effect that returns trace data
const trace = yield* OtelFileExporter.captureTrace(myEffect)
// trace: { spans: Span[], duration: number, ... }
// Option 3: Integration with @effect/opentelemetry
import { NodeSdk } from '@effect/opentelemetry'
const sdk = NodeSdk.layer(() => ({
spanProcessor: new SimpleSpanProcessor(OtelFileExporter.make('/tmp/traces.jsonl'))
}))
Output Format
JSON Lines format (one span per line) for easy streaming and parsing:
{"traceId":"abc123","spanId":"def456","name":"myOperation","startTime":1234567890,"endTime":1234567891,"attributes":{"key":"value"},"events":[],"links":[]}
{"traceId":"abc123","spanId":"ghi789","parentSpanId":"def456","name":"childOperation",...}
Related Issues
- Effect-TS/effect#2212 - Use span attributes to enrich stack traces
- Effect-TS/effect#2815 - Add Cause.spans (resolved)
Implementation Notes
- Could build on
@effect/opentelemetryor be standalone - Consider compatibility with standard OTLP JSON format
- Should handle high-volume spans efficiently (buffering, async writes)
- Consider log rotation for long-running processes
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the proposed @overengineeringstudio/effect-utils/node entry point and the @effect/opentelemetry NodeSdk integration. Resolve which OtelFileExporter API and OTLP-compatible JSON Lines behavior are in scope, then verify that captured spans support the listed debugging and testing use cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- observability
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100